-
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.
#47 [feat] 게시글 수정 validation
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
module-domain/src/main/java/com/mile/post/service/dto/PostPutRequest.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 |
---|---|---|
@@ -1,10 +1,33 @@ | ||
package com.mile.post.service.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.Size; | ||
|
||
public record PostPutRequest( | ||
|
||
@NotEmpty(message = "글감 id가 입력되지 않았습니다.") | ||
@Schema(description = "글감 Id", example = "1") | ||
Long topicId, | ||
|
||
@NotBlank(message = "제목을 입력해주세요.") | ||
@Size(max = 29, message = "제목 최대 글자를 초과했습니다.") | ||
@Schema(description = "글 제목", example = "편안한 글쓰기") | ||
String title, | ||
|
||
|
||
@NotBlank(message = "내용을 입력해주세요.") | ||
@Size(max = 2500, message = "내용 최대 글자를 초과했습니다.") | ||
@Schema(description = "글 내용", example = "내용입니다.") | ||
String content, | ||
|
||
@NotBlank(message = "이미지 url을 입력해주세요.") | ||
@Schema(description = "이미지 url", example = "String https://") | ||
String imageUrl, | ||
|
||
@NotEmpty(message = "익명 여부를 입력해주세요.") | ||
@Schema(description = "익명 여부", example = "true") | ||
boolean anonymous | ||
) { | ||
} |