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

Commit

Permalink
refactor CreateDocumentFacadeImpl.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Mar 24, 2024
1 parent b3e75ff commit 4e3525e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.daemawiki.domain.document.component.facade;

import org.daemawiki.datetime.model.EditDateTime;
import org.daemawiki.domain.auth.type.GetDocumentType;
import org.daemawiki.domain.common.DefaultProfile;
import org.daemawiki.domain.content.model.Content;
import org.daemawiki.domain.document.dto.request.SaveDocumentRequest;
import org.daemawiki.domain.document.model.DefaultDocument;
import org.daemawiki.domain.document.model.type.DocumentType;
import org.daemawiki.domain.editor.model.DocumentEditor;
import org.daemawiki.domain.editor.model.Editor;
import org.daemawiki.domain.info.model.Info;
Expand All @@ -20,11 +20,9 @@

@Component
public class CreateDocumentFacadeImpl implements CreateDocumentFacade{
private final GetDocumentType getDocumentType;
private final DefaultProfile defaultProfile;

public CreateDocumentFacadeImpl(GetDocumentType getDocumentType, DefaultProfile defaultProfile) {
this.getDocumentType = getDocumentType;
public CreateDocumentFacadeImpl(DefaultProfile defaultProfile) {
this.defaultProfile = defaultProfile;
}

Expand All @@ -34,7 +32,7 @@ public Mono<DefaultDocument> create(SaveDocumentRequest request, User user) {

return Mono.just(DefaultDocument.builder()
.title(request.title())
.type(getDocumentType.execute(request.type().toLowerCase()))
.type(DocumentType.valueOf(request.type().toUpperCase()))
.dateTime(EditDateTime.builder()
.created(LocalDateTime.now())
.updated(LocalDateTime.now())
Expand Down

0 comments on commit 4e3525e

Please sign in to comment.