34 lines
732 B
Go
34 lines
732 B
Go
package system
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"go.uber.org/zap"
|
|
"sundynix-go/global"
|
|
"sundynix-go/model/commom/response"
|
|
systemReq "sundynix-go/model/system/request"
|
|
)
|
|
|
|
type UserApi struct {
|
|
}
|
|
|
|
func (u *UserApi) GetUserList(c *gin.Context) {
|
|
var pageInfo systemReq.GetUserList
|
|
err := c.ShouldBindJSON(&pageInfo)
|
|
if err != nil {
|
|
response.FailWithMsg(err.Error(), c)
|
|
return
|
|
}
|
|
list, total, err := UserService.GetUserList(pageInfo)
|
|
if err != nil {
|
|
global.Logger.Error("获取用户列表失败!", zap.Error(err))
|
|
response.FailWithMsg(err.Error(), c)
|
|
return
|
|
}
|
|
response.OkWithData(response.PageResult{
|
|
List: list,
|
|
Total: total,
|
|
Page: pageInfo.Current,
|
|
PageSize: pageInfo.PageSize,
|
|
}, c)
|
|
}
|