Skip to content

Commit

Permalink
Merge pull request #106 from jurumarble/dev
Browse files Browse the repository at this point in the history
style : 댓글 내용, 투표 제목, 투표 내용, 제목 A,B에 Request에 요구사항에 맞게 @SiZe 적용
  • Loading branch information
alsduq1117 authored Oct 17, 2023
2 parents 225ed86 + d503fda commit d6c1fe1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -16,8 +17,9 @@ public class CreateCommentRequest {
@Schema(description = "부모 댓글 ID")
private Long parentId;

@Schema(description = "댓글 내용", example = "좋습니다!", maxLength = 500)
@Schema(description = "댓글 내용", example = "좋습니다!")
@NotBlank
@Size(max = 600)
private String content;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class CreateDrinkVoteRequest {

@Schema(description = "투표 제목", example = "A, B 중 어떤게 나을까요?")
@NotBlank(message = "투표 제목은 필수입니다.")
@Size(max = 75)
private String title;

@Schema(description = "전통주 후보 A의 id (전통주 아이디는 다른값으로 넣어주셔야합니다.)")
Expand All @@ -27,6 +29,7 @@ public class CreateDrinkVoteRequest {
private Long drinkBId;

@Schema(description = "전통주 투표 상세 내용")
@Size(max = 600)
private String detail;

public CreateDrinkVoteServiceRequest toServiceRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class CreateNormalVoteRequest {

@Schema(description = "투표 제목", example = "A, B 중 어떤게 나을까요?")
@NotBlank(message = "투표 제목은 필수입니다.")
@Size(max = 75)
private String title;

@Schema(description = "투표 상세", example = "A는 ~때문에 고민이고 B는 ~때문에 고민입니다")
@Size(max = 600)
private String detail;

@Schema(description = "A 항목의 제목")
@NotBlank(message = "투표 A항목의 제목은 필수입니다.")
@Size(max = 55)
private String titleA;

@Schema(description = "B 항목의 제목")
@NotBlank(message = "투표 B항목의 제목은 필수입니다.")
@Size(max = 55)
private String titleB;

@Schema(description = "A 이미지", example = "https://shopping-phinf.pstatic.net/main_8259853/82598534476.2.jpg")
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ CREATE TABLE vote
(
id BIGINT NOT NULL AUTO_INCREMENT,
posted_user_id BIGINT NOT NULL,
title VARCHAR(55) DEFAULT NULL,
detail VARCHAR(255) DEFAULT NULL,
title VARCHAR(100) DEFAULT NULL,
detail VARCHAR(700) DEFAULT NULL,
filtered_age VARCHAR(10) DEFAULT NULL,
filtered_gender VARCHAR(6) DEFAULT NULL,
filtered_mbti VARCHAR(4) DEFAULT NULL,
Expand All @@ -32,8 +32,8 @@ CREATE TABLE vote_content
vote_id BIGINT NOT NULL,
imageA VARCHAR(500) DEFAULT NULL,
imageB VARCHAR(500) DEFAULT NULL,
titleA VARCHAR(55) DEFAULT NULL,
titleB VARCHAR(55) DEFAULT NULL,
titleA VARCHAR(100) DEFAULT NULL,
titleB VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (id)
);

Expand Down Expand Up @@ -129,7 +129,7 @@ CREATE TABLE comment
user_id BIGINT NOT NULL,
vote_id BIGINT DEFAULT NULL,
drink_id BIGINT DEFAULT NULL,
content VARCHAR(255) NOT NULL,
content VARCHAR(700) NOT NULL,
age VARCHAR(255) DEFAULT NULL,
mbti VARCHAR(4) DEFAULT NULL,
gender VARCHAR(6) DEFAULT NULL,
Expand Down

0 comments on commit d6c1fe1

Please sign in to comment.