Remove search engine, add event list api
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -16,16 +16,18 @@ type UserListPayload struct {
|
||||
|
||||
type UserListResult struct {
|
||||
Common shared.CommonResult
|
||||
Data *[]data.UserSearchDoc `json:"user_list"`
|
||||
Data *[]data.UserIndexDoc `json:"user_list"`
|
||||
}
|
||||
|
||||
func (self *UserServiceImpl) ListUsers(payload *UserListPayload) (result *UserListResult) {
|
||||
var limit string
|
||||
var limit string = *payload.Limit
|
||||
if payload.Limit == nil || *payload.Limit == "" {
|
||||
limit = "0"
|
||||
limit = "20"
|
||||
} else {
|
||||
limit = *payload.Limit
|
||||
}
|
||||
|
||||
var offset string
|
||||
var offset string = *payload.Offset
|
||||
if payload.Offset == nil || *payload.Offset == "" {
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
@@ -50,7 +52,7 @@ func (self *UserServiceImpl) ListUsers(payload *UserListPayload) (result *UserLi
|
||||
}
|
||||
|
||||
// Parse string to int64
|
||||
limitNum, err := strconv.ParseInt(limit, 10, 64)
|
||||
limitNum, err := strconv.Atoi(limit)
|
||||
if err != nil {
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
@@ -72,7 +74,7 @@ func (self *UserServiceImpl) ListUsers(payload *UserListPayload) (result *UserLi
|
||||
return
|
||||
}
|
||||
|
||||
offsetNum, err := strconv.ParseInt(offset, 10, 64)
|
||||
offsetNum, err := strconv.Atoi(offset)
|
||||
if err != nil {
|
||||
exception := new(exception.Builder).
|
||||
SetStatus(exception.StatusUser).
|
||||
@@ -103,7 +105,7 @@ func (self *UserServiceImpl) ListUsers(payload *UserListPayload) (result *UserLi
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceList).
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.UserListMeilisearchFailed).
|
||||
SetOriginal(exception.UserListDatabaseFailed).
|
||||
SetError(err).
|
||||
Throw(payload.Context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user