Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.github.timemachinelab.core.qatree;

import lombok.Data;

@Data
public abstract class QA {

protected final QAType type;
Expand All @@ -10,5 +13,14 @@ public abstract class QA {

public QA(QAType type) {
this.type = type;
this.createTime = System.currentTimeMillis();
this.updateTime = this.createTime;
}

/**
* 更新updateTime为当前时间戳
*/
public void updateTimestamp() {
this.updateTime = System.currentTimeMillis();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public QaTree createTree(String userStartQuestion) {
return new QaTree(startNode);
}

public QaTree appendNode(QaTree tree, String parentId, QaTreeNode node) {
tree.addNode(parentId, node);
public QaTree appendNode(QaTree tree, String parentId, QA qa) {
tree.addNode(parentId, new QaTreeNode(qa));
return tree;
}
}
Loading