Skip to content

Commit

Permalink
multipartFile 관련 에러 디버깅 (#198)
Browse files Browse the repository at this point in the history
* refactor: (##) multipartfile 관련 에러 디버깅

* refactor: (##) multipartfile 관련 에러 디버깅
  • Loading branch information
tjdtls690 committed Sep 12, 2023
1 parent c4c7b74 commit 1e16933
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public class PostController {
})
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Void> save(
@RequestPart(name = "request") @Valid final PostCreateRequest request,
@RequestPart(name = "contentImages") final List<MultipartFile> contentImages,
@RequestPart(name = "optionImages") final List<MultipartFile> optionImages,
@RequestPart @Valid final PostCreateRequest request,
@RequestPart final List<MultipartFile> contentImages,
@RequestPart final List<MultipartFile> optionImages,
@Auth final Member loginMember
) {
final long postId = postService.save(request, loginMember, contentImages, optionImages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public record PostCreateRequest(
@Length(max = 1000, message = "내용은 최대 1000자까지 입력 가능합니다.")
String content,

String imageUrl,

@Schema(description = "게시글의 여러 선택지")
@Valid
@NotNull(message = "선택지는 최소 2개 이상 등록해야 합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public record PostOptionCreateRequest(
@Schema(description = "선택지 내용", example = "content")
@NotBlank(message = "해당 선택지의 내용을 입력해주세요.")
@Length(max = 50, message = "선택지의 내용은 최대 50자까지 입력 가능합니다.")
String content
String content,

String imageUrl
) {
}
1 change: 0 additions & 1 deletion backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ spring:
path: /h2-console
settings:
web-allow-others: true
web-admin-password:

logging:
level:
Expand Down

0 comments on commit 1e16933

Please sign in to comment.