SaveTodos 保存Todo列表
(ctx context.Context, agentID string, todos any)
| 291 | |
| 292 | // SaveTodos 保存Todo列表 |
| 293 | func (js *JSONStore) SaveTodos(ctx context.Context, agentID string, todos any) error { |
| 294 | js.mu.Lock() |
| 295 | defer js.mu.Unlock() |
| 296 | |
| 297 | if err := js.ensureAgentDir(agentID); err != nil { |
| 298 | return err |
| 299 | } |
| 300 | |
| 301 | path := filepath.Join(js.agentDir(agentID), "todos.json") |
| 302 | return js.saveJSON(path, todos) |
| 303 | } |
| 304 | |
| 305 | // LoadTodos 加载Todo列表 |
| 306 | func (js *JSONStore) LoadTodos(ctx context.Context, agentID string) (any, error) { |
nothing calls this directly
no test coverage detected