Optomize user list service query bind struct
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -279,11 +279,9 @@ func (self *UserServiceImpl) UpdateUserInfo(payload *UserInfoPayload) (result *U
|
||||
}
|
||||
|
||||
type UserListPayload struct {
|
||||
Context context.Context
|
||||
Limit *string
|
||||
LimitStatus *bool
|
||||
Offset *string
|
||||
OffsetStatus *bool
|
||||
Context context.Context
|
||||
Limit *string
|
||||
Offset *string
|
||||
}
|
||||
|
||||
type UserListResult struct {
|
||||
@@ -294,12 +292,12 @@ type UserListResult struct {
|
||||
// ListUsers
|
||||
func (self *UserServiceImpl) ListUsers(payload *UserListPayload) (result *UserListResult) {
|
||||
var limit string
|
||||
if !*payload.LimitStatus || *payload.Limit == "" {
|
||||
if payload.Limit == nil || *payload.Limit == "" {
|
||||
limit = "0"
|
||||
}
|
||||
|
||||
var offset string
|
||||
if !*payload.OffsetStatus || *payload.Offset == "" {
|
||||
if payload.Offset == nil || *payload.Offset == "" {
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
|
||||
Reference in New Issue
Block a user