Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
validation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 29, 2024
1 parent 412992d commit 179acec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Mono<Void> writeContent(@Valid @RequestBody WriteContentRequest request)

@PatchMapping("/table")
@ResponseStatus(HttpStatus.NO_CONTENT)
public Mono<Void> addContentTable(@RequestBody AddContentRequest request) {
public Mono<Void> addContentTable(@Valid @RequestBody AddContentRequest request) {
return addContentTableService.execute(request);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package com.example.daemawiki.domain.content.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

public record AddContentRequest(
@NotBlank(message = "문서의 id를 입력해주세요.")
String documentId,
@NotBlank(message = "추가할 목차의 인덱스를 입력해주세요.")
String index,
@NotBlank(message = "추가할 목차의 제목을 입력해주세요.")
String title,
@NotNull(message = "문서의 버전을 입력해주세요.")
Integer version
) {
}

0 comments on commit 179acec

Please sign in to comment.