accounts: add "record count", start searchable user cache
RecordCounter class created from that in activityList, and put in
accountsList. PageCount-type route standardized and made for /users
(/users/count). Created userCache, which regularly generates the
respUser list returned by /users. Added a currently dumb POST /users for
searching/pagination, GET /users is now just for getting -all- users.
go-getted expr, an expression language that seems like it'll be useful
for evaluating local searches. We don't store this data in the badger
DB, so we can't use the nice query form provided by badgerhold.
This commit is contained in:
@@ -164,8 +164,18 @@ type respUser struct {
|
||||
ReferralsEnabled bool `json:"referrals_enabled"`
|
||||
}
|
||||
|
||||
type PaginatedDTO struct {
|
||||
LastPage bool `json:"last_page"`
|
||||
}
|
||||
|
||||
type getUsersReqDTO struct {
|
||||
Limit int `json:"limit"`
|
||||
Page int `json:"page"` // zero-indexed
|
||||
}
|
||||
|
||||
type getUsersDTO struct {
|
||||
UserList []respUser `json:"users"`
|
||||
LastPage bool `json:"last_page"`
|
||||
}
|
||||
|
||||
type ombiUser struct {
|
||||
@@ -437,11 +447,11 @@ type GetActivitiesDTO struct {
|
||||
}
|
||||
|
||||
type GetActivitiesRespDTO struct {
|
||||
PaginatedDTO
|
||||
Activities []ActivityDTO `json:"activities"`
|
||||
LastPage bool `json:"last_page"`
|
||||
}
|
||||
|
||||
type GetActivityCountDTO struct {
|
||||
type PageCountDTO struct {
|
||||
Count uint64 `json:"count"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user