2026-02-16 16:26:43: merge [main:5ee9d8568258a2e35dfce4aba80a607d007c2f0c];
Create and publish a Docker image / build-and-push-image (push) Canceled after 0s
Create and publish a Docker image / build-and-push-image (push) Canceled after 0s
This commit is contained in:
1 parent
aebc53174b
commit
0ad3e3dead
41 files changed
+1378
-239
No files matched your search
+12
-5
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type SessionService interface {
|
||||
All(ctx context.Context, limit int, offset int) (*domain.SessionResponse, error)
|
||||
All(ctx context.Context, req domain.SessionPageRequest) (*domain.SessionResponse, error)
|
||||
Revoke(ctx context.Context, id int) error
|
||||
}
|
||||
|
||||
@@ -27,13 +27,20 @@ func NewSession(service SessionService) Session {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param X-AUTH-ADMIN header string true "Токен администратора"
|
||||
// @Param body body domain.SessionRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.PageRequest
|
||||
// @Param body body domain.SessionPageRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.SessionResponse
|
||||
// @Failure 400 {object} domain.GrpcError "Невалидное тело запроса"
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /session/all [POST]
|
||||
func (c Session) All(ctx context.Context, req domain.PageRequest) (*domain.SessionResponse, error) {
|
||||
return c.service.All(ctx, req.Limit, req.Offset)
|
||||
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)
|
||||
}
|
||||
|
||||
// Revoke
|
||||
|
||||
Reference in new issue
Block a user