From 732572c73337a016e335c320e7544eb8b6b7367a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=A9=E1=86=BC?= =?UTF-8?q?=E1=84=8B=E1=85=AF=E1=86=AB=20Jongwon?= Date: Thu, 24 Aug 2023 11:51:33 +0900 Subject: [PATCH] =?UTF-8?q?[STYLE]=20#434:=20Dto=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=EB=AA=85=20=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/autoever2/cartag/cars/CarRepository.java | 8 ++++---- .../src/main/java/autoever2/cartag/cars/CarService.java | 7 +++---- .../cartag/domain/color/InnerColorPercentDto.java | 2 +- .../cartag/domain/color/OuterColorPercentDto.java | 4 +--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/autoever2/cartag/cars/CarRepository.java b/backend/src/main/java/autoever2/cartag/cars/CarRepository.java index 9532ff3..acde188 100644 --- a/backend/src/main/java/autoever2/cartag/cars/CarRepository.java +++ b/backend/src/main/java/autoever2/cartag/cars/CarRepository.java @@ -2,7 +2,7 @@ import autoever2.cartag.cars.dto.CarInfoDto; import autoever2.cartag.cars.dto.CarTypeDto; -import autoever2.cartag.cars.dto.TrimInfoDto; +import autoever2.cartag.cars.dto.TrimDataDto; import org.springframework.dao.support.DataAccessUtils; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.RowMapper; @@ -53,7 +53,7 @@ public List findAllCarType() { return template.query(sql, carTypeDtoRowMapper()); } - public Optional findTrimInfoByCarId(int carId) { + public Optional findTrimInfoByCarId(int carId) { String sql = "select car_id, trim, car_default_price " + "from Car " + "where car_id = :carId"; @@ -91,8 +91,8 @@ private RowMapper intMapper() { return (rs, rowNum) -> rs.getInt("car_default_price"); } - private RowMapper trimInfoRowMapper() { - return BeanPropertyRowMapper.newInstance(TrimInfoDto.class); + private RowMapper trimInfoRowMapper() { + return BeanPropertyRowMapper.newInstance(TrimDataDto.class); } } diff --git a/backend/src/main/java/autoever2/cartag/cars/CarService.java b/backend/src/main/java/autoever2/cartag/cars/CarService.java index cfa1a5a..eb31896 100644 --- a/backend/src/main/java/autoever2/cartag/cars/CarService.java +++ b/backend/src/main/java/autoever2/cartag/cars/CarService.java @@ -1,8 +1,7 @@ package autoever2.cartag.cars; import autoever2.cartag.cars.dto.*; -import autoever2.cartag.domain.color.InnerColorDto; -import autoever2.cartag.domain.color.OuterColorDto; +import autoever2.cartag.domain.color.ColorDto; import autoever2.cartag.models.dto.ModelDefaultDto; import autoever2.cartag.exception.EmptyDataException; import autoever2.cartag.exception.ErrorCode; @@ -44,8 +43,8 @@ public List getCarDtoByCarType(int carType) { } public CarDefaultDto getCarDefaultDtoByCarId(int carId) { - List outerColorList = colorRepository.findOuterColorCarByCarId(carId); - List innerColorList = colorRepository.findInnerColorCarByCarId(carId); + List outerColorList = colorRepository.findOuterColorCarByCarId(carId); + List innerColorList = colorRepository.findInnerColorCarByCarId(carId); List modelList = modelRepository.findDefaultModelListByCarId(carId); if (outerColorList.isEmpty() || innerColorList.isEmpty() || modelList.isEmpty()) { throw new EmptyDataException(ErrorCode.DATA_NOT_EXISTS); diff --git a/backend/src/main/java/autoever2/cartag/domain/color/InnerColorPercentDto.java b/backend/src/main/java/autoever2/cartag/domain/color/InnerColorPercentDto.java index d23b275..cbc6bb0 100644 --- a/backend/src/main/java/autoever2/cartag/domain/color/InnerColorPercentDto.java +++ b/backend/src/main/java/autoever2/cartag/domain/color/InnerColorPercentDto.java @@ -28,7 +28,7 @@ public InnerColorPercentDto(int colorId, String colorName, String colorImage, Lo this.colorCarImage = colorCarImage; } - public static InnerColorPercentDto toPercent(InnerColorDto innerColorDto, int colorBoughtPercent) { + public static InnerColorPercentDto toPercent(ColorDto innerColorDto, int colorBoughtPercent) { return InnerColorPercentDto.builder() .colorId(innerColorDto.getColorId()) .colorName(innerColorDto.getColorName()) diff --git a/backend/src/main/java/autoever2/cartag/domain/color/OuterColorPercentDto.java b/backend/src/main/java/autoever2/cartag/domain/color/OuterColorPercentDto.java index c38c281..8c63784 100644 --- a/backend/src/main/java/autoever2/cartag/domain/color/OuterColorPercentDto.java +++ b/backend/src/main/java/autoever2/cartag/domain/color/OuterColorPercentDto.java @@ -3,8 +3,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; @Getter @Schema(description = "차량 외부 색상 반환 DTO") @@ -32,7 +30,7 @@ public OuterColorPercentDto(int colorId, String colorName, String colorImage, Lo this.colorCarImage = colorCarImage; } - public static OuterColorPercentDto toPercent(OuterColorDto outerColorDto, int colorBoughtPercent, String imageUrl) { + public static OuterColorPercentDto toPercent(ColorDto outerColorDto, int colorBoughtPercent, String imageUrl) { return OuterColorPercentDto.builder() .colorId(outerColorDto.getColorId()) .colorName(outerColorDto.getColorName())