From b63e2dd86294d1650abf0473784bc90dae85c027 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 14 Jan 2024 16:05:23 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/model/document/DocumentMeta.java | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java index f41fc33e..6970b17f 100644 --- a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java +++ b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java @@ -44,41 +44,24 @@ public class DocumentMeta { String defaultBranch; // Constructor + public DocumentMeta() { } - public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List tags) { // With all - this.id = id; + public DocumentMeta(String title, List tags, String author, String defaultBranch) { + this.id = UUID.randomUUID().toString(); this.title = title; - this.updatedAt = updatedAt; - this.createdAt = createdAt; this.tags = tags; + this.author = author; + this.defaultBranch = defaultBranch; } - public DocumentMeta(String id, String title, Date updatedAt, Date createdAt) { // Without tags + public DocumentMeta(String id, String title, List tags, String author, String defaultBranch) { this.id = id; this.title = title; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.tags = new ArrayList<>(); - } - - public DocumentMeta(String id, String title) { // Without tags, updatedAt, createdAt - this.id = id; - this.title = title; - // 現在時刻を設定 - this.updatedAt = new Date(); - this.createdAt = new Date(); - this.tags = new ArrayList<>(); - } - - public DocumentMeta(String title) { // title only - this.id = UUID.randomUUID().toString(); // 新規作成時想定なのでコンストラクタで生成してしまう(使う人が楽なので) - this.title = title; - // 現在時刻を設定 - this.updatedAt = new Date(); - this.createdAt = new Date(); - this.tags = new ArrayList<>(); + this.tags = tags; + this.author = author; + this.defaultBranch = defaultBranch; } // Getter