This commit is contained in:
2026-08-15 01:28:51 +08:00
parent 6698e59c3a
commit 2f165d3a45
26 changed files with 242 additions and 216 deletions
+8 -3
View File
@@ -12,9 +12,14 @@ import (
"github.com/gin-gonic/gin"
)
type User struct{ service *service.SystemService }
type User struct {
service *service.UserService
auth *service.AuthService
}
func NewUser(service *service.SystemService) *User { return &User{service: service} }
func NewUser(user *service.UserService, auth *service.AuthService) *User {
return &User{service: user, auth: auth}
}
func (h *User) List(c *gin.Context) {
var req dto.UserListRequest
@@ -155,7 +160,7 @@ func (h *User) SwitchAuthority(c *gin.Context) {
httpx.Fail(c, "参数错误")
return
}
login, err := h.service.SwitchAuthority(c.Request.Context(), claims.ID, req.AuthorityID)
login, err := h.auth.SwitchAuthority(c.Request.Context(), claims.ID, req.AuthorityID)
if err != nil {
httpx.Fail(c, err.Error())
return