feat: 戒烟成就、梦想图标预设、打卡统计与依赖注入调整

- 成就系统、连续打卡天数计算、管理后台成就 CRUD
- 梦想目标图标预设 DreamPreset 与用户端 dream-presets 接口
- 管理后台梦想图标 CRUD;戒烟打卡 summary 修正
- 忽略根目录编译产物 /api

Made-with: Cursor
This commit is contained in:
nepiedg
2026-04-04 14:55:50 +08:00
parent 1c0aeb152a
commit fd097729d7
20 changed files with 849 additions and 12 deletions
+10
View File
@@ -330,6 +330,16 @@ func (h *Handler) ListRelapses(c *gin.Context) {
c.JSON(http.StatusOK, model.Success(result))
}
// ListDreamPresets 获取管理员预设的梦想目标列表。
func (h *Handler) ListDreamPresets(c *gin.Context) {
presets, err := h.service.ListDreamPresets(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, model.Error(http.StatusInternalServerError, "获取预设目标失败"))
return
}
c.JSON(http.StatusOK, model.Success(gin.H{"items": presets}))
}
// ListRewardGoals 获取梦想目标列表。
// @Summary 获取梦想目标列表
// @Description 按状态筛选梦想目标,用于梦想实验室页面展示。