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

Commit

Permalink
refactor ::
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed May 8, 2024
1 parent 6e002db commit f9a510d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package org.daemawiki.domain.document_editor.model;

import lombok.Builder;

@Builder
public record Editor(String user, String id) {

public static Editor create(String user, String id) {
return Editor.builder()
.user(user)
.id(id)
.build();
public static Editor of(String user, String id) {
return new Editor(user, id);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Mono<DefaultDocument> create(SaveDocumentRequest request, User user) {
DocumentEditor.builder()
.createdUser(userDetail)
.updatedUser(userDetail)
.canEdit(Collections.singletonList(Editor.create(user.getEmail(), user.getId())))
.canEdit(Collections.singletonList(Editor.of(user.getEmail(), user.getId())))
.build(),
Lists.mutable.of(Content.of("1", "개요", ""))
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private DefaultDocument updateDocument(Tuple2<DefaultDocument, User> tuple) {
DefaultDocument document = tuple.getT1();
User user = tuple.getT2();

document.getEditor().addEditor(Editor.create(user.getName(), user.getId()));
document.getEditor().addEditor(Editor.of(user.getName(), user.getId()));

return document;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private RevisionHistory createRevision(SaveRevisionHistoryDto request, User user
.documentId(request.documentId())
.version(request.version())
.title(request.title())
.editor(Editor.create(user.getName(), user.getId()))
.editor(Editor.of(user.getName(), user.getId()))
.createdDateTime(LocalDateTime.now())
.data(request.data())
.build();
Expand Down

0 comments on commit f9a510d

Please sign in to comment.