-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat : controller 구현 * feat : repository에 id로 조회 기능 생성 * feat : service에 조회 기능 구현 * feat : 응답 DTO 구현 * refactor : domain 필드 자료형 변경 * refactor : stream 라인 변경 * refactor : 코드 축약 * test : 단일 조회 테스트 작성 * refactor : 에러 메시지 구체적으로 수정 * refactor : 기존 응답 구조와 동일하도록 수정 * test : 테스트에 이미지 추가
- Loading branch information
1 parent
eeb9920
commit e788759
Showing
10 changed files
with
276 additions
and
14 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
92 changes: 92 additions & 0 deletions
92
src/main/java/in/koreatech/koin/domain/land/dto/LandResponse.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,92 @@ | ||
package in.koreatech.koin.domain.land.dto; | ||
|
||
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
|
||
import in.koreatech.koin.domain.land.model.Land; | ||
|
||
@JsonNaming(value = SnakeCaseStrategy.class) | ||
public record LandResponse( | ||
Boolean optElectronicDoorLocks, | ||
Boolean optTv, | ||
String monthlyFee, | ||
Boolean optElevator, | ||
Boolean optWaterPurifier, | ||
Boolean optWasher, | ||
Double latitude, | ||
String charterFee, | ||
Boolean optVeranda, | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdAt, | ||
String description, | ||
List<String> imageUrls, | ||
Boolean optGasRange, | ||
Boolean optInduction, | ||
String internalName, | ||
Boolean isDeleted, | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime updatedAt, | ||
Boolean optBidet, | ||
Boolean optShoeCloset, | ||
Boolean optRefrigerator, | ||
Long id, | ||
Long floor, | ||
String managementFee, | ||
Boolean optDesk, | ||
Boolean optCloset, | ||
Double longitude, | ||
String address, | ||
Boolean optBed, | ||
Double size, | ||
String phone, | ||
Boolean optAirConditioner, | ||
String name, | ||
String deposit, | ||
Boolean optMicrowave, | ||
String permalink, | ||
String roomType) { | ||
|
||
public static LandResponse of(Land land, List<String> imageUrls, String permalink) { | ||
return new LandResponse( | ||
land.getOptElectronicDoorLocks(), | ||
land.getOptTv(), | ||
land.getMonthlyFee(), | ||
land.getOptElevator(), | ||
land.getOptWaterPurifier(), | ||
land.getOptWasher(), | ||
land.getLatitude(), | ||
land.getCharterFee(), | ||
land.getOptVeranda(), | ||
land.getCreatedAt(), | ||
land.getDescription(), | ||
imageUrls, | ||
land.getOptGasRange(), | ||
land.getOptInduction(), | ||
land.getInternalName(), | ||
land.getIsDeleted(), | ||
land.getUpdatedAt(), | ||
land.getOptBidet(), | ||
land.getOptShoeCloset(), | ||
land.getOptRefrigerator(), | ||
land.getId(), | ||
land.getFloor(), | ||
land.getManagementFee(), | ||
land.getOptDesk(), | ||
land.getOptCloset(), | ||
land.getLongitude(), | ||
land.getAddress(), | ||
land.getOptBed(), | ||
land.getSize(), | ||
land.getPhone(), | ||
land.getOptAirConditioner(), | ||
land.getName(), | ||
land.getDeposit(), | ||
land.getOptMicrowave(), | ||
permalink, | ||
land.getRoomType() | ||
); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/in/koreatech/koin/domain/land/exception/LandNotFoundException.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,14 @@ | ||
package in.koreatech.koin.domain.land.exception; | ||
|
||
public class LandNotFoundException extends RuntimeException { | ||
private static final String DEFAULT_MESSAGE = "복덕방이 존재하지 않습니다."; | ||
|
||
public LandNotFoundException(String message) { | ||
super(message); | ||
} | ||
|
||
public static LandNotFoundException withDetail(String detail) { | ||
String message = String.format("%s %s", DEFAULT_MESSAGE, detail); | ||
return new LandNotFoundException(message); | ||
} | ||
} |
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
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
Oops, something went wrong.