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(); } }