feat(ECR-011): 昵称、首页贴士与档案 Self 唯一/合盘交叉校验
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s

每账号仅一条 self(migration 40902);合盘只选 TA;账号昵称可改;首页穿衣/颜色/养生贴士。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-12 22:05:00 +08:00
co-authored by Cursor
parent 5ceb3ce749
commit 13860bf1ef
67 changed files with 1936 additions and 275 deletions
+12
View File
@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/yuxingu/digital-psychology/apps/api/internal/middleware"
"github.com/yuxingu/digital-psychology/apps/api/internal/repository"
"github.com/yuxingu/digital-psychology/apps/api/internal/service/home"
"github.com/yuxingu/digital-psychology/apps/api/pkg/response"
@@ -19,6 +20,7 @@ type HomeHandler struct {
func (h *HomeHandler) Register(api *gin.RouterGroup) {
g := api.Group("/home")
g.GET("/tools", h.Tools)
g.GET("/daily-tips", h.DailyTips)
}
func (h *HomeHandler) Tools(c *gin.Context) {
@@ -32,3 +34,13 @@ func (h *HomeHandler) Tools(c *gin.Context) {
}
response.OK(c, gin.H{"items": items})
}
func (h *HomeHandler) DailyTips(c *gin.Context) {
uid, _ := middleware.UserIDFromContext(c)
tips, err := h.Svc.DailyTips(c.Request.Context(), uid)
if err != nil {
response.Fail(c, http.StatusInternalServerError, 50031, "daily tips failed")
return
}
response.OK(c, tips)
}