-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/FC-Toy-Project-9/Toy_Pro…
…ject2 into feature/readme
- Loading branch information
Showing
13 changed files
with
354 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/com/fc/toy_project2/domain/itinerary/entity/Accommodation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.fc.toy_project2.domain.itinerary.entity; | ||
|
||
import com.fc.toy_project2.domain.itinerary.dto.response.AccommodationResponseDTO; | ||
import com.fc.toy_project2.domain.trip.entity.Trip; | ||
import com.fc.toy_project2.global.util.DateTypeFormatterUtil; | ||
import jakarta.persistence.Entity; | ||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Entity | ||
public class Accommodation extends Itinerary{ | ||
|
||
private String accommodationName; | ||
|
||
private String accommodationRoadAddressName; | ||
|
||
private LocalDateTime checkIn; | ||
|
||
private LocalDateTime checkOut; | ||
|
||
@Builder | ||
public Accommodation(Long id, Trip trip, String itineraryName, String accommodationName, String accommodationRoadAddressName, | ||
LocalDateTime checkIn, LocalDateTime checkOut) { | ||
super(id, trip, itineraryName); | ||
this.accommodationName = accommodationName; | ||
this.accommodationRoadAddressName = accommodationRoadAddressName; | ||
this.checkIn = checkIn; | ||
this.checkOut = checkOut; | ||
} | ||
|
||
public AccommodationResponseDTO toAccommodationResponseDTO() { | ||
return AccommodationResponseDTO.builder().itineraryId(super.getId()) | ||
.itineraryName(super.getItineraryName()).accommodationName(this.accommodationName) | ||
.accommodationRoadAddressName(this.accommodationRoadAddressName) | ||
.checkIn(DateTypeFormatterUtil.localDateTimeToString(this.checkIn)) | ||
.checkOut(DateTypeFormatterUtil.localDateTimeToString(this.checkOut)).build(); | ||
} | ||
|
||
public void updateAccommodationInfo(String itineraryName, String accommodationName, | ||
String accommodationRoadAddressName, LocalDateTime checkIn, LocalDateTime checkOut) { | ||
super.updateItineraryName(itineraryName); | ||
this.accommodationName = accommodationName; | ||
this.accommodationRoadAddressName = accommodationRoadAddressName; | ||
this.checkIn = checkIn; | ||
this.checkOut = checkOut; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/com/fc/toy_project2/domain/itinerary/entity/Transportation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.fc.toy_project2.domain.itinerary.entity; | ||
|
||
import com.fc.toy_project2.domain.itinerary.dto.response.TransportationResponseDTO; | ||
import com.fc.toy_project2.domain.trip.entity.Trip; | ||
import com.fc.toy_project2.global.util.DateTypeFormatterUtil; | ||
import jakarta.persistence.Entity; | ||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Entity | ||
public class Transportation extends Itinerary{ | ||
|
||
private String transportation; | ||
|
||
private String departurePlace; | ||
|
||
private String departurePlaceRoadAddressName; | ||
|
||
private String destination; | ||
|
||
private String destinationRoadAddressName; | ||
|
||
private LocalDateTime arrivalTime; | ||
|
||
private LocalDateTime departureTime; | ||
|
||
@Builder | ||
public Transportation(Long id, Trip trip, String itineraryName, String transportation, String departurePlace, | ||
String departurePlaceRoadAddressName, String destination, String destinationRoadAddressName, | ||
LocalDateTime arrivalTime, LocalDateTime departureTime) { | ||
super(id, trip, itineraryName); | ||
this.transportation = transportation; | ||
this.departurePlace = departurePlace; | ||
this.departurePlaceRoadAddressName = departurePlaceRoadAddressName; | ||
this.destination = destination; | ||
this.destinationRoadAddressName = destinationRoadAddressName; | ||
this.arrivalTime = arrivalTime; | ||
this.departureTime = departureTime; | ||
} | ||
|
||
public TransportationResponseDTO toTransportationResponseDTO() { | ||
return TransportationResponseDTO.builder().itineraryId(super.getId()) | ||
.itineraryName(super.getItineraryName()).transportation(this.transportation) | ||
.departurePlace(this.departurePlace) | ||
.departurePlaceRoadAddressName(this.departurePlaceRoadAddressName) | ||
.destination(this.destination) | ||
.destinationRoadAddressName(this.destinationRoadAddressName) | ||
.departureTime(DateTypeFormatterUtil.localDateTimeToString(this.departureTime)) | ||
.arrivalTime(DateTypeFormatterUtil.localDateTimeToString(this.arrivalTime)).build(); | ||
} | ||
|
||
public void updateTransportationInfo(String itineraryName, String transportation, | ||
String departurePlace, String departurePlaceRoadAddressName, String destination, | ||
String destinationRoadAddressName, LocalDateTime departureTime, LocalDateTime arrivalTime) { | ||
super.updateItineraryName(itineraryName); | ||
this.transportation = transportation; | ||
this.departurePlace = departurePlace; | ||
this.departurePlaceRoadAddressName = departurePlaceRoadAddressName; | ||
this.destination = destination; | ||
this.destinationRoadAddressName = destinationRoadAddressName; | ||
this.departureTime = departureTime; | ||
this.arrivalTime = arrivalTime; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/com/fc/toy_project2/domain/itinerary/entity/Visit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.fc.toy_project2.domain.itinerary.entity; | ||
|
||
import com.fc.toy_project2.domain.itinerary.dto.response.VisitResponseDTO; | ||
import com.fc.toy_project2.domain.trip.entity.Trip; | ||
import com.fc.toy_project2.global.util.DateTypeFormatterUtil; | ||
import jakarta.persistence.Entity; | ||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Entity | ||
public class Visit extends Itinerary { | ||
|
||
private String placeName; | ||
|
||
private String placeRoadAddressName; | ||
|
||
private LocalDateTime arrivalTime; | ||
|
||
private LocalDateTime departureTime; | ||
|
||
@Builder | ||
public Visit(Long id, Trip trip, String itineraryName, String placeName, String placeRoadAddressName, LocalDateTime arrivalTime, | ||
LocalDateTime departureTime) { | ||
super(id, trip, itineraryName); | ||
this.placeName = placeName; | ||
this.placeRoadAddressName = placeRoadAddressName; | ||
this.arrivalTime = arrivalTime; | ||
this.departureTime = departureTime; | ||
} | ||
|
||
public VisitResponseDTO toVisitResponseDTO() { | ||
return VisitResponseDTO.builder().itineraryId(super.getId()) | ||
.itineraryName(super.getItineraryName()).placeName(this.placeName) | ||
.placeRoadAddressName(this.placeRoadAddressName) | ||
.departureTime(DateTypeFormatterUtil.localDateTimeToString(this.departureTime)) | ||
.arrivalTime(DateTypeFormatterUtil.localDateTimeToString(this.arrivalTime)).build(); | ||
} | ||
|
||
public void updateVisitInfo(String itineraryName, String placeName, String placeRoadAddressName, | ||
LocalDateTime visitDepartureTime, LocalDateTime visitArrivalTime) { | ||
super.updateItineraryName(itineraryName); | ||
this.placeName = placeName; | ||
this.placeRoadAddressName = placeRoadAddressName; | ||
this.departureTime = visitDepartureTime; | ||
this.arrivalTime = visitArrivalTime; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/fc/toy_project2/domain/itinerary/repository/AccommodationRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.fc.toy_project2.domain.itinerary.repository; | ||
|
||
import com.fc.toy_project2.domain.itinerary.entity.Accommodation; | ||
import com.fc.toy_project2.domain.itinerary.entity.Itinerary; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface AccommodationRepository extends JpaRepository<Accommodation, Long> { | ||
|
||
} | ||
|
10 changes: 10 additions & 0 deletions
10
src/main/java/com/fc/toy_project2/domain/itinerary/repository/TransportationRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fc.toy_project2.domain.itinerary.repository; | ||
|
||
import com.fc.toy_project2.domain.itinerary.entity.Accommodation; | ||
import com.fc.toy_project2.domain.itinerary.entity.Transportation; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface TransportationRepository extends JpaRepository<Transportation, Long> { | ||
|
||
} | ||
|
10 changes: 10 additions & 0 deletions
10
src/main/java/com/fc/toy_project2/domain/itinerary/repository/VisitRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fc.toy_project2.domain.itinerary.repository; | ||
|
||
import com.fc.toy_project2.domain.itinerary.entity.Accommodation; | ||
import com.fc.toy_project2.domain.itinerary.entity.Visit; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface VisitRepository extends JpaRepository<Visit, Long> { | ||
|
||
} | ||
|
Oops, something went wrong.