mirror of
				https://github.com/lacerta-doc/Lacerta.git
				synced 2025-09-09 12:09:25 +00:00 
			
		
		
		
	parentIdに切り替え WIP
This commit is contained in:
		
							parent
							
								
									52f41881fd
								
							
						
					
					
						commit
						2a7e329ad7
					
				| 
						 | 
					@ -79,7 +79,7 @@ public class DocumentImpl implements Document {
 | 
				
			||||||
            documentEntity.defaultBranch = meta.getDefaultBranch();
 | 
					            documentEntity.defaultBranch = meta.getDefaultBranch();
 | 
				
			||||||
            documentEntity.updatedAt = meta.getUpdatedAt();
 | 
					            documentEntity.updatedAt = meta.getUpdatedAt();
 | 
				
			||||||
            documentEntity.createdAt = meta.getCreatedAt();
 | 
					            documentEntity.createdAt = meta.getCreatedAt();
 | 
				
			||||||
            documentEntity.publicPath = meta.getPath().getStringPath();
 | 
					            documentEntity.parentId = meta.getParentId();
 | 
				
			||||||
            documentEntity.tagIds = meta.getTagIds();
 | 
					            documentEntity.tagIds = meta.getTagIds();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            database.documentDao().insert(documentEntity);
 | 
					            database.documentDao().insert(documentEntity);
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@ public class DocumentImpl implements Document {
 | 
				
			||||||
        meta.setDefaultBranch("master");
 | 
					        meta.setDefaultBranch("master");
 | 
				
			||||||
        meta.setUpdatedAt(new Date());
 | 
					        meta.setUpdatedAt(new Date());
 | 
				
			||||||
        meta.setCreatedAt(new Date());
 | 
					        meta.setCreatedAt(new Date());
 | 
				
			||||||
        meta.setPath(new PublicPath().getRoot()); // TODO-rca: 2回インスタンスを生成していて無駄なのでなんとかする
 | 
					        meta.setParentId(null);
 | 
				
			||||||
        meta.setTags(new ArrayList<>());
 | 
					        meta.setTags(new ArrayList<>());
 | 
				
			||||||
        return createDocument(meta);
 | 
					        return createDocument(meta);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -138,7 +138,7 @@ public class DocumentImpl implements Document {
 | 
				
			||||||
            meta.setDefaultBranch(documentEntity.defaultBranch);
 | 
					            meta.setDefaultBranch(documentEntity.defaultBranch);
 | 
				
			||||||
            meta.setUpdatedAt(documentEntity.updatedAt);
 | 
					            meta.setUpdatedAt(documentEntity.updatedAt);
 | 
				
			||||||
            meta.setCreatedAt(documentEntity.createdAt);
 | 
					            meta.setCreatedAt(documentEntity.createdAt);
 | 
				
			||||||
            meta.setPath(new PublicPath().resolve(documentEntity.publicPath));
 | 
					            meta.setParentId(documentEntity.parentId);
 | 
				
			||||||
            meta.setTags(new ArrayList<>()); // TODO-rca: タグを取得する
 | 
					            meta.setTags(new ArrayList<>()); // TODO-rca: タグを取得する
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            DocumentDetail detail = new DocumentDetail();
 | 
					            DocumentDetail detail = new DocumentDetail();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,7 +37,7 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    List<DocumentTag> tags;
 | 
					    List<DocumentTag> tags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PublicPath path;
 | 
					    String parentId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    String author;
 | 
					    String author;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
 | 
				
			||||||
        this.tags = new ArrayList<>();
 | 
					        this.tags = new ArrayList<>();
 | 
				
			||||||
        this.author = ""; // TODO-rca: 作者のデフォルト値を設定できるようにする
 | 
					        this.author = ""; // TODO-rca: 作者のデフォルト値を設定できるようにする
 | 
				
			||||||
        this.defaultBranch = "main"; // TODO-rca: デフォルトブランチのデフォルト値を設定できるようにする
 | 
					        this.defaultBranch = "main"; // TODO-rca: デフォルトブランチのデフォルト値を設定できるようにする
 | 
				
			||||||
        this.path = new PublicPath().getRoot();
 | 
					        this.parentId = null;
 | 
				
			||||||
        this.updatedAt = new Date();
 | 
					        this.updatedAt = new Date();
 | 
				
			||||||
        this.createdAt = new Date();
 | 
					        this.createdAt = new Date();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -85,13 +85,13 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
 | 
				
			||||||
        this.defaultBranch = defaultBranch;
 | 
					        this.defaultBranch = defaultBranch;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List<DocumentTag> tags, PublicPath path, String author, String defaultBranch) {
 | 
					    public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List<DocumentTag> tags, String parentId, String author, String defaultBranch) {
 | 
				
			||||||
        this.id = id;
 | 
					        this.id = id;
 | 
				
			||||||
        this.title = title;
 | 
					        this.title = title;
 | 
				
			||||||
        this.updatedAt = updatedAt;
 | 
					        this.updatedAt = updatedAt;
 | 
				
			||||||
        this.createdAt = createdAt;
 | 
					        this.createdAt = createdAt;
 | 
				
			||||||
        this.tags = tags;
 | 
					        this.tags = tags;
 | 
				
			||||||
        this.path = path;
 | 
					        this.parentId = parentId;
 | 
				
			||||||
        this.author = author;
 | 
					        this.author = author;
 | 
				
			||||||
        this.defaultBranch = defaultBranch;
 | 
					        this.defaultBranch = defaultBranch;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -145,10 +145,10 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * PublicPathを取得する
 | 
					     * ドキュメントの親フォルダのID(String)を取得する
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public PublicPath getPath() {
 | 
					    public String getParentId() {
 | 
				
			||||||
        return path;
 | 
					        return parentId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					@ -208,11 +208,11 @@ public class DocumentMeta { // TODO-rca: JavaDoc対応
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * PublicPathを設定する
 | 
					     * ドキュメントの親フォルダのID(String)を設定する
 | 
				
			||||||
     * @param path PublicPath
 | 
					     * @param parentId ドキュメントの親フォルダのID
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public void setPath(PublicPath path) {
 | 
					    public void setParentId(String parentId) {
 | 
				
			||||||
        this.path = path;
 | 
					        this.parentId = parentId;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user