AppendEntry 追加条目到指定章节
(ctx context.Context, projectID string, section MemorySection, entry *Entry)
| 85 | |
| 86 | // AppendEntry 追加条目到指定章节 |
| 87 | func (s *FileStore) AppendEntry(ctx context.Context, projectID string, section MemorySection, entry *Entry) error { |
| 88 | memory, err := s.Load(ctx, projectID) |
| 89 | if err != nil { |
| 90 | // 如果不存在且配置了自动创建 |
| 91 | if s.config.AutoCreate { |
| 92 | memory = NewProjectMemory(projectID, "", "") |
| 93 | } else { |
| 94 | return err |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | memory.AddEntry(section, entry) |
| 99 | return s.Save(ctx, memory) |
| 100 | } |
| 101 | |
| 102 | // UpdateWorkflowStep 更新工作流步骤状态 |
| 103 | func (s *FileStore) UpdateWorkflowStep(ctx context.Context, projectID string, step *WorkflowStep) error { |
nothing calls this directly
no test coverage detected