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); + } + }