Skip to content

Commit

Permalink
[merge] 필수 requset 필드 수정
Browse files Browse the repository at this point in the history
[hotfix] 필수 requset 필드 수정
  • Loading branch information
lreowy authored Jul 15, 2024
2 parents c886379 + 5726da5 commit 9ba38c4
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.pickple.server.api.moim.domain;

import jakarta.validation.constraints.NotBlank;
import lombok.Getter;

@Getter
public class CategoryInfo {

@NotBlank(message = "카테고리가 비어있습니다.")
private String category1;

private String category2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package com.pickple.server.api.moim.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.time.LocalTime;
import lombok.Getter;

@Getter
public class DateInfo {

@NotBlank(message = "날짜가 비어있습니다.")
@JsonFormat(pattern = "yyyy.MM.dd")
private LocalDate date;

@NotBlank(message = "요일이 비어있습니다.")
private String dayOfWeek;

@NotBlank(message = "시작 시간이 비어있습니다.")
@JsonFormat(pattern = "HH:mm")
private LocalTime startTime;

@NotBlank(message = "종료 시간이 비어있습니다.")
@JsonFormat(pattern = "HH:mm")
private LocalTime endTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.pickple.server.api.moim.domain;

import jakarta.validation.constraints.NotBlank;
import lombok.Getter;

@Getter
public class ImageInfo {

@NotBlank(message = "이미지가 비어있습니다.")
private String imageUrl1;

private String imageUrl2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package com.pickple.server.api.moim.domain;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;

@Getter
public class QuestionInfo {

@Size(max = 50, message = "50자 이내로 작성해주세요.")
@NotBlank(message = "질문이 비어있습니다.")
private String question1;

@Size(max = 50, message = "50자 이내로 작성해주세요.")
private String question2;

@Size(max = 50, message = "50자 이내로 작성해주세요.")
private String question3;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,37 @@
import com.pickple.server.api.moim.domain.ImageInfo;
import com.pickple.server.api.moim.domain.QuestionInfo;
import com.pickple.server.api.moimsubmission.domain.AccountInfo;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public record MoimCreateRequest(
CategoryInfo categoryList,

@NotBlank(message = "오프라인 여부가 비어있습니다")
boolean isOffline,

@NotBlank(message = "모임 장소가 비어있습니다.")
String spot,

DateInfo dateList,

@NotBlank(message = "모임 정원이 비어있습니다.")
int maxGuest,

@NotBlank(message = "참가비가 비어있습니다.")
int fee,

AccountInfo accountList,
QuestionInfo questionList,

@Size(max = 28, message = "28자 이내로 작성해 주세요.")
@NotBlank(message = "제목이 비어있습니다.")
String title,

@Size(max = 2000, message = "2000자 이내로 작성해 주세요.")
@NotBlank(message = "소개글이 비어있습니다.")
String description,

ImageInfo imageList
) {
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.pickple.server.api.moimsubmission.domain;

import jakarta.validation.constraints.NotBlank;
import lombok.Getter;

@Getter
public class AccountInfo {

@NotBlank(message = "예금주가 비어있습니다.")
private String holder;

@NotBlank(message = "은행이 비어있습니다.")
private String bank;

@NotBlank(message = "계좌번호가 비어있습니다.")
private String accountNumber;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.pickple.server.api.moimsubmission.domain;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;

@Getter
public class AnswerInfo {

@Size(max = 200, message = "200자 이내로 작성해주세요.")
@NotBlank(message = "답변이 비어있습니다.")
private String answer1;

@Size(max = 200, message = "200자 이내로 작성해주세요.")
private String answer2;

@Size(max = 200, message = "200자 이내로 작성해주세요.")
private String answer3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,9 @@

import com.pickple.server.api.moimsubmission.domain.AccountInfo;
import com.pickple.server.api.moimsubmission.domain.AnswerInfo;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public record MoimSubmitRequest(
AnswerInfo answerList,
AccountInfo accountList
) {
public record AnswerList(
@Size(max = 200, message = "답변은 200자 이내로 작성해주세요.")
@NotBlank(message = "답변이 비어있습니다.")
String answer1,

@Size(max = 200, message = "답변은 200자 이내로 작성해주세요.")
@NotBlank(message = "답변이 비어있습니다.")
String answer2,

@Size(max = 200, message = "답변은 200자 이내로 작성해주세요.")
@NotBlank(message = "답변이 비어있습니다.")
String answer3
) {
}

public record AccountList(
@NotBlank(message = "예금주가 비어있습니다.")
String holder,

@NotBlank(message = "입금 은행이 비어있습니다.")
String bank,

@Size(max = 20, message = "계좌번호는 20자 이내로 작성해주세요.")
@NotBlank(message = "계좌번호가 비어있습니다.")
String accountNumber
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class S3Controller implements S3ControllerDocs {
private final S3Service s3Service;

@GetMapping("/moim-image-list/upload/{count}")
@GetMapping("/v1/moim-image-list/upload/{count}")
@Override
public ApiResponseDto<List<PreSignedUrlResponse>> getMoimPreSignedUrl(
@PathVariable int count
Expand All @@ -24,7 +24,7 @@ public ApiResponseDto<List<PreSignedUrlResponse>> getMoimPreSignedUrl(
s3Service.getUploadPreSignedUrlList(S3BucketDirectory.MOIM_PREFIX, count));
}

@GetMapping("/notice-image-list/upload/{count}")
@GetMapping("/v1/notice-image-list/upload/{count}")
@Override
public ApiResponseDto<List<PreSignedUrlResponse>> getNoticePreSignedUrl(
@PathVariable int count
Expand Down

0 comments on commit 9ba38c4

Please sign in to comment.