Skip to content

Commit

Permalink
Merge pull request #142 from IT-Cotato/bugfix/141
Browse files Browse the repository at this point in the history
[REFACTOR] 제목 길이 50자로 수정, 유효성검증 어노테이션 추가
  • Loading branch information
u-genuine authored Feb 20, 2025
2 parents 8be8397 + 07f9e30 commit 6c7d8db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

public record CardNewsCreateRequest(
@NotBlank
@Size(max = 50, message = "제목은 최대 50자까지 입력할 수 있습니다.")
String title,
@Size(max = 1000, message = "내용은 최대 1000자까지 입력할 수 있습니다.")
String content,
@NotNull(message = "이미지는 필수입니다.")
List<MultipartFile> images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Post extends BaseTimeEntity {
@Column(name = "board_id", nullable = false)
private Long boardId;

@Column(name = "title", length = 30, nullable = false)
@Column(name = "title", length = 50, nullable = false)
private String title;

@Column(name = "content", length = 1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public record PostCreateRequest(
Long boardId,

@NotBlank
@Size(max=30)
@Size(max = 50, message = "제목은 최대 50자까지 입력할 수 있습니다.")
String title,

@NotBlank
@Size(max=1000)
@Size(max = 1000, message = "내용은 최대 1000자까지 입력할 수 있습니다.")
String content,

PostCategory postCategory,
Expand Down

0 comments on commit 6c7d8db

Please sign in to comment.