Skip to content

Commit

Permalink
[feat] 도시 위/경도 정보 요청/응답 DTO에 추가
Browse files Browse the repository at this point in the history
related to: #140
  • Loading branch information
jo0oy committed Jan 31, 2024
1 parent 487604e commit 991882b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ public record AddCityRequestDto(
String currency,
String weatherRecommendation,
String weatherDescription,
Country country
Country country,
String imageUrl,
Double latitude,
Double longitude
) {
public City toEntity() {
return City.builder()
Expand All @@ -28,6 +31,9 @@ public City toEntity() {
.weatherRecommendation(this.weatherRecommendation)
.weatherDescription(this.weatherDescription)
.country(this.country)
.imageUrl(this.imageUrl)
.latitude(this.latitude)
.longitude(this.longitude)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public record CityInfoResponseDto(
String voltage,
String visa,
String curUnit,
String curName
String curName,
Double latitude,
Double longitude
) {

@Builder
Expand All @@ -34,6 +36,8 @@ public static CityInfoResponseDto fromEntity(City entity) {
.curName(
Objects.nonNull(entity.getCurrency()) ? entity.getCurrency().getCurrencyName() : null
)
.latitude(entity.getLatitude())
.longitude(entity.getLongitude())
.build();
}
}

0 comments on commit 991882b

Please sign in to comment.