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

Method SetDone

backend/internal/handler/WorkPlanHandler.go:106–128  ·  view source on GitHub ↗

设置 TODO 完成 / 未完成

(c *gin.Context)

Source from the content-addressed store, hash-verified

104
105// 设置 TODO 完成 / 未完成
106func (h *WorkPlanHandler) SetDone(c *gin.Context) {
107 var req struct {
108 Hash string `json:"hash"`
109 Id int `json:"id"`
110 }
111 if err := c.ShouldBindJSON(&req); err != nil {
112 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
113 return
114 }
115
116 pp := h.wp.GetPlan(req.Hash)
117 if pp == nil {
118 c.JSON(http.StatusBadRequest, gin.H{"error": "plan not found"})
119 return
120 }
121
122 if err := pp.SetTODODone(req.Id); err != nil {
123 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
124 return
125 }
126
127 c.JSON(http.StatusOK, gin.H{"ok": true})
128}
129
130// 获取 TODO 列表
131func (h *WorkPlanHandler) GetTODOs(c *gin.Context) {

Callers

nothing calls this directly

Calls 2

GetPlanMethod · 0.80
SetTODODoneMethod · 0.80

Tested by

no test coverage detected