实现多商户履约平台基础

This commit is contained in:
yml2213
2026-07-30 12:02:32 +08:00
parent dde6f2c269
commit 83429456a6
41 changed files with 5487 additions and 504 deletions
+7 -5
View File
@@ -3,6 +3,7 @@ package handler
import (
"strconv"
"affiliate_dash/internal/middleware"
"affiliate_dash/internal/pkg/response"
"affiliate_dash/internal/service"
@@ -21,10 +22,11 @@ func (h *UserHandler) List(c *gin.Context) {
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
size, _ := strconv.Atoi(c.DefaultQuery("size", "20"))
q := service.UserListQuery{
Page: page,
Size: size,
Keyword: c.Query("keyword"),
Role: c.Query("role"),
MerchantID: middleware.GetMerchantID(c),
Page: page,
Size: size,
Keyword: c.Query("keyword"),
Role: c.Query("role"),
}
if s := c.Query("status"); s != "" {
v, _ := strconv.Atoi(s)
@@ -52,7 +54,7 @@ func (h *UserHandler) Create(c *gin.Context) {
response.BadRequest(c, "参数错误")
return
}
user, err := h.svc.Create(req.Username, req.Password, req.Nickname, req.Role, req.ParentID)
user, err := h.svc.Create(req.Username, req.Password, req.Nickname, req.Role, req.ParentID, middleware.GetMerchantID(c))
if err != nil {
response.BadRequest(c, err.Error())
return