Resolve MSP-7343
This commit is contained in:
1 parent
5ee9d85682
commit
5ee5854831
28 files changed
+419
-198
No files matched your search
+7
-1
@@ -18,6 +18,8 @@ linters:
|
|||||||
- varnamelen # очень индивидуально (db)
|
- varnamelen # очень индивидуально (db)
|
||||||
- wsl # расставление пробелов очень индивидуально
|
- wsl # расставление пробелов очень индивидуально
|
||||||
- wsl_v5 # расставление пробелов очень индивидуально
|
- wsl_v5 # расставление пробелов очень индивидуально
|
||||||
|
- godoclint # ругается на // nolint, не удобно
|
||||||
|
- prealloc # слишком аггресивный, в большинстве случаев не требуется
|
||||||
settings:
|
settings:
|
||||||
cyclop:
|
cyclop:
|
||||||
max-complexity: 15 # по умолчанию 10 мало
|
max-complexity: 15 # по умолчанию 10 мало
|
||||||
@@ -54,6 +56,10 @@ linters:
|
|||||||
- linters:
|
- linters:
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
path: transaction # транзакции прозрачны
|
path: transaction # транзакции прозрачны
|
||||||
|
- linters:
|
||||||
|
- unqueryvet
|
||||||
|
- prealloc
|
||||||
|
path: ".*_test\\.go$"
|
||||||
paths:
|
paths:
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
@@ -66,4 +72,4 @@ formatters:
|
|||||||
paths:
|
paths:
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
- examples$
|
- examples$
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
### v6.8.0
|
||||||
|
* Изменен контракт методов. В запросах теперь массив идентификаторов пользователей и массив статусов сессий
|
||||||
|
* Обновлена версия go
|
||||||
### v6.7.0
|
### v6.7.0
|
||||||
* Обновлены методы `admin/log/all`, `admin/session/all` и `admin/user/get_users`: добавлена сортировка и поиск
|
* Обновлены методы `admin/log/all`, `admin/session/all` и `admin/user/get_users`: добавлена сортировка и поиск
|
||||||
* Добавлен воркер выставления статуса 'EXPIRED' для токенов сессий
|
* Добавлен воркер выставления статуса 'EXPIRED' для токенов сессий
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.25-alpine as builder
|
FROM golang:1.26-alpine as builder
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
ARG version
|
ARG version
|
||||||
ENV version_env=$version
|
ENV version_env=$version
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ import (
|
|||||||
func init() { //
|
func init() { //
|
||||||
schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Schema) {
|
schema.CustomGenerators.Register("logLevel", func(field reflect.StructField, t *jsonschema.Schema) {
|
||||||
t.Type = "string"
|
t.Type = "string"
|
||||||
t.Enum = []interface{}{"debug", "info", "error", "fatal"}
|
t.Enum = []any{"debug", "info", "error", "fatal"}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import (
|
|||||||
type userService interface {
|
type userService interface {
|
||||||
GetProfileById(ctx context.Context, userId int64) (*domain.AdminUserShort, error)
|
GetProfileById(ctx context.Context, userId int64) (*domain.AdminUserShort, error)
|
||||||
GetUsers(ctx context.Context, req domain.UsersPageRequest) (*domain.UsersResponse, error)
|
GetUsers(ctx context.Context, req domain.UsersPageRequest) (*domain.UsersResponse, error)
|
||||||
|
GetAllUsers(ctx context.Context) (*domain.UsersResponse, error)
|
||||||
CreateUser(ctx context.Context, req domain.CreateUserRequest, adminId int64) (*domain.User, error)
|
CreateUser(ctx context.Context, req domain.CreateUserRequest, adminId int64) (*domain.User, error)
|
||||||
UpdateUser(ctx context.Context, req domain.UpdateUserRequest, adminId int64) (*domain.User, error)
|
UpdateUser(ctx context.Context, req domain.UpdateUserRequest, adminId int64) (*domain.User, error)
|
||||||
DeleteUsers(ctx context.Context, ids []int64, adminId int64) (int, error)
|
DeleteUsers(ctx context.Context, ids []int64, adminId int64) (int, error)
|
||||||
@@ -93,6 +94,26 @@ func (u User) GetUsers(ctx context.Context, req domain.UsersPageRequest) (*domai
|
|||||||
return users, nil
|
return users, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetAllUsers
|
||||||
|
// @Tags user
|
||||||
|
// @Summary Список пользователей
|
||||||
|
// @Description Получить список пользователей
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-AUTH-ADMIN header string true "Токен администратора"
|
||||||
|
// @Success 200 {object} domain.UsersResponse
|
||||||
|
// @Failure 400 {object} domain.GrpcError
|
||||||
|
// @Failure 500 {object} domain.GrpcError
|
||||||
|
// @Router /user/get_all_users [POST]
|
||||||
|
func (u User) GetAllUsers(ctx context.Context) (*domain.UsersResponse, error) {
|
||||||
|
users, err := u.userService.GetAllUsers(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WithMessage(err, "get all users")
|
||||||
|
}
|
||||||
|
|
||||||
|
return users, nil
|
||||||
|
}
|
||||||
|
|
||||||
// CreateUser
|
// CreateUser
|
||||||
// @Tags user
|
// @Tags user
|
||||||
// @Summary Создать пользователя
|
// @Summary Создать пользователя
|
||||||
|
|||||||
+41
-9
@@ -71,7 +71,6 @@ definitions:
|
|||||||
limit:
|
limit:
|
||||||
type: integer
|
type: integer
|
||||||
offset:
|
offset:
|
||||||
format: int64
|
|
||||||
type: integer
|
type: integer
|
||||||
order:
|
order:
|
||||||
$ref: '#/definitions/domain.OrderParams'
|
$ref: '#/definitions/domain.OrderParams'
|
||||||
@@ -89,7 +88,9 @@ definitions:
|
|||||||
message:
|
message:
|
||||||
type: string
|
type: string
|
||||||
userId:
|
userId:
|
||||||
type: integer
|
items:
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
type: object
|
type: object
|
||||||
domain.AuditResponse:
|
domain.AuditResponse:
|
||||||
properties:
|
properties:
|
||||||
@@ -277,7 +278,6 @@ definitions:
|
|||||||
domain.SecureAuthResponse:
|
domain.SecureAuthResponse:
|
||||||
properties:
|
properties:
|
||||||
adminId:
|
adminId:
|
||||||
format: int64
|
|
||||||
type: integer
|
type: integer
|
||||||
authenticated:
|
authenticated:
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -314,7 +314,6 @@ definitions:
|
|||||||
limit:
|
limit:
|
||||||
type: integer
|
type: integer
|
||||||
offset:
|
offset:
|
||||||
format: int64
|
|
||||||
type: integer
|
type: integer
|
||||||
order:
|
order:
|
||||||
$ref: '#/definitions/domain.OrderParams'
|
$ref: '#/definitions/domain.OrderParams'
|
||||||
@@ -332,9 +331,13 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
type: integer
|
type: integer
|
||||||
status:
|
status:
|
||||||
type: string
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
userId:
|
userId:
|
||||||
type: integer
|
items:
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
type: object
|
type: object
|
||||||
domain.SessionResponse:
|
domain.SessionResponse:
|
||||||
properties:
|
properties:
|
||||||
@@ -403,7 +406,6 @@ definitions:
|
|||||||
fullName:
|
fullName:
|
||||||
type: string
|
type: string
|
||||||
id:
|
id:
|
||||||
format: int64
|
|
||||||
type: integer
|
type: integer
|
||||||
lastName:
|
lastName:
|
||||||
type: string
|
type: string
|
||||||
@@ -431,14 +433,15 @@ definitions:
|
|||||||
type: integer
|
type: integer
|
||||||
type: array
|
type: array
|
||||||
userId:
|
userId:
|
||||||
type: integer
|
items:
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
type: object
|
type: object
|
||||||
domain.UsersPageRequest:
|
domain.UsersPageRequest:
|
||||||
properties:
|
properties:
|
||||||
limit:
|
limit:
|
||||||
type: integer
|
type: integer
|
||||||
offset:
|
offset:
|
||||||
format: int64
|
|
||||||
type: integer
|
type: integer
|
||||||
order:
|
order:
|
||||||
$ref: '#/definitions/domain.OrderParams'
|
$ref: '#/definitions/domain.OrderParams'
|
||||||
@@ -1093,6 +1096,35 @@ paths:
|
|||||||
summary: Удалить пользователя
|
summary: Удалить пользователя
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
|
/user/get_all_users:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Получить список пользователей
|
||||||
|
parameters:
|
||||||
|
- description: Токен администратора
|
||||||
|
in: header
|
||||||
|
name: X-AUTH-ADMIN
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/domain.UsersResponse'
|
||||||
|
"400":
|
||||||
|
description: Bad Request
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/domain.GrpcError'
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/domain.GrpcError'
|
||||||
|
summary: Список пользователей
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
/user/get_by_id:
|
/user/get_by_id:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ type AuditPageRequest struct {
|
|||||||
|
|
||||||
type AuditQuery struct {
|
type AuditQuery struct {
|
||||||
Id *int
|
Id *int
|
||||||
UserId *int
|
UserId []int
|
||||||
Message *string
|
Message *string
|
||||||
CreatedAt *DateFromToParams
|
CreatedAt *DateFromToParams
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package domain
|
package domain
|
||||||
|
|
||||||
type GrpcError struct {
|
type GrpcError struct {
|
||||||
ErrorMessage string `json:"errorMessage"`
|
ErrorMessage string `json:"errorMessage"`
|
||||||
ErrorCode string `json:"errorCode"`
|
ErrorCode string `json:"errorCode"`
|
||||||
Details []interface{} `json:"details"`
|
Details []any `json:"details"`
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,4 +1,3 @@
|
|||||||
// nolint:tagliatelle
|
|
||||||
package domain
|
package domain
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -19,6 +18,7 @@ type LoginSudirRequest struct {
|
|||||||
AuthCode string `validate:"required"`
|
AuthCode string `validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint:tagliatelle,godoclint
|
||||||
type LoginResponse struct {
|
type LoginResponse struct {
|
||||||
Token string
|
Token string
|
||||||
Expired string `json:",omitempty"`
|
Expired string `json:",omitempty"`
|
||||||
|
|||||||
+2
-2
@@ -21,8 +21,8 @@ type SessionPageRequest struct {
|
|||||||
|
|
||||||
type SessionQuery struct {
|
type SessionQuery struct {
|
||||||
Id *int
|
Id *int
|
||||||
UserId *int
|
UserId []int
|
||||||
Status *string
|
Status []string
|
||||||
CreatedAt *DateFromToParams
|
CreatedAt *DateFromToParams
|
||||||
ExpiredAt *DateFromToParams
|
ExpiredAt *DateFromToParams
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ type UsersResponse struct {
|
|||||||
|
|
||||||
type UserQuery struct {
|
type UserQuery struct {
|
||||||
Id *int
|
Id *int
|
||||||
UserId *int
|
UserId []int
|
||||||
Description *string
|
Description *string
|
||||||
Email *string
|
Email *string
|
||||||
Roles []int
|
Roles []int
|
||||||
|
|||||||
+3
-1
@@ -1,10 +1,10 @@
|
|||||||
// nolint:tagliatelle,errname
|
|
||||||
package entity
|
package entity
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint:tagliatelle,godoclint
|
||||||
type SudirAuthError struct {
|
type SudirAuthError struct {
|
||||||
ErrorName string `json:"error"`
|
ErrorName string `json:"error"`
|
||||||
ErrorDescription string `json:"error_description"`
|
ErrorDescription string `json:"error_description"`
|
||||||
@@ -14,6 +14,7 @@ func (s *SudirAuthError) Error() string {
|
|||||||
return fmt.Sprintf("error: %s; description: %s", s.ErrorName, s.ErrorDescription)
|
return fmt.Sprintf("error: %s; description: %s", s.ErrorName, s.ErrorDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint:tagliatelle,errname,godoclint
|
||||||
type SudirUserResponse struct {
|
type SudirUserResponse struct {
|
||||||
*SudirAuthError
|
*SudirAuthError
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ type SudirUserResponse struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint:tagliatelle,errname,godoclint
|
||||||
type SudirTokenResponse struct {
|
type SudirTokenResponse struct {
|
||||||
*SudirAuthError
|
*SudirAuthError
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module msp-admin-service
|
module msp-admin-service
|
||||||
|
|
||||||
go 1.25
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/squirrel v1.5.4
|
github.com/Masterminds/squirrel v1.5.4
|
||||||
@@ -9,11 +9,11 @@ require (
|
|||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/txix-open/bgjob v1.6.0
|
github.com/txix-open/bgjob v1.6.0
|
||||||
github.com/txix-open/isp-kit v1.64.10
|
github.com/txix-open/isp-kit v1.65.1
|
||||||
github.com/txix-open/jsonschema v1.3.0
|
github.com/txix-open/jsonschema v1.3.0
|
||||||
golang.org/x/crypto v0.45.0
|
golang.org/x/crypto v0.49.0
|
||||||
golang.org/x/sync v0.18.0
|
golang.org/x/sync v0.20.0
|
||||||
google.golang.org/grpc v1.75.1
|
google.golang.org/grpc v1.79.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -24,34 +24,34 @@ require (
|
|||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/coder/websocket v1.8.14 // indirect
|
github.com/coder/websocket v1.8.14 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
||||||
github.com/getsentry/sentry-go v0.35.2 // indirect
|
github.com/getsentry/sentry-go v0.43.0 // indirect
|
||||||
github.com/go-logr/logr v1.4.3 // indirect
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
|
||||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
github.com/jackc/pgx/v5 v5.7.6 // indirect
|
github.com/jackc/pgx/v5 v5.8.0 // indirect
|
||||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||||
github.com/jmoiron/sqlx v1.4.0 // indirect
|
github.com/jmoiron/sqlx v1.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||||
github.com/leodido/go-urn v1.4.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/mailru/easyjson v0.9.0 // indirect
|
github.com/mailru/easyjson v0.9.2 // indirect
|
||||||
github.com/mfridman/interpolate v0.0.2 // indirect
|
github.com/mfridman/interpolate v0.0.2 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/pressly/goose/v3 v3.25.0 // indirect
|
github.com/pressly/goose/v3 v3.27.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.23.2 // indirect
|
github.com/prometheus/client_golang v1.23.2 // indirect
|
||||||
github.com/prometheus/client_model v0.6.2 // indirect
|
github.com/prometheus/client_model v0.6.2 // indirect
|
||||||
github.com/prometheus/common v0.66.1 // indirect
|
github.com/prometheus/common v0.67.5 // indirect
|
||||||
github.com/prometheus/procfs v0.17.0 // indirect
|
github.com/prometheus/procfs v0.20.1 // indirect
|
||||||
github.com/robfig/cron/v3 v3.0.1 // indirect
|
github.com/robfig/cron/v3 v3.0.1 // indirect
|
||||||
github.com/sethvargo/go-retry v0.3.0 // indirect
|
github.com/sethvargo/go-retry v0.3.0 // indirect
|
||||||
github.com/txix-open/bellows v1.2.0 // indirect
|
github.com/txix-open/bellows v1.2.0 // indirect
|
||||||
@@ -61,24 +61,24 @@ require (
|
|||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||||
go.opentelemetry.io/auto/sdk v1.2.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 // indirect
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0 // indirect
|
||||||
go.opentelemetry.io/otel v1.38.0 // indirect
|
go.opentelemetry.io/otel v1.42.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.38.0 // indirect
|
go.opentelemetry.io/otel/metric v1.42.0 // indirect
|
||||||
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
|
go.opentelemetry.io/otel/sdk v1.42.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.38.0 // indirect
|
go.opentelemetry.io/otel/trace v1.42.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.8.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
go.uber.org/zap v1.27.0 // indirect
|
go.uber.org/zap v1.27.1 // indirect
|
||||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||||
golang.org/x/net v0.47.0 // indirect
|
golang.org/x/net v0.52.0 // indirect
|
||||||
golang.org/x/sys v0.38.0 // indirect
|
golang.org/x/sys v0.42.0 // indirect
|
||||||
golang.org/x/text v0.31.0 // indirect
|
golang.org/x/text v0.35.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20260316180232-0b37fe3546d5 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 // indirect
|
||||||
google.golang.org/protobuf v1.36.9 // indirect
|
google.golang.org/protobuf v1.36.11 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
|
||||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||||
|
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
|
||||||
|
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
|
||||||
github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM=
|
github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM=
|
||||||
github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10=
|
github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||||
@@ -10,8 +11,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
|||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
@@ -25,10 +24,10 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
|
|||||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/getsentry/sentry-go v0.35.2 h1:jKuujpRwa8FFRYMIwwZpu83Xh0voll9bmvyc6310WBM=
|
github.com/getsentry/sentry-go v0.43.0 h1:XbXLpFicpo8HmBDaInk7dum18G9KSLcjZiyUKS+hLW4=
|
||||||
github.com/getsentry/sentry-go v0.35.2/go.mod h1:mdL49ixwT2yi57k5eh7mpnDyPybixPzlzEJFu0Z76QA=
|
github.com/getsentry/sentry-go v0.43.0/go.mod h1:XDotiNZbgf5U8bPDUAfvcFmOnMQQceESxyKaObSssW0=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
@@ -42,8 +41,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
|||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
|
github.com/go-resty/resty/v2 v2.17.2 h1:FQW5oHYcIlkCNrMD2lloGScxcHJ0gkjshV3qcQAyHQk=
|
||||||
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
|
github.com/go-resty/resty/v2 v2.17.2/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA=
|
||||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||||
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
|
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
|
||||||
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||||
@@ -54,16 +53,16 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
|
|||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c=
|
||||||
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
|
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
|
||||||
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
|
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
|
||||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||||
github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk=
|
github.com/jackc/pgx/v5 v5.8.0 h1:TYPDoleBBme0xGSAX3/+NujXXtpZn9HBONkQC7IEZSo=
|
||||||
github.com/jackc/pgx/v5 v5.7.6/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
|
github.com/jackc/pgx/v5 v5.8.0/go.mod h1:QVeDInX2m9VyzvNeiCJVjCkNFqzsNb43204HshNSZKw=
|
||||||
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
|
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
|
||||||
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||||
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
||||||
@@ -72,8 +71,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
|
|||||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||||
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
|
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
|
||||||
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
|
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -88,8 +87,8 @@ github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
|||||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
|
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
|
||||||
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||||
@@ -105,24 +104,24 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
|
|||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
|
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||||
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||||
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
|
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
|
||||||
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/pressly/goose/v3 v3.25.0 h1:6WeYhMWGRCzpyd89SpODFnCBCKz41KrVbRT58nVjGng=
|
github.com/pressly/goose/v3 v3.27.0 h1:/D30gVTuQhu0WsNZYbJi4DMOsx1lNq+6SkLe+Wp59BM=
|
||||||
github.com/pressly/goose/v3 v3.25.0/go.mod h1:4hC1KrritdCxtuFsqgs1R4AU5bWtTAf+cnWvfhf2DNY=
|
github.com/pressly/goose/v3 v3.27.0/go.mod h1:3ZBeCXqzkgIRvrEMDkYh1guvtoJTU5oMMuDdkutoM78=
|
||||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
||||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||||
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
|
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
|
||||||
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
|
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
|
||||||
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
|
github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc=
|
||||||
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
|
github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo=
|
||||||
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
|
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
|
||||||
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||||
@@ -152,10 +151,10 @@ github.com/txix-open/bgjob v1.6.0 h1:Vwj9cAsIhMrHPKRZVxfg6mHqE9LI/atDCq1aeihH3+I
|
|||||||
github.com/txix-open/bgjob v1.6.0/go.mod h1:aKbwpVclWmq82s7fchazp099yWjEpVKFkxT85i4hARM=
|
github.com/txix-open/bgjob v1.6.0/go.mod h1:aKbwpVclWmq82s7fchazp099yWjEpVKFkxT85i4hARM=
|
||||||
github.com/txix-open/etp/v4 v4.0.1 h1:5VSYgGsvnMz0tvUHsjVWFETI0qWBTCF1O3ARCHaCIgA=
|
github.com/txix-open/etp/v4 v4.0.1 h1:5VSYgGsvnMz0tvUHsjVWFETI0qWBTCF1O3ARCHaCIgA=
|
||||||
github.com/txix-open/etp/v4 v4.0.1/go.mod h1:FIu7TUDdwcgmtmF6tFTV1bGA2fRY/iVaPQdsGzvqYc8=
|
github.com/txix-open/etp/v4 v4.0.1/go.mod h1:FIu7TUDdwcgmtmF6tFTV1bGA2fRY/iVaPQdsGzvqYc8=
|
||||||
github.com/txix-open/grmq v1.9.0 h1:ArDbJJcFX9zXKEcPf49rp9nYiRyGMJxGKJAxdbSsfaM=
|
github.com/txix-open/grmq v1.10.0 h1:1bXuF+7TxtUvoh+Wn6SOCYpVACFbWDuDmz/+tKwW9Ms=
|
||||||
github.com/txix-open/grmq v1.9.0/go.mod h1:EyFOP17KrwEFOUjR+PH8iH3LCtiN9TSQ8t0ysyk62po=
|
github.com/txix-open/grmq v1.10.0/go.mod h1:EyFOP17KrwEFOUjR+PH8iH3LCtiN9TSQ8t0ysyk62po=
|
||||||
github.com/txix-open/isp-kit v1.64.10 h1:lAowLtShBbICZbOWQJ4ptr9LaKKRZ7CE5DBK+7LcLqM=
|
github.com/txix-open/isp-kit v1.65.1 h1:KehXIJdPZMnewDd5XQxk87yNAtNhvJXApaLFvbUau5U=
|
||||||
github.com/txix-open/isp-kit v1.64.10/go.mod h1:GvBsX5p2U3/ugK6PuWANYzSy/4YgawROm3eAKb35G6o=
|
github.com/txix-open/isp-kit v1.65.1/go.mod h1:F4B/+ErbNVaWzIIGasXM5DtcDKtjl6u2OESO02RyzCI=
|
||||||
github.com/txix-open/jsonschema v1.3.0 h1:XGuOTg22G7PdqfKypjajM20/i5FyGfFYsJKmheebKi4=
|
github.com/txix-open/jsonschema v1.3.0 h1:XGuOTg22G7PdqfKypjajM20/i5FyGfFYsJKmheebKi4=
|
||||||
github.com/txix-open/jsonschema v1.3.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
|
github.com/txix-open/jsonschema v1.3.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
|
||||||
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
|
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
|
||||||
@@ -169,58 +168,58 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
|
|||||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.0 h1:YpRtUFjvhSymycLS2T81lT6IGhcUP+LUPtv0iv1N8bM=
|
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.0/go.mod h1:1deq2zL7rwjwC8mR7XgY2N+tlIl6pjmEUoLDENMEzwk=
|
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 h1:2pn7OzMewmYRiNtv1doZnLo3gONcnMHlFnmOR8Vgt+8=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0 h1:c9r/G1CSw4dPI1jaNNG9RnQP+q4SvZnHciDQJVIvchU=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0/go.mod h1:rjbQTDEPQymPE0YnRQp9/NuPwwtL0sesz/fnqRW/v84=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0/go.mod h1:gO9smoZe9KnZcJCqcB0lMmQ4Z5VEifYmjMTpnwtTSuQ=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg=
|
||||||
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
|
go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=
|
||||||
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
|
go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 h1:GqRJVj7UmLjCVyVJ3ZFLdPRmhDUp2zFmQe3RHIOsw24=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 h1:THuZiwpQZuHPul65w4WcwEnkX2QIuMT+UFoOrygtoJw=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0/go.mod h1:ri3aaHSmCTVYu2AWv44YMauwAQc0aqI9gHKIcSbI1pU=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0/go.mod h1:J2pvYM5NGHofZ2/Ru6zw/TNWnEQp5crgyDeSrYpXkAw=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 h1:aTL7F04bJHUlztTsNGJ2l+6he8c+y/b//eR0jjjemT4=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0 h1:uLXP+3mghfMf7XmV4PkGfFhFKuNWoCvvx5wP/wOXo0o=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0/go.mod h1:kldtb7jDTeol0l3ewcmd8SDvx3EmIE7lyvqbasU3QC4=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0/go.mod h1:v0Tj04armyT59mnURNUJf7RCKcKzq+lgJs6QSjHjaTc=
|
||||||
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
|
go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=
|
||||||
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
|
go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=
|
||||||
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
|
go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=
|
||||||
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
|
go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
|
go.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA=
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
|
go.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc=
|
||||||
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
|
go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=
|
||||||
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
|
go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=
|
||||||
go.opentelemetry.io/proto/otlp v1.8.0 h1:fRAZQDcAFHySxpJ1TwlA1cJ4tvcrw7nXl9xWWC8N5CE=
|
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
|
||||||
go.opentelemetry.io/proto/otlp v1.8.0/go.mod h1:tIeYOeNBU4cvmPqpaji1P+KbB4Oloai8wN4rWzRrFF0=
|
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
|
||||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||||
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
|
||||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
|
||||||
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
|
||||||
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
|
||||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
|
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0=
|
||||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
|
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA=
|
||||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
|
||||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
|
||||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
|
||||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
||||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
|
||||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
|
||||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090 h1:d8Nakh1G+ur7+P3GcMjpRDEkoLUcLW2iU92XVqR+XMQ=
|
google.golang.org/genproto/googleapis/api v0.0.0-20260316180232-0b37fe3546d5 h1:CogIeEXn4qWYzzQU0QqvYBM8yDF9cFYzDq9ojSpv0Js=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250908214217-97024824d090/go.mod h1:U8EXRNSd8sUYyDfs/It7KVWodQr+Hf9xtxyxWudSwEw=
|
google.golang.org/genproto/googleapis/api v0.0.0-20260316180232-0b37fe3546d5/go.mod h1:EIQZ5bFCfRQDV4MhRle7+OgjNtZ6P1PiZBgAKuxXu/Y=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 h1:/OQuEa4YWtDt7uQWHd3q3sUMb+QOLQUg1xa8CEsRv5w=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 h1:aJmi6DVGGIStN9Mobk/tZOOQUBbj0BPjZjjnOdoZKts=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090/go.mod h1:GmFNa4BdJZ2a8G+wCe9Bg3wwThLrJun751XstdJt5Og=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
|
||||||
google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI=
|
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
|
||||||
google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
|
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
|
||||||
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
|
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||||
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
@@ -229,11 +228,11 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs
|
|||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
modernc.org/libc v1.66.3 h1:cfCbjTUcdsKyyZZfEUKfoHcP3S0Wkvz3jgSzByEWVCQ=
|
modernc.org/libc v1.68.0 h1:PJ5ikFOV5pwpW+VqCK1hKJuEWsonkIJhhIXyuF/91pQ=
|
||||||
modernc.org/libc v1.66.3/go.mod h1:XD9zO8kt59cANKvHPXpx7yS2ELPheAey0vjIuZOhOU8=
|
modernc.org/libc v1.68.0/go.mod h1:NnKCYeoYgsEqnY3PgvNgAeaJnso968ygU8Z0DxjoEc0=
|
||||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||||
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||||
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||||
modernc.org/sqlite v1.38.2 h1:Aclu7+tgjgcQVShZqim41Bbw9Cho0y/7WzYptXqkEek=
|
modernc.org/sqlite v1.46.1 h1:eFJ2ShBLIEnUWlLy12raN0Z1plqmFX9Qe3rjQTKt6sU=
|
||||||
modernc.org/sqlite v1.38.2/go.mod h1:cPTJYSlgg3Sfg046yBShXENNtPrWrDX8bsbAQBzgQ5E=
|
modernc.org/sqlite v1.46.1/go.mod h1:CzbrU2lSB1DKUusvwGz7rqEKIq+NUd8GWuBBZDs9/nA=
|
||||||
+16
-2
@@ -15,6 +15,14 @@ import (
|
|||||||
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
idAuditColumn = "id"
|
||||||
|
userIdAuditColumn = "user_id"
|
||||||
|
messageAuditColumn = "message"
|
||||||
|
createdAtAuditColumn = "created_at"
|
||||||
|
eventAuditColumn = "event"
|
||||||
|
)
|
||||||
|
|
||||||
type Audit struct {
|
type Audit struct {
|
||||||
db db.DB
|
db db.DB
|
||||||
}
|
}
|
||||||
@@ -51,7 +59,13 @@ func (r Audit) AllByRequest(ctx context.Context, req domain.AuditPageRequest) ([
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Audit.All")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Audit.All")
|
||||||
|
|
||||||
q := query.New().
|
q := query.New().
|
||||||
Select("*").
|
Select(
|
||||||
|
idAuditColumn,
|
||||||
|
userIdAuditColumn,
|
||||||
|
messageAuditColumn,
|
||||||
|
createdAtAuditColumn,
|
||||||
|
eventAuditColumn,
|
||||||
|
).
|
||||||
From("audit").
|
From("audit").
|
||||||
OrderBy(strcase.ToSnake(req.Order.Field) + " " + req.Order.Type).
|
OrderBy(strcase.ToSnake(req.Order.Field) + " " + req.Order.Type).
|
||||||
Offset(req.Offset).
|
Offset(req.Offset).
|
||||||
@@ -120,7 +134,7 @@ func reqAuditQuery(q squirrel.SelectBuilder, reqQuery *domain.AuditQuery) squirr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.UserId != nil {
|
if reqQuery.UserId != nil {
|
||||||
q = q.Where("user_id = ?", *reqQuery.UserId)
|
q = q.Where(squirrel.Eq{"user_id": reqQuery.UserId})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.Message != nil {
|
if reqQuery.Message != nil {
|
||||||
|
|||||||
@@ -4,12 +4,18 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
|
"msp-admin-service/entity"
|
||||||
|
|
||||||
"github.com/Masterminds/squirrel"
|
"github.com/Masterminds/squirrel"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/txix-open/isp-kit/db"
|
"github.com/txix-open/isp-kit/db"
|
||||||
"github.com/txix-open/isp-kit/db/query"
|
"github.com/txix-open/isp-kit/db/query"
|
||||||
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
||||||
"msp-admin-service/entity"
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
eventAuditEventColumn = "event"
|
||||||
|
enableAuditEventColumn = "enable"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuditEvent struct {
|
type AuditEvent struct {
|
||||||
@@ -26,7 +32,7 @@ func (r AuditEvent) All(ctx context.Context) ([]entity.AuditEvent, error) {
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Audit_Event.All")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Audit_Event.All")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(eventAuditEventColumn, enableAuditEventColumn).
|
||||||
From("audit_event").
|
From("audit_event").
|
||||||
OrderBy("enable DESC").
|
OrderBy("enable DESC").
|
||||||
ToSql()
|
ToSql()
|
||||||
|
|||||||
+31
-2
@@ -17,6 +17,17 @@ type Role struct {
|
|||||||
db db.DB
|
db db.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
idRolesColumn = "id"
|
||||||
|
nameRolesColumn = "name"
|
||||||
|
createdAtRolesColumn = "created_at"
|
||||||
|
updatedAtRolesColumn = "updated_at"
|
||||||
|
permissionsRolesColumn = "permissions"
|
||||||
|
externalGroupRolesColumn = "external_group"
|
||||||
|
immutableRolesColumn = "immutable"
|
||||||
|
exclusiveRolesColumn = "exclusive"
|
||||||
|
)
|
||||||
|
|
||||||
func NewRole(db db.DB) Role {
|
func NewRole(db db.DB) Role {
|
||||||
return Role{db: db}
|
return Role{db: db}
|
||||||
}
|
}
|
||||||
@@ -48,7 +59,16 @@ func (r Role) GetRoleByName(ctx context.Context, name string) (*entity.Role, err
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Role.GetRoleByName")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Role.GetRoleByName")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(
|
||||||
|
idRolesColumn,
|
||||||
|
nameRolesColumn,
|
||||||
|
createdAtRolesColumn,
|
||||||
|
updatedAtRolesColumn,
|
||||||
|
permissionsRolesColumn,
|
||||||
|
externalGroupRolesColumn,
|
||||||
|
immutableRolesColumn,
|
||||||
|
exclusiveRolesColumn,
|
||||||
|
).
|
||||||
From("roles").
|
From("roles").
|
||||||
Where(squirrel.Eq{"name": name}).
|
Where(squirrel.Eq{"name": name}).
|
||||||
ToSql()
|
ToSql()
|
||||||
@@ -73,7 +93,16 @@ func (r Role) GetRolesByExternalGroup(ctx context.Context, groups []string) ([]e
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Role.GetRolesByExternalGroup")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Role.GetRolesByExternalGroup")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(
|
||||||
|
idRolesColumn,
|
||||||
|
nameRolesColumn,
|
||||||
|
createdAtRolesColumn,
|
||||||
|
updatedAtRolesColumn,
|
||||||
|
permissionsRolesColumn,
|
||||||
|
externalGroupRolesColumn,
|
||||||
|
immutableRolesColumn,
|
||||||
|
exclusiveRolesColumn,
|
||||||
|
).
|
||||||
From("roles").
|
From("roles").
|
||||||
Where(squirrel.Eq{"external_group": groups}).
|
Where(squirrel.Eq{"external_group": groups}).
|
||||||
ToSql()
|
ToSql()
|
||||||
|
|||||||
+18
-7
@@ -18,6 +18,16 @@ import (
|
|||||||
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
idTokensColumn = "id"
|
||||||
|
tokenColumn = "token"
|
||||||
|
userIdTokensColumn = "user_id"
|
||||||
|
statusTokensColumn = "status"
|
||||||
|
expiredAtTokensColumn = "expired_at"
|
||||||
|
createdAtTokensColumn = "created_at"
|
||||||
|
updatedAtTokensColumn = "updated_at"
|
||||||
|
)
|
||||||
|
|
||||||
type Token struct {
|
type Token struct {
|
||||||
db db.DB
|
db db.DB
|
||||||
}
|
}
|
||||||
@@ -83,7 +93,8 @@ func (r Token) RevokeByUserId(ctx context.Context, userId int64, updatedAt time.
|
|||||||
func (r Token) All(ctx context.Context) ([]entity.Token, error) {
|
func (r Token) All(ctx context.Context) ([]entity.Token, error) {
|
||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Token.All")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Token.All")
|
||||||
|
|
||||||
query, args, err := query.New().Select("*").From("tokens").ToSql()
|
query, args, err := query.New().Select(idTokensColumn, tokenColumn, userIdTokensColumn, statusTokensColumn,
|
||||||
|
expiredAtTokensColumn, createdAtTokensColumn, updatedAtTokensColumn).From("tokens").ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.WithMessage(err, "build query")
|
return nil, errors.WithMessage(err, "build query")
|
||||||
}
|
}
|
||||||
@@ -101,7 +112,8 @@ func (r Token) AllByRequest(ctx context.Context, req domain.SessionPageRequest)
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "Token.AllByRequest")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "Token.AllByRequest")
|
||||||
|
|
||||||
q := query.New().
|
q := query.New().
|
||||||
Select("*").
|
Select(idTokensColumn, tokenColumn, userIdTokensColumn, statusTokensColumn, expiredAtTokensColumn, createdAtTokensColumn,
|
||||||
|
updatedAtTokensColumn).
|
||||||
From("tokens").
|
From("tokens").
|
||||||
OrderBy(strcase.ToSnake(req.Order.Field) + " " + req.Order.Type).
|
OrderBy(strcase.ToSnake(req.Order.Field) + " " + req.Order.Type).
|
||||||
Offset(req.Offset).
|
Offset(req.Offset).
|
||||||
@@ -210,8 +222,7 @@ func (r Token) LastAccessByUserIds(ctx context.Context, userIds []int) (map[int6
|
|||||||
|
|
||||||
result := make(map[int64]*time.Time)
|
result := make(map[int64]*time.Time)
|
||||||
for _, token := range tokens {
|
for _, token := range tokens {
|
||||||
createdAt := token.CreatedAt
|
result[token.UserId] = new(token.CreatedAt)
|
||||||
result[token.UserId] = &createdAt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
@@ -223,15 +234,15 @@ func reqTokenQuery(q squirrel.SelectBuilder, reqQuery *domain.SessionQuery) squi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.Id != nil {
|
if reqQuery.Id != nil {
|
||||||
q = q.Where(squirrel.ILike{"id::text": strconv.Itoa(*reqQuery.Id) + "%"})
|
q = q.Where(squirrel.ILike{"id::text": "%" + strconv.Itoa(*reqQuery.Id) + "%"})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.UserId != nil {
|
if reqQuery.UserId != nil {
|
||||||
q = q.Where("user_id = ?", *reqQuery.UserId)
|
q = q.Where(squirrel.Eq{"user_id": reqQuery.UserId})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.Status != nil {
|
if reqQuery.Status != nil {
|
||||||
q = q.Where("status = ?", *reqQuery.Status)
|
q = q.Where(squirrel.Eq{"status": reqQuery.Status})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.CreatedAt != nil {
|
if reqQuery.CreatedAt != nil {
|
||||||
|
|||||||
+62
-16
@@ -17,6 +17,21 @@ import (
|
|||||||
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
"github.com/txix-open/isp-kit/metrics/sql_metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
idUsersColumn = "id"
|
||||||
|
firstNameUsersColumn = "first_name"
|
||||||
|
lastNameUsersColumn = "last_name"
|
||||||
|
emailUsersColumn = "email"
|
||||||
|
passwordUsersColumn = "password"
|
||||||
|
createdAtUsersColumn = "created_at"
|
||||||
|
updatedAtUsersColumn = "updated_at"
|
||||||
|
sudirUserIdUsersColumn = "sudir_user_id"
|
||||||
|
blockedUsersColumn = "blocked"
|
||||||
|
descriptionUsersColumn = "description"
|
||||||
|
lastActiveAtUsersColumn = "last_active_at"
|
||||||
|
fullNameUsersColumn = "full_name"
|
||||||
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
db db.DB
|
db db.DB
|
||||||
}
|
}
|
||||||
@@ -29,7 +44,9 @@ func (u User) GetUserByEmail(ctx context.Context, email string) (*entity.User, e
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserByEmail")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserByEmail")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn).
|
||||||
From("users").
|
From("users").
|
||||||
Where(squirrel.Eq{"email": email}).
|
Where(squirrel.Eq{"email": email}).
|
||||||
ToSql()
|
ToSql()
|
||||||
@@ -54,7 +71,9 @@ func (u User) GetUserById(ctx context.Context, identity int64) (*entity.User, er
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserById")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserById")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn).
|
||||||
From("users").
|
From("users").
|
||||||
Where(squirrel.Eq{"id": identity}).
|
Where(squirrel.Eq{"id": identity}).
|
||||||
ToSql()
|
ToSql()
|
||||||
@@ -84,7 +103,9 @@ func (u User) GetUserByEmailAndSudirId(ctx context.Context, email string, sudirU
|
|||||||
}
|
}
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn).
|
||||||
From("users").
|
From("users").
|
||||||
Where(equalClause).
|
Where(equalClause).
|
||||||
ToSql()
|
ToSql()
|
||||||
@@ -140,7 +161,9 @@ func (u User) GetUsers(ctx context.Context, req domain.UsersPageRequest) ([]enti
|
|||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUsers")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUsers")
|
||||||
|
|
||||||
q := query.New().
|
q := query.New().
|
||||||
Select("*", "(SELECT max(created_at) FROM tokens WHERE tokens.user_id = users.id) as last_session_created_at").
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn, "(SELECT max(created_at) FROM tokens WHERE tokens.user_id = users.id) as last_session_created_at").
|
||||||
From("users").
|
From("users").
|
||||||
Offset(req.Offset).
|
Offset(req.Offset).
|
||||||
Limit(req.Limit)
|
Limit(req.Limit)
|
||||||
@@ -165,11 +188,34 @@ func (u User) GetUsers(ctx context.Context, req domain.UsersPageRequest) ([]enti
|
|||||||
return users, nil
|
return users, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u User) GetAllUsers(ctx context.Context) ([]entity.User, error) {
|
||||||
|
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUsers")
|
||||||
|
|
||||||
|
query, args, err := query.New().
|
||||||
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn, "(SELECT max(created_at) FROM tokens WHERE tokens.user_id = users.id) as last_session_created_at").
|
||||||
|
From("users").ToSql()
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WithMessage(err, "build query")
|
||||||
|
}
|
||||||
|
|
||||||
|
users := make([]entity.User, 0)
|
||||||
|
err = u.db.Select(ctx, &users, query, args...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WithMessage(err, "db select")
|
||||||
|
}
|
||||||
|
|
||||||
|
return users, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (u User) GetUsersByEmail(ctx context.Context, email string) ([]entity.User, error) {
|
func (u User) GetUsersByEmail(ctx context.Context, email string) ([]entity.User, error) {
|
||||||
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserByEmail")
|
ctx = sql_metrics.OperationLabelToContext(ctx, "User.GetUserByEmail")
|
||||||
|
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Select("*").
|
Select(idUsersColumn, firstNameUsersColumn, lastNameUsersColumn, emailUsersColumn, passwordUsersColumn, createdAtUsersColumn,
|
||||||
|
updatedAtUsersColumn, sudirUserIdUsersColumn, blockedUsersColumn, descriptionUsersColumn, lastActiveAtUsersColumn,
|
||||||
|
fullNameUsersColumn).
|
||||||
From("users").
|
From("users").
|
||||||
Where(squirrel.Eq{"email": email}).
|
Where(squirrel.Eq{"email": email}).
|
||||||
ToSql()
|
ToSql()
|
||||||
@@ -195,8 +241,8 @@ func (u User) Insert(ctx context.Context, user entity.User) (int, error) {
|
|||||||
|
|
||||||
insertQ, args, err := query.New().
|
insertQ, args, err := query.New().
|
||||||
Insert("users").
|
Insert("users").
|
||||||
Columns("first_name", "last_name", "full_name", "description",
|
Columns(firstNameUsersColumn, lastNameUsersColumn, fullNameUsersColumn, descriptionUsersColumn,
|
||||||
"email", "password", "created_at", "updated_at").
|
emailUsersColumn, passwordUsersColumn, createdAtUsersColumn, updatedAtUsersColumn).
|
||||||
Values(user.FirstName, user.LastName, user.FullName, user.Description,
|
Values(user.FirstName, user.LastName, user.FullName, user.Description,
|
||||||
user.Email, user.Password, user.CreatedAt, user.UpdatedAt).
|
user.Email, user.Password, user.CreatedAt, user.UpdatedAt).
|
||||||
Suffix("returning id").
|
Suffix("returning id").
|
||||||
@@ -220,12 +266,12 @@ func (u User) UpdateUser(ctx context.Context, id int64, user entity.UpdateUser)
|
|||||||
// return every except password
|
// return every except password
|
||||||
q, args, err := query.New().
|
q, args, err := query.New().
|
||||||
Update("users").
|
Update("users").
|
||||||
SetMap(map[string]interface{}{
|
SetMap(map[string]any{
|
||||||
"first_name": user.FirstName,
|
firstNameUsersColumn: user.FirstName,
|
||||||
"last_name": user.LastName,
|
lastNameUsersColumn: user.LastName,
|
||||||
"full_name": user.FullName,
|
fullNameUsersColumn: user.FullName,
|
||||||
"email": user.Email,
|
emailUsersColumn: user.Email,
|
||||||
"description": user.Description,
|
descriptionUsersColumn: user.Description,
|
||||||
}).
|
}).
|
||||||
Where(squirrel.Eq{"id": id}).
|
Where(squirrel.Eq{"id": id}).
|
||||||
Suffix("RETURNING id, first_name, last_name, full_name, email, sudir_user_id, description, created_at, updated_at").
|
Suffix("RETURNING id, first_name, last_name, full_name, email, sudir_user_id, description, created_at, updated_at").
|
||||||
@@ -354,11 +400,11 @@ func reqUsersQuery(q squirrel.SelectBuilder, reqQuery *domain.UserQuery) squirre
|
|||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.Id != nil {
|
if reqQuery.Id != nil {
|
||||||
q = q.Where(squirrel.ILike{"id::text": strconv.Itoa(*reqQuery.Id) + "%"})
|
q = q.Where(squirrel.ILike{"id::text": "%" + strconv.Itoa(*reqQuery.Id) + "%"})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.UserId != nil { // поиск в ui по фио, но в бд - по id юзера
|
if reqQuery.UserId != nil || len(reqQuery.UserId) != 0 { // поиск в ui по фио, но в бд - по id юзера
|
||||||
q = q.Where("id = ?", *reqQuery.UserId)
|
q = q.Where(squirrel.Eq{"id": reqQuery.UserId})
|
||||||
}
|
}
|
||||||
|
|
||||||
if reqQuery.Description != nil {
|
if reqQuery.Description != nil {
|
||||||
|
|||||||
+7
-1
@@ -1,11 +1,12 @@
|
|||||||
package routes
|
package routes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"msp-admin-service/controller"
|
||||||
|
|
||||||
"github.com/txix-open/isp-kit/cluster"
|
"github.com/txix-open/isp-kit/cluster"
|
||||||
"github.com/txix-open/isp-kit/grpc"
|
"github.com/txix-open/isp-kit/grpc"
|
||||||
"github.com/txix-open/isp-kit/grpc/endpoint"
|
"github.com/txix-open/isp-kit/grpc/endpoint"
|
||||||
"github.com/txix-open/isp-kit/grpc/isp"
|
"github.com/txix-open/isp-kit/grpc/isp"
|
||||||
"msp-admin-service/controller"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Controllers struct {
|
type Controllers struct {
|
||||||
@@ -69,6 +70,11 @@ func endpointDescriptors(c Controllers) []cluster.EndpointDescriptor {
|
|||||||
Inner: true,
|
Inner: true,
|
||||||
Handler: c.User.GetUsers,
|
Handler: c.User.GetUsers,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Path: "admin/user/get_all_users",
|
||||||
|
Inner: true,
|
||||||
|
Handler: c.User.GetAllUsers,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Path: "admin/user/create_user",
|
Path: "admin/user/create_user",
|
||||||
Inner: true,
|
Inner: true,
|
||||||
|
|||||||
+1
-1
@@ -87,7 +87,7 @@ func (s Audit) SaveAuditAsync(ctx context.Context, userId int64, message string,
|
|||||||
Event: event,
|
Event: event,
|
||||||
CreatedAt: time.Now().UTC(),
|
CreatedAt: time.Now().UTC(),
|
||||||
}
|
}
|
||||||
_, err = s.auditRep.Insert(context.Background(), audit)
|
_, err = s.auditRep.Insert(ctx, audit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.logger.Error(ctx, "insert audit", log.Any("error", err))
|
s.logger.Error(ctx, "insert audit", log.Any("error", err))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (s *Permission) All(_ context.Context) []domain.Permission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func toDomain(permissions []conf.Permission) []domain.Permission {
|
func toDomain(permissions []conf.Permission) []domain.Permission {
|
||||||
permList := make([]domain.Permission, 0)
|
permList := make([]domain.Permission, 0, len(permissions))
|
||||||
for _, perm := range permissions {
|
for _, perm := range permissions {
|
||||||
permList = append(permList, domain.Permission{
|
permList = append(permList, domain.Permission{
|
||||||
Key: perm.Key,
|
Key: perm.Key,
|
||||||
|
|||||||
+2
-4
@@ -81,8 +81,7 @@ func (u Role) Create(ctx context.Context, req domain.CreateRoleRequest, adminId
|
|||||||
entity.EventRoleChanged,
|
entity.EventRoleChanged,
|
||||||
)
|
)
|
||||||
|
|
||||||
result := u.toDomain(*role)
|
return new(u.toDomain(*role)), nil
|
||||||
return &result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u Role) Update(ctx context.Context, req domain.UpdateRoleRequest, adminId int64) (*domain.Role, error) {
|
func (u Role) Update(ctx context.Context, req domain.UpdateRoleRequest, adminId int64) (*domain.Role, error) {
|
||||||
@@ -131,8 +130,7 @@ func (u Role) Update(ctx context.Context, req domain.UpdateRoleRequest, adminId
|
|||||||
fmt.Sprintf("Роль. Изменение роли %s. Причина: %s. \n %s", req.Name, req.ChangeMessage, diff),
|
fmt.Sprintf("Роль. Изменение роли %s. Причина: %s. \n %s", req.Name, req.ChangeMessage, diff),
|
||||||
entity.EventRoleChanged,
|
entity.EventRoleChanged,
|
||||||
)
|
)
|
||||||
result := u.toDomain(*role)
|
return new(u.toDomain(*role)), nil
|
||||||
return &result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u Role) Delete(ctx context.Context, req domain.DeleteRoleRequest, adminId int64) error {
|
func (u Role) Delete(ctx context.Context, req domain.DeleteRoleRequest, adminId int64) error {
|
||||||
|
|||||||
+38
-7
@@ -26,9 +26,11 @@ type UserTransactionRunner interface {
|
|||||||
UserTransaction(ctx context.Context, tx func(ctx context.Context, tx UserTransaction) error) error
|
UserTransaction(ctx context.Context, tx func(ctx context.Context, tx UserTransaction) error) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint:interfacebloat
|
||||||
type UserRepo interface {
|
type UserRepo interface {
|
||||||
GetUserById(ctx context.Context, identity int64) (*entity.User, error)
|
GetUserById(ctx context.Context, identity int64) (*entity.User, error)
|
||||||
GetUsers(ctx context.Context, req domain.UsersPageRequest) ([]entity.User, error)
|
GetUsers(ctx context.Context, req domain.UsersPageRequest) ([]entity.User, error)
|
||||||
|
GetAllUsers(ctx context.Context) ([]entity.User, error)
|
||||||
GetUserByEmailAndSudirId(ctx context.Context, email string, sudirUserId string) (*entity.User, error)
|
GetUserByEmailAndSudirId(ctx context.Context, email string, sudirUserId string) (*entity.User, error)
|
||||||
GetUsersByEmail(ctx context.Context, email string) ([]entity.User, error)
|
GetUsersByEmail(ctx context.Context, email string) ([]entity.User, error)
|
||||||
UpdateUser(ctx context.Context, id int64, user entity.UpdateUser) (*entity.User, error)
|
UpdateUser(ctx context.Context, id int64, user entity.UpdateUser) (*entity.User, error)
|
||||||
@@ -169,6 +171,38 @@ func (u User) GetUsers(ctx context.Context, req domain.UsersPageRequest) (*domai
|
|||||||
return &domain.UsersResponse{Items: items}, nil
|
return &domain.UsersResponse{Items: items}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u User) GetAllUsers(ctx context.Context) (*domain.UsersResponse, error) {
|
||||||
|
users, err := u.userRepo.GetAllUsers(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WithMessage(err, "get all users from repo")
|
||||||
|
}
|
||||||
|
|
||||||
|
userIds := make([]int, 0)
|
||||||
|
for _, user := range users {
|
||||||
|
userIds = append(userIds, int(user.Id))
|
||||||
|
}
|
||||||
|
|
||||||
|
userRoles, err := u.userRoleRepo.GetRolesByUserIds(ctx, userIds)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WithMessage(err, "get roles by user ids and roles id")
|
||||||
|
}
|
||||||
|
|
||||||
|
items := make([]domain.User, 0, len(users))
|
||||||
|
for _, user := range users {
|
||||||
|
roles := make([]int, 0)
|
||||||
|
|
||||||
|
for _, role := range userRoles {
|
||||||
|
if role.UserId == int(user.Id) {
|
||||||
|
roles = append(roles, role.RoleId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items = append(items, u.toDomain(user, roles, user.LastSessionCreatedAt))
|
||||||
|
}
|
||||||
|
|
||||||
|
return &domain.UsersResponse{Items: items}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (u User) CreateUser(ctx context.Context, req domain.CreateUserRequest, adminId int64) (*domain.User, error) {
|
func (u User) CreateUser(ctx context.Context, req domain.CreateUserRequest, adminId int64) (*domain.User, error) {
|
||||||
var usr entity.User
|
var usr entity.User
|
||||||
|
|
||||||
@@ -234,8 +268,7 @@ func (u User) CreateUser(ctx context.Context, req domain.CreateUserRequest, admi
|
|||||||
entity.EventUserChanged,
|
entity.EventUserChanged,
|
||||||
)
|
)
|
||||||
|
|
||||||
result := u.toDomain(usr, req.Roles, nil)
|
return new(u.toDomain(usr, req.Roles, nil)), nil
|
||||||
return &result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint:cyclop,funlen
|
//nolint:cyclop,funlen
|
||||||
@@ -324,8 +357,7 @@ func (u User) UpdateUser(ctx context.Context, req domain.UpdateUserRequest, admi
|
|||||||
entity.EventUserChanged,
|
entity.EventUserChanged,
|
||||||
)
|
)
|
||||||
|
|
||||||
result := u.toDomain(*updatedUser, req.Roles, lastSessionCreatedAt)
|
return new(u.toDomain(*updatedUser, req.Roles, lastSessionCreatedAt)), nil
|
||||||
return &result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u User) DeleteUsers(ctx context.Context, ids []int64, adminId int64) (int, error) {
|
func (u User) DeleteUsers(ctx context.Context, ids []int64, adminId int64) (int, error) {
|
||||||
@@ -362,8 +394,7 @@ func (u User) GetById(ctx context.Context, userId int) (*domain.User, error) {
|
|||||||
return nil, errors.WithMessage(err, "get last sessions by user id")
|
return nil, errors.WithMessage(err, "get last sessions by user id")
|
||||||
}
|
}
|
||||||
|
|
||||||
result := u.toDomain(*user, RolesIds(roles), lastSessions[int64(userId)])
|
return new(u.toDomain(*user, RolesIds(roles), lastSessions[int64(userId)])), nil
|
||||||
return &result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u User) Block(ctx context.Context, adminId int64, userId int) error {
|
func (u User) Block(ctx context.Context, adminId int64, userId int) error {
|
||||||
@@ -406,7 +437,7 @@ func (u User) Block(ctx context.Context, adminId int64, userId int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RolesIds(roles []entity.UserRole) []int {
|
func RolesIds(roles []entity.UserRole) []int {
|
||||||
roleList := make([]int, 0)
|
roleList := make([]int, 0, len(roles))
|
||||||
|
|
||||||
for _, role := range roles {
|
for _, role := range roles {
|
||||||
roleList = append(roleList, role.RoleId)
|
roleList = append(roleList, role.RoleId)
|
||||||
|
|||||||
+3
-8
@@ -208,9 +208,8 @@ func (t *AuditSuite) Test_All_Logs() {
|
|||||||
t.Require().EqualValues(4, response.Items[1].UserId)
|
t.Require().EqualValues(4, response.Items[1].UserId)
|
||||||
t.Require().EqualValues(3, response.Items[2].UserId)
|
t.Require().EqualValues(3, response.Items[2].UserId)
|
||||||
|
|
||||||
msg := "Выход"
|
|
||||||
request.Query = &domain.AuditQuery{
|
request.Query = &domain.AuditQuery{
|
||||||
Message: &msg,
|
Message: new("Выход"),
|
||||||
}
|
}
|
||||||
request.Limit = 10
|
request.Limit = 10
|
||||||
request.Offset = 0
|
request.Offset = 0
|
||||||
@@ -222,14 +221,10 @@ func (t *AuditSuite) Test_All_Logs() {
|
|||||||
Do(context.Background())
|
Do(context.Background())
|
||||||
t.Require().NoError(err)
|
t.Require().NoError(err)
|
||||||
|
|
||||||
t.Require().Len(response.Items, 6)
|
t.Require().Len(response.Items, 2)
|
||||||
t.Require().EqualValues(6, response.TotalCount)
|
t.Require().EqualValues(2, response.TotalCount)
|
||||||
t.Require().EqualValues(10, response.Items[0].UserId)
|
t.Require().EqualValues(10, response.Items[0].UserId)
|
||||||
t.Require().EqualValues(9, response.Items[1].UserId)
|
t.Require().EqualValues(9, response.Items[1].UserId)
|
||||||
t.Require().EqualValues(8, response.Items[2].UserId)
|
|
||||||
t.Require().EqualValues(7, response.Items[3].UserId)
|
|
||||||
t.Require().EqualValues(6, response.Items[4].UserId)
|
|
||||||
t.Require().EqualValues(5, response.Items[5].UserId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *AuditSuite) insertAuditLogs() {
|
func (t *AuditSuite) insertAuditLogs() {
|
||||||
|
|||||||
@@ -176,10 +176,9 @@ func (t *SessionSuite) Test_All_Session() {
|
|||||||
|
|
||||||
// Сортировка по статусу, поиск по userId & status
|
// Сортировка по статусу, поиск по userId & status
|
||||||
resUserId := int(userId)
|
resUserId := int(userId)
|
||||||
reqStatus := entity.TokenStatusExpired
|
|
||||||
request.Query = &domain.SessionQuery{
|
request.Query = &domain.SessionQuery{
|
||||||
UserId: &resUserId,
|
UserId: []int{resUserId},
|
||||||
Status: &reqStatus,
|
Status: []string{entity.TokenStatusExpired},
|
||||||
}
|
}
|
||||||
|
|
||||||
err = t.grpcCli.
|
err = t.grpcCli.
|
||||||
@@ -206,7 +205,6 @@ func (t *SessionSuite) Test_All_Session() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenId := 2
|
|
||||||
request = domain.SessionPageRequest{
|
request = domain.SessionPageRequest{
|
||||||
LimitOffestParams: domain.LimitOffestParams{
|
LimitOffestParams: domain.LimitOffestParams{
|
||||||
Limit: 5,
|
Limit: 5,
|
||||||
@@ -217,7 +215,7 @@ func (t *SessionSuite) Test_All_Session() {
|
|||||||
Type: "desc",
|
Type: "desc",
|
||||||
},
|
},
|
||||||
Query: &domain.SessionQuery{
|
Query: &domain.SessionQuery{
|
||||||
Id: &tokenId,
|
Id: new(2),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
err = t.grpcCli.
|
err = t.grpcCli.
|
||||||
@@ -228,12 +226,12 @@ func (t *SessionSuite) Test_All_Session() {
|
|||||||
t.Require().NoError(err)
|
t.Require().NoError(err)
|
||||||
|
|
||||||
t.Require().Len(response.Items, 5)
|
t.Require().Len(response.Items, 5)
|
||||||
t.Require().EqualValues(5, response.TotalCount)
|
t.Require().EqualValues(6, response.TotalCount)
|
||||||
t.Require().EqualValues(23, response.Items[0].Id)
|
t.Require().EqualValues(23, response.Items[0].Id)
|
||||||
t.Require().EqualValues(22, response.Items[1].Id)
|
t.Require().EqualValues(22, response.Items[1].Id)
|
||||||
t.Require().EqualValues(21, response.Items[2].Id)
|
t.Require().EqualValues(21, response.Items[2].Id)
|
||||||
t.Require().EqualValues(20, response.Items[3].Id)
|
t.Require().EqualValues(20, response.Items[3].Id)
|
||||||
t.Require().EqualValues(2, response.Items[4].Id)
|
t.Require().EqualValues(12, response.Items[4].Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *SessionSuite) Test_Session_Expired_Worker() {
|
func (t *SessionSuite) Test_Session_Expired_Worker() {
|
||||||
|
|||||||
+33
-9
@@ -210,7 +210,6 @@ func (s *UserTestSuite) TestGetUsers() {
|
|||||||
s.Require().EqualValues("a1@c.ru", response.Items[1].Email)
|
s.Require().EqualValues("a1@c.ru", response.Items[1].Email)
|
||||||
s.Require().EqualValues(roles, response.Items[1].Roles)
|
s.Require().EqualValues(roles, response.Items[1].Roles)
|
||||||
|
|
||||||
id := int(userId2)
|
|
||||||
email = "test@mail.ru"
|
email = "test@mail.ru"
|
||||||
err = s.grpcCli.Invoke("admin/user/get_users").
|
err = s.grpcCli.Invoke("admin/user/get_users").
|
||||||
JsonRequestBody(domain.UsersPageRequest{
|
JsonRequestBody(domain.UsersPageRequest{
|
||||||
@@ -223,7 +222,7 @@ func (s *UserTestSuite) TestGetUsers() {
|
|||||||
Type: "asc",
|
Type: "asc",
|
||||||
},
|
},
|
||||||
Query: &domain.UserQuery{
|
Query: &domain.UserQuery{
|
||||||
Id: &id,
|
Id: new(int(userId2)),
|
||||||
Email: &email,
|
Email: &email,
|
||||||
},
|
},
|
||||||
}).
|
}).
|
||||||
@@ -233,6 +232,30 @@ func (s *UserTestSuite) TestGetUsers() {
|
|||||||
s.Require().Empty(response.Items)
|
s.Require().Empty(response.Items)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *UserTestSuite) TestAllGetUsers() {
|
||||||
|
InsertUser(s.db, entity.User{Email: "a1@a.ru"})
|
||||||
|
InsertUser(s.db, entity.User{Email: "b1@a.ru"})
|
||||||
|
userId1 := InsertUser(s.db, entity.User{Email: "a1@b.ru"})
|
||||||
|
userId2 := InsertUser(s.db, entity.User{Email: "a1@c.ru"})
|
||||||
|
userId3 := InsertUser(s.db, entity.User{Email: "a1@d.ru"})
|
||||||
|
|
||||||
|
roleId1 := InsertRole(s.db, entity.Role{Name: "test_role_1"})
|
||||||
|
roleId2 := InsertRole(s.db, entity.Role{Name: "test_role_2"})
|
||||||
|
|
||||||
|
InsertUserRole(s.db, entity.UserRole{RoleId: int(roleId1), UserId: int(userId1)})
|
||||||
|
InsertUserRole(s.db, entity.UserRole{RoleId: int(roleId1), UserId: int(userId2)})
|
||||||
|
InsertUserRole(s.db, entity.UserRole{RoleId: int(roleId1), UserId: int(userId3)})
|
||||||
|
|
||||||
|
InsertUserRole(s.db, entity.UserRole{RoleId: int(roleId2), UserId: int(userId1)})
|
||||||
|
InsertUserRole(s.db, entity.UserRole{RoleId: int(roleId2), UserId: int(userId2)})
|
||||||
|
|
||||||
|
response := domain.UsersResponse{}
|
||||||
|
err := s.grpcCli.Invoke("admin/user/get_all_users").JsonResponseBody(&response).Do(context.Background())
|
||||||
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
s.Require().Len(response.Items, 7)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *UserTestSuite) TestGetUsersFilterByLastActiveAt() {
|
func (s *UserTestSuite) TestGetUsersFilterByLastActiveAt() {
|
||||||
userId1 := InsertUser(s.db, entity.User{Email: "test1@a.ru"})
|
userId1 := InsertUser(s.db, entity.User{Email: "test1@a.ru"})
|
||||||
userId2 := InsertUser(s.db, entity.User{Email: "test2@a.ru"})
|
userId2 := InsertUser(s.db, entity.User{Email: "test2@a.ru"})
|
||||||
@@ -318,18 +341,19 @@ func (s *UserTestSuite) TestGetUsersSortByName() {
|
|||||||
Field: "userId",
|
Field: "userId",
|
||||||
Type: "asc",
|
Type: "asc",
|
||||||
},
|
},
|
||||||
|
Query: &domain.UserQuery{
|
||||||
|
UserId: []int{int(userIdViser1), int(userIdViser2), int(userIdScripts), int(userIdAL)},
|
||||||
|
},
|
||||||
}).
|
}).
|
||||||
JsonResponseBody(&response).
|
JsonResponseBody(&response).
|
||||||
Do(context.Background())
|
Do(context.Background())
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
s.Require().Len(response.Items, 6)
|
s.Require().Len(response.Items, 4)
|
||||||
s.Require().EqualValues(1, response.Items[0].Id)
|
s.Require().EqualValues(userIdScripts, response.Items[0].Id)
|
||||||
s.Require().EqualValues(userIdScripts, response.Items[1].Id)
|
s.Require().EqualValues(userIdViser1, response.Items[1].Id)
|
||||||
s.Require().EqualValues(2, response.Items[2].Id)
|
s.Require().EqualValues(userIdViser2, response.Items[2].Id)
|
||||||
s.Require().EqualValues(userIdViser1, response.Items[3].Id)
|
s.Require().EqualValues(userIdAL, response.Items[3].Id)
|
||||||
s.Require().EqualValues(userIdViser2, response.Items[4].Id)
|
|
||||||
s.Require().EqualValues(userIdAL, response.Items[5].Id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *UserTestSuite) TestCreateUserHappyPath() {
|
func (s *UserTestSuite) TestCreateUserHappyPath() {
|
||||||
|
|||||||
Reference in new issue
Block a user