MCPcopy Create free account
hub / github.com/LeoninCS/DevDesk / AddTODO

Method AddTODO

backend/internal/handler/WorkPlanHandler.go:30–52  ·  view source on GitHub ↗

添加 TODO

(c *gin.Context)

Source from the content-addressed store, hash-verified

28
29// 添加 TODO
30func (h *WorkPlanHandler) AddTODO(c *gin.Context) {
31 var req struct {
32 Hash string `json:"hash"`
33 Content string `json:"content"`
34 }
35 if err := c.ShouldBindJSON(&req); err != nil {
36 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
37 return
38 }
39
40 pp := h.wp.GetPlan(req.Hash)
41 if pp == nil {
42 c.JSON(http.StatusBadRequest, gin.H{"error": "plan not found"})
43 return
44 }
45
46 if err := pp.AddTODO(req.Content); err != nil {
47 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
48 return
49 }
50
51 c.JSON(http.StatusOK, gin.H{"ok": true})
52}
53
54// 删除 TODO
55func (h *WorkPlanHandler) DeleteTODO(c *gin.Context) {

Callers

nothing calls this directly

Calls 1

GetPlanMethod · 0.80

Tested by

no test coverage detected