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 Mar 4, 2024
1 parent f1c279d commit e01032e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public Mono<Void> addContentTable(@Valid @RequestBody AddContentRequest request,

@PatchMapping("/remove")
@ResponseStatus(HttpStatus.NO_CONTENT)
public Mono<Void> deleteContent(@RequestBody DeleteContentRequest request, @NotBlank @PathVariable String documentId) {
public Mono<Void> deleteContent(@Valid @RequestBody DeleteContentRequest request, @NotBlank @PathVariable String documentId) {
return deleteContentService.execute(request, documentId);
}

@PatchMapping("/edit")
@ResponseStatus(HttpStatus.NO_CONTENT)
public Mono<Void> editContentTitle(@RequestBody EditContentTableTitleRequest request, @PathVariable String documentId) {
public Mono<Void> editContentTitle(@Valid @RequestBody EditContentTableTitleRequest request, @PathVariable String documentId) {
return editContentTableTitleService.execute(request, documentId);
}

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

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

public record DeleteContentRequest(
@NotBlank(message = "추가할 목차의 인덱스를 입력해주세요.")
String index,
@NotNull(message = "문서의 버전을 입력해주세요.")
Integer version
) {
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package com.example.daemawiki.domain.content.dto;

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

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

0 comments on commit e01032e

Please sign in to comment.