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

Commit

Permalink
api 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 5, 2024
1 parent 31429cd commit 8de6616
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.*;
Expand All @@ -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
Expand All @@ -39,4 +43,9 @@ public Mono<Void> deleteDocument(@PathVariable String documentId) {
return deleteDocumentService.execute(documentId);
}

@PatchMapping
public Mono<Void> updateDocument(@RequestBody UpdateDocumentRequest request) {
return updateDocumentService.execute(request);
}

}

0 comments on commit 8de6616

Please sign in to comment.