From 8de6616e69a5baad704f7202f96eed43a828124b Mon Sep 17 00:00:00 2001 From: seungwon_H Date: Mon, 5 Feb 2024 20:30:55 +0900 Subject: [PATCH] =?UTF-8?q?api=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/document/api/DocumentController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/daemawiki/domain/document/api/DocumentController.java b/src/main/java/com/example/daemawiki/domain/document/api/DocumentController.java index f5169261..aa01f2b3 100644 --- a/src/main/java/com/example/daemawiki/domain/document/api/DocumentController.java +++ b/src/main/java/com/example/daemawiki/domain/document/api/DocumentController.java @@ -1,10 +1,12 @@ package com.example.daemawiki.domain.document.api; import com.example.daemawiki.domain.document.dto.request.CreateDocumentRequest; +import com.example.daemawiki.domain.document.dto.request.UpdateDocumentRequest; import com.example.daemawiki.domain.document.dto.response.GetDocumentResponse; import com.example.daemawiki.domain.document.service.CreateDocument; import com.example.daemawiki.domain.document.service.DeleteDocument; import com.example.daemawiki.domain.document.service.GetDocument; +import com.example.daemawiki.domain.document.service.UpdateDocument; import jakarta.validation.Valid; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -16,11 +18,13 @@ public class DocumentController { private final CreateDocument createDocumentService; private final GetDocument getDocumentService; private final DeleteDocument deleteDocumentService; + private final UpdateDocument updateDocumentService; - public DocumentController(CreateDocument createDocument, GetDocument getDocument, DeleteDocument deleteDocument) { + public DocumentController(CreateDocument createDocument, GetDocument getDocument, DeleteDocument deleteDocument, UpdateDocument updateDocument) { this.createDocumentService = createDocument; this.getDocumentService = getDocument; this.deleteDocumentService = deleteDocument; + this.updateDocumentService = updateDocument; } @PostMapping @@ -39,4 +43,9 @@ public Mono deleteDocument(@PathVariable String documentId) { return deleteDocumentService.execute(documentId); } + @PatchMapping + public Mono updateDocument(@RequestBody UpdateDocumentRequest request) { + return updateDocumentService.execute(request); + } + }