Skip to content

Commit

Permalink
[feat] City 엔티티 도시 영문명 필드 추가 및 그에 따른 해당 Request/Response DTO 필드 추가
Browse files Browse the repository at this point in the history
related to: #127
  • Loading branch information
jo0oy committed Jan 26, 2024
1 parent fb7b538 commit 9813282
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

public record AddCityRequestDto(
String name,
String englishName,
String language,
String timeDifference,
String voltage,
Expand All @@ -18,6 +19,7 @@ public record AddCityRequestDto(
public City toEntity() {
return City.builder()
.name(this.name)
.englishName(this.englishName)
.language(this.language)
.timeDifference(this.timeDifference)
.voltage(this.voltage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public record CityResponseDto(
Long cityId,
String name,
String englishName,
String language,
String timeDifference,
String voltage,
Expand All @@ -28,6 +29,7 @@ public static CityResponseDto fromEntity(City entity) {
return CityResponseDto.builder()
.cityId(entity.getId())
.name(entity.getName())
.englishName(entity.getEnglishName())
.language(entity.getLanguage())
.timeDifference(entity.getTimeDifference())
.voltage(entity.getVoltage())
Expand All @@ -47,6 +49,7 @@ public static CityResponseDto fromEntity(City entity, String exchangeRate) {
return CityResponseDto.builder()
.cityId(entity.getId())
.name(entity.getName())
.englishName(entity.getEnglishName())
.language(entity.getLanguage())
.timeDifference(entity.getTimeDifference())
.voltage(entity.getVoltage())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class City extends BaseTimeEntity {
@Column(name = "city_id")
private Long id;
private String name;
private String englishName;
private String language;
private String timeDifference;
private String voltage;
Expand All @@ -38,12 +39,13 @@ public class City extends BaseTimeEntity {

@Builder
private City(
Long id, String name, String language, String timeDifference,
Long id, String name, String englishName, String language, String timeDifference,
String voltage, String visa, CurrencyUnit currency, String weatherRecommendation,
String weatherDescription, Integer storeCount, Country country, String imageUrl
) {
this.id = id;
this.name = name;
this.englishName = englishName;
this.language = language;
this.timeDifference = timeDifference;
this.voltage = voltage;
Expand Down

0 comments on commit 9813282

Please sign in to comment.