MSP-7036 fix search & sort
This commit is contained in:
1 parent
71e0768231
commit
ec327424c9
19 files changed
+447
-126
No files matched your search
@@ -38,6 +38,13 @@ func NewAudit(service AuditService) Audit {
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /log/all [POST]
|
||||
func (c Audit) All(ctx context.Context, req domain.AuditPageRequest) (*domain.AuditResponse, error) {
|
||||
if req.Order == nil {
|
||||
req.Order = &domain.OrderParams{
|
||||
Field: domain.DefaultOrderField,
|
||||
Type: domain.DefaultOrderType,
|
||||
}
|
||||
}
|
||||
|
||||
return c.service.All(ctx, req)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ func NewSession(service SessionService) Session {
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /session/all [POST]
|
||||
func (c Session) All(ctx context.Context, req domain.SessionPageRequest) (*domain.SessionResponse, error) {
|
||||
if req.Order == nil {
|
||||
req.Order = &domain.OrderParams{
|
||||
Field: domain.DefaultOrderField,
|
||||
Type: domain.DefaultOrderType,
|
||||
}
|
||||
}
|
||||
|
||||
return c.service.All(ctx, req)
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,13 @@ func (u User) GetProfile(ctx context.Context, authData grpc.AuthData) (*domain.A
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /user/get_users [POST]
|
||||
func (u User) GetUsers(ctx context.Context, req domain.UsersPageRequest) (*domain.UsersResponse, error) {
|
||||
if req.Order == nil {
|
||||
req.Order = &domain.OrderParams{
|
||||
Field: domain.DefaultOrderField,
|
||||
Type: domain.DefaultOrderType,
|
||||
}
|
||||
}
|
||||
|
||||
users, err := u.userService.GetUsers(ctx, req)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "get users")
|
||||
|
||||
Reference in new issue
Block a user