Compare commits

...
2 Commits
Author SHA1 Message Date
txix aebc53174b 2026-02-13 17:10:15: merge [main:b1d5aae316b6f02c6bdd8e85b62db55e229923e1];
Create and publish a Docker image / build-and-push-image (push) Canceled after 0s
2026-02-13 17:10:15 +03:00
txix 88e5ffedad 2025-10-29 15:09:22: merge [main:2637770d8299ca2f29cca8cba4524bb3865137cd]; 2025-10-29 15:09:22 +03:00
7 changed files with 18 additions and 7 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
6.6.0
6.6.1
+2
View File
@@ -1,3 +1,5 @@
### v6.6.1
* Добавлено поле `roleNames` в метод `admin/user/get_profile`
### v6.6.0
* Добавлено отдельное событие 'user_blocked' для блокировки/разблокировки пользователей
* Обновлены зависимости
+1 -1
View File
@@ -13,7 +13,7 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,target=. \
go build -ldflags="-X 'main.version=$version_env'" -o /main .
FROM alpine:3.21
FROM alpine:3.23
RUN apk add --no-cache tzdata
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
+4 -3
View File
@@ -33,6 +33,10 @@ definitions:
type: array
role:
type: string
roleNames:
items:
type: string
type: array
roles:
items:
type: integer
@@ -233,7 +237,6 @@ definitions:
domain.SecureAuthResponse:
properties:
adminId:
format: int64
type: integer
authenticated:
type: boolean
@@ -315,7 +318,6 @@ definitions:
firstName:
type: string
id:
format: int64
type: integer
lastName:
type: string
@@ -334,7 +336,6 @@ definitions:
type: string
ids:
items:
format: int64
type: integer
type: array
limit:
+1
View File
@@ -34,6 +34,7 @@ type AdminUserShort struct {
Email string `validate:"required"`
Role string
Roles []int
RoleNames []string
Permissions []string
IdleTimeoutMs int
}
+7 -2
View File
@@ -105,8 +105,9 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
roleIds := RolesIds(roles)
var (
roleList []entity.Role
roleName string
roleList []entity.Role
roleName string
roleNames []string
)
if len(roleIds) != 0 {
roleList, err = u.roleRepoUser.GetRoleByIds(ctx, roleIds)
@@ -115,6 +116,9 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
}
if len(roleList) > 0 {
roleName = roleList[0].Name
for _, r := range roleList {
roleNames = append(roleNames, r.Name)
}
}
}
@@ -124,6 +128,7 @@ func (u User) GetProfileById(ctx context.Context, userId int64) (*domain.AdminUs
Email: user.Email,
Role: roleName,
Roles: roleIds,
RoleNames: roleNames,
IdleTimeoutMs: u.idleTimeoutMs,
Permissions: mergePermissions(roleList),
}, nil
+2
View File
@@ -99,6 +99,7 @@ func (s *UserTestSuite) TestGetProfileHappyPath() {
Email: "a@a.ru",
Role: "admin",
Roles: []int{1},
RoleNames: []string{"admin"},
Permissions: []string{},
}
s.Require().Equal(expected, response)
@@ -151,6 +152,7 @@ func (s *UserTestSuite) TestGetProfileSudir() {
Email: "a@b.ru",
Role: "admin",
Roles: []int{1},
RoleNames: []string{"admin"},
Permissions: []string{},
}
s.Require().Equal(expected, response)