feat: 新增平台客服角色与客服查询菜单

This commit is contained in:
2026-11-09 18:18:19 +08:00
parent 38cbb37a08
commit 08884270b7
23 changed files with 1075 additions and 106 deletions
+4 -1
View File
@@ -44,6 +44,7 @@ type createPlatformAdminReq struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required,min=6"`
Nickname string `json:"nickname"`
Role string `json:"role"`
}
func (h *UserHandler) CreatePlatformAdmin(c *gin.Context) {
@@ -52,7 +53,7 @@ func (h *UserHandler) CreatePlatformAdmin(c *gin.Context) {
response.BadRequest(c, "参数错误")
return
}
user, err := h.svc.CreatePlatformAdmin(req.Username, req.Password, req.Nickname)
user, err := h.svc.CreatePlatformUser(req.Username, req.Password, req.Nickname, req.Role)
if err != nil {
response.BadRequest(c, err.Error())
return
@@ -65,6 +66,7 @@ type updatePlatformAdminReq struct {
Nickname string `json:"nickname"`
Password string `json:"password" binding:"omitempty,min=6"`
Status int `json:"status"`
Role string `json:"role"`
}
func (h *UserHandler) UpdatePlatformAdmin(c *gin.Context) {
@@ -79,6 +81,7 @@ func (h *UserHandler) UpdatePlatformAdmin(c *gin.Context) {
Nickname: req.Nickname,
Password: req.Password,
Status: req.Status,
Role: req.Role,
}, middleware.GetUserID(c))
if err != nil {
response.BadRequest(c, err.Error())