@@ -1,7 +1,31 @@
|
||||
package user
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
import (
|
||||
"nixcn-cms/internal/exception"
|
||||
"nixcn-cms/service"
|
||||
"nixcn-cms/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (self *UserHandler) List(c *gin.Context) {
|
||||
limit, limitStatus := c.GetQuery("limit")
|
||||
offset, offsetStatus := c.GetQuery("offset")
|
||||
|
||||
userListPayload := &service.UserListPayload{
|
||||
Context: c,
|
||||
Limit: &limit,
|
||||
LimitStatus: &limitStatus,
|
||||
Offset: &offset,
|
||||
OffsetStatus: &offsetStatus,
|
||||
}
|
||||
|
||||
result := self.svc.ListUsers(userListPayload)
|
||||
|
||||
if result.Common.Exception.Original != exception.CommonSuccess {
|
||||
utils.HttpResponse(c, result.Common.HttpCode, result.Common.Exception.String())
|
||||
return
|
||||
}
|
||||
|
||||
utils.HttpResponse(c, result.Common.HttpCode, result.Common.Exception.String(), result.Data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user