|
6 | 6 | import com.ajou.hertz.domain.instrument.constant.ElectricGuitarBrand;
|
7 | 7 | import com.ajou.hertz.domain.instrument.constant.ElectricGuitarModel;
|
8 | 8 | import com.ajou.hertz.domain.instrument.constant.GuitarColor;
|
| 9 | +import com.ajou.hertz.domain.instrument.constant.InstrumentCategory; |
9 | 10 | import com.ajou.hertz.domain.instrument.constant.InstrumentProgressStatus;
|
10 | 11 | import com.ajou.hertz.domain.instrument.entity.ElectricGuitar;
|
11 | 12 | import com.ajou.hertz.domain.user.dto.UserDto;
|
@@ -33,41 +34,32 @@ private ElectricGuitarDto(
|
33 | 34 | Integer price,
|
34 | 35 | Boolean hasAnomaly,
|
35 | 36 | String description,
|
| 37 | + List<InstrumentImageDto> images, |
| 38 | + List<String> hashtags, |
36 | 39 | ElectricGuitarBrand brand,
|
37 | 40 | ElectricGuitarModel model,
|
38 | 41 | Short productionYear,
|
39 |
| - GuitarColor color, |
40 |
| - List<InstrumentImageDto> images, |
41 |
| - List<String> hashtags |
| 42 | + GuitarColor color |
42 | 43 | ) {
|
43 | 44 | super(
|
44 |
| - id, seller, title, progressStatus, tradeAddress, qualityStatus, |
45 |
| - price, hasAnomaly, description, images, hashtags |
| 45 | + id, seller, InstrumentCategory.ELECTRIC_GUITAR, title, progressStatus, tradeAddress, |
| 46 | + qualityStatus, price, hasAnomaly, description, images, hashtags |
46 | 47 | );
|
47 | 48 | this.brand = brand;
|
48 | 49 | this.model = model;
|
49 | 50 | this.productionYear = productionYear;
|
50 | 51 | this.color = color;
|
51 | 52 | }
|
52 | 53 |
|
| 54 | + private ElectricGuitarDto(ElectricGuitar electricGuitar) { |
| 55 | + super(electricGuitar); |
| 56 | + this.brand = electricGuitar.getBrand(); |
| 57 | + this.model = electricGuitar.getModel(); |
| 58 | + this.productionYear = electricGuitar.getProductionYear(); |
| 59 | + this.color = electricGuitar.getColor(); |
| 60 | + } |
| 61 | + |
53 | 62 | public static ElectricGuitarDto from(ElectricGuitar electricGuitar) {
|
54 |
| - InstrumentDto instrumentDto = InstrumentDto.from(electricGuitar); |
55 |
| - return new ElectricGuitarDto( |
56 |
| - instrumentDto.getId(), |
57 |
| - instrumentDto.getSeller(), |
58 |
| - instrumentDto.getTitle(), |
59 |
| - instrumentDto.getProgressStatus(), |
60 |
| - instrumentDto.getTradeAddress(), |
61 |
| - instrumentDto.getQualityStatus(), |
62 |
| - instrumentDto.getPrice(), |
63 |
| - instrumentDto.getHasAnomaly(), |
64 |
| - instrumentDto.getDescription(), |
65 |
| - electricGuitar.getBrand(), |
66 |
| - electricGuitar.getModel(), |
67 |
| - electricGuitar.getProductionYear(), |
68 |
| - electricGuitar.getColor(), |
69 |
| - instrumentDto.getImages(), |
70 |
| - instrumentDto.getHashtags() |
71 |
| - ); |
| 63 | + return new ElectricGuitarDto(electricGuitar); |
72 | 64 | }
|
73 | 65 | }
|
0 commit comments