From 4dc4deae3a280ca659b4b156b82b6da623c0703b Mon Sep 17 00:00:00 2001 From: mac_daehwan2yo Date: Tue, 28 Dec 2021 14:18:19 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=AA=EF=B8=8F[REF]-#24-Party=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9D=BC,=20=EC=A2=85=EB=A3=8C=EC=9D=BC=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LocalDate -> String --- .../trti/domain/city/repository/CityRepository.java | 2 +- .../trti/domain/party/implementation/PartyServiceImpl.java | 6 +++--- .../com/codingwasabi/trti/domain/party/model/Party.java | 6 ++---- .../domain/party/model/request/RequestCreatePartyDto.java | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/codingwasabi/trti/domain/city/repository/CityRepository.java b/src/main/java/com/codingwasabi/trti/domain/city/repository/CityRepository.java index 8804865..3d1ba9f 100644 --- a/src/main/java/com/codingwasabi/trti/domain/city/repository/CityRepository.java +++ b/src/main/java/com/codingwasabi/trti/domain/city/repository/CityRepository.java @@ -7,5 +7,5 @@ import java.util.Optional; public interface CityRepository extends JpaRepository { - Optional findByCity(Location city2); + Optional findByLocation(Location location); } diff --git a/src/main/java/com/codingwasabi/trti/domain/party/implementation/PartyServiceImpl.java b/src/main/java/com/codingwasabi/trti/domain/party/implementation/PartyServiceImpl.java index 2315796..8182681 100644 --- a/src/main/java/com/codingwasabi/trti/domain/party/implementation/PartyServiceImpl.java +++ b/src/main/java/com/codingwasabi/trti/domain/party/implementation/PartyServiceImpl.java @@ -23,7 +23,7 @@ public class PartyServiceImpl implements PartyService { private final PartyRepository partyRepository; private final MemberInPartyRepository memberInPartyRepository; private final MemberRepository memberRepository; - private final CityRepository locationRepository; + private final CityRepository cityRepository; @Override @Transactional @@ -45,8 +45,8 @@ private void setPartyCaptain(Member member, Party party) { private void setPartyCity(RequestCreatePartyDto requestDto, Party party) { Location.parseName(requestDto.getLocation()); - party.setLocation(locationRepository - .findByCity(Location.parseName(requestDto.getLocation())) + party.setLocation(cityRepository + .findByLocation(Location.parseName(requestDto.getLocation())) .orElseThrow(() -> new IllegalArgumentException("[ERROR] 도시의 정보가 존재하지 않습니다."))); } diff --git a/src/main/java/com/codingwasabi/trti/domain/party/model/Party.java b/src/main/java/com/codingwasabi/trti/domain/party/model/Party.java index 0f2c9bd..ae5c725 100644 --- a/src/main/java/com/codingwasabi/trti/domain/party/model/Party.java +++ b/src/main/java/com/codingwasabi/trti/domain/party/model/Party.java @@ -9,8 +9,6 @@ import lombok.NoArgsConstructor; import javax.persistence.*; -import java.time.LocalDate; - @Entity @Getter @Builder @@ -25,9 +23,9 @@ public class Party extends Period { private String imageLink; - private LocalDate startDate; + private String startDate; - private LocalDate endDate; + private String endDate; private boolean isAgreed; diff --git a/src/main/java/com/codingwasabi/trti/domain/party/model/request/RequestCreatePartyDto.java b/src/main/java/com/codingwasabi/trti/domain/party/model/request/RequestCreatePartyDto.java index 5671a0e..72a87e1 100644 --- a/src/main/java/com/codingwasabi/trti/domain/party/model/request/RequestCreatePartyDto.java +++ b/src/main/java/com/codingwasabi/trti/domain/party/model/request/RequestCreatePartyDto.java @@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import java.time.LocalDate; import java.util.List; @Getter @@ -20,8 +19,8 @@ public Party getEntityFrom() { return Party.builder() .title(title) .imageLink(imageUrl) - .startDate(LocalDate.parse(period[0])) - .endDate(LocalDate.parse(period[1])) + .startDate(period[0]) + .endDate(period[1]) .build(); } }