NewProjectMemory 创建新的项目记忆
(projectID, title, description string)
| 132 | |
| 133 | // NewProjectMemory 创建新的项目记忆 |
| 134 | func NewProjectMemory(projectID, title, description string) *ProjectMemory { |
| 135 | now := time.Now() |
| 136 | return &ProjectMemory{ |
| 137 | ProjectID: projectID, |
| 138 | Title: title, |
| 139 | Description: description, |
| 140 | Sections: map[MemorySection]*Section{ |
| 141 | SectionPreferences: {Name: "用户偏好", Protected: true, Entries: []*Entry{}}, |
| 142 | SectionChoices: {Name: "关键选择", Protected: true, Entries: []*Entry{}}, |
| 143 | SectionWorkflow: {Name: "工作流状态", Protected: false, Entries: []*Entry{}}, |
| 144 | SectionParams: {Name: "生成参数", Protected: false, Entries: []*Entry{}}, |
| 145 | SectionHistory: {Name: "项目历史", Protected: false, Entries: []*Entry{}}, |
| 146 | }, |
| 147 | CreatedAt: now, |
| 148 | UpdatedAt: now, |
| 149 | Version: 1, |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | // AddEntry 添加条目到指定章节 |
| 154 | func (pm *ProjectMemory) AddEntry(section MemorySection, entry *Entry) { |
no outgoing calls
no test coverage detected