Skip to content

Commit

Permalink
Merge pull request #92 from SWM-Flash/feature/FLASH-307-API-Compatibi…
Browse files Browse the repository at this point in the history
…lity

구버전 클라이언트에서 API 요청을 할 수 있도록 수정
  • Loading branch information
ChoiWonYu authored Oct 19, 2024
2 parents fe46b85 + 2f544d6 commit ac54153
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import com.first.flash.account.member.domain.ContentType;
import com.first.flash.global.annotation.ValidEnum;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

public record MemberReportRequest(@NotEmpty(message = "신고 사유는 필수입니다.") String reason,
@NotNull(message = "콘텐츠 타입은 필수입니다.") @ValidEnum(enumClass = ContentType.class) ContentType contentType) {
@ValidEnum(enumClass = ContentType.class) ContentType contentType) {

public MemberReportRequest(final String reason, final ContentType contentType) {
this.reason = reason;
this.contentType = contentType != null ? contentType : ContentType.SOLUTION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import com.first.flash.climbing.solution.domain.PerceivedDifficulty;
import com.first.flash.global.annotation.ValidEnum;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

public record SolutionCreateRequestDto(
@NotEmpty(message = "비디오 URL은 필수입니다.") String videoUrl,
@Size(max = 500, message = "리뷰는 최대 500자까지 가능합니다.") String review,
@NotNull(message = "체감 난이도는 필수입니다.")
@ValidEnum(enumClass = PerceivedDifficulty.class) PerceivedDifficulty perceivedDifficulty) {

public SolutionCreateRequestDto(final String videoUrl, final String review, final PerceivedDifficulty perceivedDifficulty) {
this.videoUrl = videoUrl;
this.review = review;
this.perceivedDifficulty = perceivedDifficulty != null ? perceivedDifficulty : PerceivedDifficulty.NORMAL;
}
}

0 comments on commit ac54153

Please sign in to comment.