From 7d460a606910271bf598617d3c9a08512ffc4418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 11 Dec 2023 13:23:01 +0900 Subject: [PATCH] =?UTF-8?q?Meta=E3=81=8B=E3=82=89Description=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=97=E3=81=A6created=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/model/documents/DocumentDetail.java | 2 +- .../data/model/documents/DocumentMeta.java | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java index d37c26f2..75eaef1e 100644 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java +++ b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentDetail.java @@ -4,5 +4,5 @@ public class DocumentDetail { // ドキュメントの詳細情報 private DocumentMeta documentMeta; - // TODO-rca: 実装する + // TODO-rca: ドキュメントの詳細情報を格納するフィールドを追加する } \ No newline at end of file diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java index 4854ec3f..0cdc9fdf 100644 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java +++ b/data/src/main/java/one/nem/lacerta/data/model/documents/DocumentMeta.java @@ -1,19 +1,23 @@ package one.nem.lacerta.data.model.documents; +import java.util.Date; + import one.nem.lacerta.data.model.documents.enums.DocumentType; + +// TODO-rca: Dateをデバイスのロケールに合わせてStringに変換するメソッドを実装する? public class DocumentMeta { // ドキュメントのメタ情報 public String id; // ドキュメントの内部ID(UUIDv4?) public String name; // ドキュメントの名前 - public String description; // ドキュメントの説明 public DocumentType type; // ドキュメントの種類 + public Date created; // ドキュメントの作成日時 public String[] tags; // ドキュメントのタグ public String[] categories; // ドキュメントのカテゴリ - public DocumentMeta(String id, String name, String description, DocumentType type, String[] tags, String[] categories) { + public DocumentMeta(String id, String name, Date created, DocumentType type, String[] tags, String[] categories) { this.id = id; this.name = name; - this.description = description; + this.created = created; this.type = type; this.tags = tags; this.categories = categories; @@ -22,7 +26,7 @@ public class DocumentMeta { public DocumentMeta() { this.id = ""; this.name = ""; - this.description = ""; + this.created = new Date(); this.type = DocumentType.OTHER; this.tags = new String[0]; this.categories = new String[0]; @@ -39,8 +43,8 @@ public class DocumentMeta { return name; } - public String getDescription() { - return description; + public Date getCreated() { + return created; } public DocumentType getType() { @@ -69,11 +73,11 @@ public class DocumentMeta { } } - public void setDescription(String description) { - if (description == null) { - this.description = ""; + public void setCreated(Date created) { + if (created == null) { + this.created = new Date(); } else { - this.description = description; + this.created = created; } }