diff --git a/src/main/java/com/example/daemawiki/domain/document/component/facade/CreateDocumentFacade.java b/src/main/java/com/example/daemawiki/domain/document/component/facade/CreateDocumentFacade.java index e543e358..c93c04f9 100644 --- a/src/main/java/com/example/daemawiki/domain/document/component/facade/CreateDocumentFacade.java +++ b/src/main/java/com/example/daemawiki/domain/document/component/facade/CreateDocumentFacade.java @@ -10,7 +10,6 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; -import java.util.Objects; @Component public class CreateDocumentFacade { @@ -39,10 +38,7 @@ public DefaultDocument execute(SaveDocumentRequest request, User user) { .updatedUser(userDetail) .build()) .content(request.content()) - .groups(request.groups().stream() - .filter(Objects::nonNull) - .map(group -> String.join("/", group)) - .toList()) + .groups(request.groups()) .build(); } diff --git a/src/main/java/com/example/daemawiki/domain/document/component/service/UpdateDocument.java b/src/main/java/com/example/daemawiki/domain/document/component/service/UpdateDocument.java index 5e6fcac1..d28f998c 100644 --- a/src/main/java/com/example/daemawiki/domain/document/component/service/UpdateDocument.java +++ b/src/main/java/com/example/daemawiki/domain/document/component/service/UpdateDocument.java @@ -14,7 +14,6 @@ import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; -import java.util.List; import java.util.Objects; @Service @@ -36,11 +35,6 @@ public UpdateDocument(DocumentFacade documentFacade, UserFacade userFacade, Docu public Mono execute(SaveDocumentRequest request, String documentId) { return userFacade.currentUser() .zipWith(documentFacade.findDocumentById(documentId), (user, document) -> { - List groups = request.groups().stream() - .filter(Objects::nonNull) - .map(group -> String.join("/", group)) - .toList(); - document.getEditor().update(UserDetailResponse.builder() .id(user.getId()) .name(user.getName()) @@ -50,7 +44,7 @@ public Mono execute(SaveDocumentRequest request, String documentId) { document.update(request.title(), getDocumentType.execute(request.type()), request.content(), - groups); + request.groups()); return document; }) diff --git a/src/main/java/com/example/daemawiki/domain/document/model/DefaultDocument.java b/src/main/java/com/example/daemawiki/domain/document/model/DefaultDocument.java index b27db9d7..fccfc046 100644 --- a/src/main/java/com/example/daemawiki/domain/document/model/DefaultDocument.java +++ b/src/main/java/com/example/daemawiki/domain/document/model/DefaultDocument.java @@ -25,7 +25,7 @@ public class DefaultDocument { private EditDateTime dateTime; - private List groups; + private List> groups; private DocumentEditor editor; @@ -35,7 +35,7 @@ public class DefaultDocument { private Integer version; @Builder - public DefaultDocument(String title, DocumentType type, EditDateTime dateTime, List groups, DocumentEditor documentEditor, String content) { + public DefaultDocument(String title, DocumentType type, EditDateTime dateTime, List> groups, DocumentEditor documentEditor, String content) { this.title = title; this.type = type; this.dateTime = dateTime; @@ -44,7 +44,7 @@ public DefaultDocument(String title, DocumentType type, EditDateTime dateTime, L this.content = content; } - public void update(String title, DocumentType type, String content, List groups) { + public void update(String title, DocumentType type, String content, List> groups) { this.title = title; this.type = type; this.content = content;