-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
너무 많아져서 관리가 힘들어짐.
- Loading branch information
Showing
19 changed files
with
329 additions
and
249 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
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
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
16 changes: 16 additions & 0 deletions
16
...src/main/java/com/codesquad/airbnb/common/dummydata/AccommodationDTODummyDataFactory.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,16 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationDTO; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class AccommodationDTODummyDataFactory { | ||
private AccommodationDTODummyDataFactory(){} | ||
|
||
public static List<AccommodationDTO> listWithId() { | ||
return AccommodationDummyDataFactory.listWithId().stream() | ||
.map(AccommodationDTO::from) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...be/src/main/java/com/codesquad/airbnb/common/dummydata/AccommodationDummyDataFactory.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.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.domain.Accommodation; | ||
import com.codesquad.airbnb.accommodation.domain.AccommodationBuilder; | ||
import com.codesquad.airbnb.accommodation.domain.price.Price; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class AccommodationDummyDataFactory { | ||
private AccommodationDummyDataFactory() { | ||
} | ||
|
||
public static AccommodationBuilder builderWithSuiteRoom() { | ||
return Accommodation.builder() | ||
.name("어텀호텔 스위트룸") | ||
.accommodationOption(AccommodationOptionDummyDataFactory.normal()) | ||
.reviewRating(4.8) | ||
.reviewCounts(5) | ||
.mainImage("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg") | ||
.images(Arrays.asList("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg", "https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg")) | ||
.description("어텀호텔 스위트룸입니다.") | ||
.accommodationHost(AccommodationHostDummyDataFactory.create()) | ||
.accommodationPrice(Price.from(400000)); | ||
} | ||
|
||
public static AccommodationBuilder builderWithOneRoom() { | ||
return Accommodation.builder() | ||
.name("롤로호텔 일반객실") | ||
.accommodationOption(AccommodationOptionDummyDataFactory.oneRoom()) | ||
.reviewRating(4.2) | ||
.reviewCounts(5) | ||
.mainImage("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg") | ||
.images(Arrays.asList("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg", "https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg")) | ||
.description("롤로호텔 일반객실입니다.") | ||
.accommodationHost(AccommodationHostDummyDataFactory.create()) | ||
.accommodationPrice(Price.from(200000)); | ||
} | ||
|
||
public static AccommodationBuilder builderWithLowQuality() { | ||
return Accommodation.builder() | ||
.name("프레디 여관") | ||
.accommodationOption(AccommodationOptionDummyDataFactory.publicRestroom()) | ||
.reviewRating(3.1) | ||
.reviewCounts(5) | ||
.mainImage("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg") | ||
.images(Arrays.asList("https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg", "https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg")) | ||
.description("프레디 여관입니다.") | ||
.accommodationHost(AccommodationHostDummyDataFactory.create()) | ||
.accommodationPrice(Price.from(40000)); | ||
} | ||
|
||
public static List<Accommodation> list() { | ||
return Arrays.asList( | ||
builderWithSuiteRoom().build(), | ||
builderWithOneRoom().build(), | ||
builderWithLowQuality().build() | ||
); | ||
} | ||
|
||
public static List<Accommodation> listWithId() { | ||
return Arrays.asList( | ||
builderWithSuiteRoom().id(1L).build(), | ||
builderWithOneRoom().id(2L).build(), | ||
builderWithLowQuality().id(3L).build() | ||
); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...rc/main/java/com/codesquad/airbnb/common/dummydata/AccommodationHostDummyDataFactory.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,12 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationHost; | ||
|
||
public class AccommodationHostDummyDataFactory { | ||
private AccommodationHostDummyDataFactory() { | ||
} | ||
|
||
public static AccommodationHost create() { | ||
return new AccommodationHost(1L, "name", "https://image.zdnet.co.kr/2016/12/08/imc_47ix3fAqITYz5QtR.jpg"); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
.../main/java/com/codesquad/airbnb/common/dummydata/AccommodationOptionDummyDataFactory.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,54 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.domain.AccommodationOption; | ||
import com.codesquad.airbnb.accommodation.domain.AccommodationType; | ||
import com.codesquad.airbnb.accommodation.domain.RestroomType; | ||
|
||
public class AccommodationOptionDummyDataFactory { | ||
private AccommodationOptionDummyDataFactory(){} | ||
|
||
public static AccommodationOption normal() { | ||
return AccommodationOption.builder() | ||
.capacity(8) | ||
.pricePerNight(400000) | ||
.accommodationType(AccommodationType.NORMAL) | ||
.bedroomCount(3) | ||
.restroomCount(2) | ||
.restroomType(RestroomType.PRIVATE) | ||
.hasKitchen(false) | ||
.hasInternet(true) | ||
.hasAirconditioner(true) | ||
.hasHairdrier(true) | ||
.build(); | ||
} | ||
|
||
public static AccommodationOption oneRoom() { | ||
return AccommodationOption.builder() | ||
.capacity(4) | ||
.pricePerNight(200000) | ||
.accommodationType(AccommodationType.ONEROOM) | ||
.bedroomCount(1) | ||
.restroomCount(1) | ||
.restroomType(RestroomType.PRIVATE) | ||
.hasKitchen(false) | ||
.hasInternet(true) | ||
.hasAirconditioner(true) | ||
.hasHairdrier(true) | ||
.build(); | ||
} | ||
|
||
public static AccommodationOption publicRestroom() { | ||
return AccommodationOption.builder() | ||
.capacity(2) | ||
.pricePerNight(40000) | ||
.accommodationType(AccommodationType.ONEROOM) | ||
.bedroomCount(1) | ||
.restroomCount(1) | ||
.restroomType(RestroomType.PUBLIC) | ||
.hasKitchen(false) | ||
.hasInternet(false) | ||
.hasAirconditioner(true) | ||
.hasHairdrier(true) | ||
.build(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...n/java/com/codesquad/airbnb/common/dummydata/AccommodationPriceStatsDummyDataFactory.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,18 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationPriceStats; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class AccommodationPriceStatsDummyDataFactory { | ||
private AccommodationPriceStatsDummyDataFactory(){} | ||
|
||
public static List<AccommodationPriceStats> list() { | ||
return Arrays.asList( | ||
new AccommodationPriceStats(10000, 10), | ||
new AccommodationPriceStats(30000, 11), | ||
new AccommodationPriceStats(20000, 21) | ||
); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...a/com/codesquad/airbnb/common/dummydata/AccommodationReservationInfoDummyDataFactory.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,49 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationReservationInfo; | ||
|
||
public class AccommodationReservationInfoDummyDataFactory { | ||
private AccommodationReservationInfoDummyDataFactory(){} | ||
|
||
public static AccommodationReservationInfo suiteRoomOnePersonOneDay() { | ||
return AccommodationReservationInfo.builder() | ||
.id(1L) | ||
.pricePerNight(400000) | ||
.priceForNights(400000) | ||
.discountPrice(16000) | ||
.cleaningFee(20000) | ||
.serviceFee(40000) | ||
.accommodationTax(20000) | ||
.totalPrice(464000) | ||
.reviewCounts(5) | ||
.build(); | ||
} | ||
|
||
public static AccommodationReservationInfo suiteRoomOnePersonTwoDays() { | ||
return AccommodationReservationInfo.builder() | ||
.id(1L) | ||
.pricePerNight(400000) | ||
.priceForNights(800000) | ||
.discountPrice(32000) | ||
.cleaningFee(40000) | ||
.serviceFee(80000) | ||
.accommodationTax(40000) | ||
.totalPrice(928000) | ||
.reviewCounts(5) | ||
.build(); | ||
} | ||
|
||
public static AccommodationReservationInfo suiteRoomTwoPerson() { | ||
return AccommodationReservationInfo.builder() | ||
.id(1L) | ||
.pricePerNight(400000) | ||
.priceForNights(800000) | ||
.discountPrice(32000) | ||
.cleaningFee(40000) | ||
.serviceFee(80000) | ||
.accommodationTax(40000) | ||
.totalPrice(928000) | ||
.reviewCounts(5) | ||
.build(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ain/java/com/codesquad/airbnb/common/dummydata/AccommodationResponseDummyDataFactory.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,28 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationResponse; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class AccommodationResponseDummyDataFactory { | ||
private AccommodationResponseDummyDataFactory(){} | ||
|
||
public static List<AccommodationResponse> listWithOneNight() { | ||
return AccommodationDummyDataFactory.list().stream() | ||
.map(accommodation -> AccommodationResponse.of(accommodation,1)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
public static List<AccommodationResponse> listWithIdTypeOneNight() { | ||
return AccommodationDummyDataFactory.listWithId().stream() | ||
.map(accommodation -> AccommodationResponse.of(accommodation,1)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
public static List<AccommodationResponse> listWithIdTypeTwoNights() { | ||
return AccommodationDummyDataFactory.listWithId().stream() | ||
.map(accommodation -> AccommodationResponse.of(accommodation,2)) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...e/src/main/java/com/codesquad/airbnb/common/dummydata/ReservationDTODummyDataFactory.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,19 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationResponse; | ||
import com.codesquad.airbnb.reservation.controller.ReservationDTO; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class ReservationDTODummyDataFactory { | ||
private ReservationDTODummyDataFactory(){} | ||
|
||
public static List<ReservationDTO> list() { | ||
return Arrays.asList(create(), create()); | ||
} | ||
|
||
public static ReservationDTO create() { | ||
return new ReservationDTO(1L, AccommodationResponse.from(AccommodationDummyDataFactory.builderWithSuiteRoom().build())); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
.../src/main/java/com/codesquad/airbnb/common/dummydata/WishlistItemDTODummyDataFactory.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,20 @@ | ||
package com.codesquad.airbnb.common.dummydata; | ||
|
||
import com.codesquad.airbnb.accommodation.controller.AccommodationResponse; | ||
import com.codesquad.airbnb.wishlist.WishlistItemDTO; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class WishlistItemDTODummyDataFactory { | ||
private WishlistItemDTODummyDataFactory() { | ||
} | ||
|
||
public static List<WishlistItemDTO> list() { | ||
return Arrays.asList(create(), create()); | ||
} | ||
|
||
public static WishlistItemDTO create() { | ||
return new WishlistItemDTO(1L, AccommodationResponse.from(AccommodationDummyDataFactory.builderWithSuiteRoom().build())); | ||
} | ||
} |
Oops, something went wrong.