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())