-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,014 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/main/java/com/ajou/hertz/domain/instrument/dto/request/InstrumentUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.ajou.hertz.domain.instrument.dto.request; | ||
|
||
import java.util.List; | ||
|
||
import org.hibernate.validator.constraints.Length; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import com.ajou.hertz.common.dto.request.AddressRequest; | ||
import com.ajou.hertz.domain.instrument.constant.InstrumentProgressStatus; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Setter | ||
@Getter | ||
public abstract class InstrumentUpdateRequest { | ||
|
||
@Schema(description = "제목", example = "펜더 로드원 텔레캐스터") | ||
@Nullable | ||
private String title; | ||
|
||
@Nullable | ||
private InstrumentProgressStatus progressStatus; | ||
|
||
@Schema(description = "거래 장소") | ||
@Nullable | ||
private AddressRequest tradeAddress; | ||
|
||
@Schema(description = "악기 상태. 1~5 단계로 구성됩니다.", example = "3") | ||
@Min(1) | ||
@Max(5) | ||
@Nullable | ||
private Short qualityStatus; | ||
|
||
@Schema(description = "가격", example = "527000") | ||
@Nullable | ||
private Integer price; | ||
|
||
@Schema(description = "특이사항 유무", example = "true") | ||
@Nullable | ||
private Boolean hasAnomaly; | ||
|
||
@Schema(description = "특이사항 및 상세 설명. 내용이 없을 경우에는 빈 문자열로 요청하면 됩니다.", example = "14년 시리얼 펜더 로드원 50 텔레입니다. 기존 ...") | ||
@Nullable | ||
private String description; | ||
|
||
@Schema(description = "삭제한 이미지의 id 리스트") | ||
@Nullable | ||
private List<Long> deletedImageIds; | ||
|
||
@Schema(description = "새로 추가된 악기 이미지 리스트") | ||
@Nullable | ||
private List<MultipartFile> newImages; | ||
|
||
@Schema(description = "삭제한 해시태그의 id 리스트") | ||
@Nullable | ||
private List<Long> deletedHashtagIds; | ||
|
||
@Schema(description = "새로 추가된 악기 해시태그(각 해시태그마다 최대 10글자) 리스트", example = "[\"펜더\", \"Fender\"]") | ||
@Nullable | ||
private List<@NotBlank @Length(max = 10) String> newHashtags; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...ajou/hertz/domain/instrument/electric_guitar/dto/request/ElectricGuitarUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.ajou.hertz.domain.instrument.electric_guitar.dto.request; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.lang.Nullable; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import com.ajou.hertz.common.dto.request.AddressRequest; | ||
import com.ajou.hertz.domain.instrument.constant.GuitarColor; | ||
import com.ajou.hertz.domain.instrument.constant.InstrumentProgressStatus; | ||
import com.ajou.hertz.domain.instrument.dto.request.InstrumentUpdateRequest; | ||
import com.ajou.hertz.domain.instrument.electric_guitar.constant.ElectricGuitarBrand; | ||
import com.ajou.hertz.domain.instrument.electric_guitar.constant.ElectricGuitarModel; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Setter | ||
@Getter | ||
public class ElectricGuitarUpdateRequest extends InstrumentUpdateRequest { | ||
|
||
@Nullable | ||
private ElectricGuitarBrand brand; | ||
|
||
@Nullable | ||
private ElectricGuitarModel model; | ||
|
||
@Schema(description = "생산 연도", example = "2014") | ||
@Nullable | ||
private Short productionYear; | ||
|
||
@Nullable | ||
private GuitarColor color; | ||
|
||
private ElectricGuitarUpdateRequest( | ||
@Nullable String title, | ||
@Nullable InstrumentProgressStatus progressStatus, | ||
@Nullable AddressRequest tradeAddress, | ||
@Nullable Short qualityStatus, | ||
@Nullable Integer price, | ||
@Nullable Boolean hasAnomaly, | ||
@Nullable String description, | ||
@Nullable List<Long> deletedImageIds, | ||
@Nullable List<MultipartFile> newImages, | ||
@Nullable List<Long> deletedHashtagIds, | ||
@Nullable List<String> newHashtags, | ||
@Nullable ElectricGuitarBrand brand, | ||
@Nullable ElectricGuitarModel model, | ||
@Nullable Short productionYear, | ||
@Nullable GuitarColor color | ||
) { | ||
super(title, progressStatus, tradeAddress, qualityStatus, price, hasAnomaly, description, | ||
deletedImageIds, newImages, deletedHashtagIds, newHashtags); | ||
this.brand = brand; | ||
this.model = model; | ||
this.productionYear = productionYear; | ||
this.color = color; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...com/ajou/hertz/domain/instrument/exception/InstrumentUpdatePermissionDeniedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.ajou.hertz.domain.instrument.exception; | ||
|
||
import com.ajou.hertz.common.exception.ForbiddenException; | ||
import com.ajou.hertz.common.exception.constant.CustomExceptionType; | ||
|
||
public class InstrumentUpdatePermissionDeniedException extends ForbiddenException { | ||
public InstrumentUpdatePermissionDeniedException(Long userId, Long instrumentId) { | ||
super( | ||
CustomExceptionType.INSTRUMENT_UPDATE_PERMISSION_DENIED, | ||
String.format("userId=%s instrumentId=%s", userId, instrumentId) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.