feat: 迁移商务旗下渠道查询和抽屉

This commit is contained in:
Yvan
2026-11-03 19:20:42 +08:00
parent 8048dfb514
commit cd42a1d3f0
29 changed files with 409 additions and 20 deletions
@@ -0,0 +1,35 @@
package handler
import (
"github.com/gin-gonic/gin"
"github.com/go-kratos/kratos/v3/errors"
"kra/internal/service/business"
"kra/internal/service/dto"
"strconv"
)
type BusinessPromote struct {
service *business.BusinessPromoteService
}
func NewBusinessPromote(service *business.BusinessPromoteService) *BusinessPromote {
return &BusinessPromote{service: service}
}
func (h *BusinessPromote) List(c *gin.Context) {
id, err := strconv.ParseUint(c.Param("userId"), 10, 64)
if err != nil || id == 0 {
Fail(c, "商务用户 ID 不正确")
return
}
var req dto.BusinessPromoteQuery
if err := c.ShouldBindQuery(&req); err != nil {
Fail(c, "查询参数格式错误")
return
}
value, err := h.service.List(c.Request.Context(), uint(id), &req)
if err != nil {
Fail(c, errors.FromError(err).Message)
return
}
OKWithData(c, value)
}