MSP-7036 fix search by user.Id
This commit is contained in:
1 parent
d2da566f25
commit
a2c5dab4a7
8 files changed
+30
-9
No files matched your search
@@ -27,7 +27,7 @@ func NewPermissions(permissionsService permissionsService) Permissions {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {array} domain.Permission
|
||||
// @Router /user/get_profile [POST]
|
||||
// @Router /user/get_permissions [POST]
|
||||
func (u Permissions) GetPermissions(ctx context.Context) []domain.Permission {
|
||||
return u.permissionsService.All(ctx)
|
||||
}
|
||||
@@ -1147,6 +1147,23 @@ paths:
|
||||
summary: Получение внешнего вида
|
||||
tags:
|
||||
- user
|
||||
/user/get_permissions:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Получить все разрашения
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/domain.Permission'
|
||||
type: array
|
||||
summary: Получить все разрашения
|
||||
tags:
|
||||
- user
|
||||
/user/get_profile:
|
||||
post:
|
||||
consumes:
|
||||
|
||||
@@ -15,6 +15,7 @@ type AuditResponse struct {
|
||||
TotalCount int
|
||||
Items []Audit
|
||||
}
|
||||
|
||||
type AuditPageRequest struct {
|
||||
LimitOffestParams
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ require (
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/txix-open/bgjob v1.6.0
|
||||
github.com/txix-open/isp-kit v1.64.7
|
||||
github.com/txix-open/isp-kit v1.64.8
|
||||
github.com/txix-open/jsonschema v1.3.0
|
||||
golang.org/x/crypto v0.45.0
|
||||
golang.org/x/sync v0.18.0
|
||||
|
||||
@@ -154,8 +154,8 @@ github.com/txix-open/etp/v4 v4.0.1 h1:5VSYgGsvnMz0tvUHsjVWFETI0qWBTCF1O3ARCHaCIg
|
||||
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.9.0/go.mod h1:EyFOP17KrwEFOUjR+PH8iH3LCtiN9TSQ8t0ysyk62po=
|
||||
github.com/txix-open/isp-kit v1.64.7 h1:gPSVDtmmpNqKJumZxEvnHYY1K1B54zFwHyBIaKo3y5A=
|
||||
github.com/txix-open/isp-kit v1.64.7/go.mod h1:GvBsX5p2U3/ugK6PuWANYzSy/4YgawROm3eAKb35G6o=
|
||||
github.com/txix-open/isp-kit v1.64.8 h1:nck8Gw5a7Jh6AVLqR2FihurrP5bTfeLUrodYB4j4+p4=
|
||||
github.com/txix-open/isp-kit v1.64.8/go.mod h1:GvBsX5p2U3/ugK6PuWANYzSy/4YgawROm3eAKb35G6o=
|
||||
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/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/txix-open/isp-kit/bootstrap"
|
||||
"github.com/txix-open/isp-kit/shutdown"
|
||||
"msp-admin-service/assembly"
|
||||
"msp-admin-service/conf"
|
||||
"msp-admin-service/routes"
|
||||
|
||||
"github.com/txix-open/isp-kit/bootstrap"
|
||||
"github.com/txix-open/isp-kit/cluster"
|
||||
"github.com/txix-open/isp-kit/shutdown"
|
||||
)
|
||||
|
||||
var version = "1.0.0"
|
||||
@@ -22,7 +24,7 @@ var version = "1.0.0"
|
||||
//go:generate swag init --parseDependency
|
||||
//go:generate rm -f docs/swagger.json docs/docs.go
|
||||
func main() {
|
||||
boot := bootstrap.New(version, conf.Remote{}, routes.EndpointDescriptors())
|
||||
boot := bootstrap.New(version, conf.Remote{}, routes.EndpointDescriptors(), cluster.GrpcTransport)
|
||||
app := boot.App
|
||||
logger := app.Logger()
|
||||
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package repository
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"msp-admin-service/domain"
|
||||
@@ -351,7 +352,7 @@ func reqUsersQuery(q squirrel.SelectBuilder, reqQuery *domain.UserQuery) squirre
|
||||
}
|
||||
|
||||
if reqQuery.Id != nil {
|
||||
q = q.Where("id = ?", *reqQuery.Id)
|
||||
q = q.Where(squirrel.ILike{"id::text": strconv.Itoa(*reqQuery.Id) + "%"})
|
||||
}
|
||||
|
||||
if reqQuery.UserId != nil { // поиск в ui по имени, но в бд - по id юзера
|
||||
|
||||
Reference in new issue
Block a user