Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aebc53174b | ||
|
|
88e5ffedad |
No files matched your search
@@ -1,3 +1,5 @@
|
||||
### v6.6.1
|
||||
* Добавлено поле `roleNames` в метод `admin/user/get_profile`
|
||||
### v6.6.0
|
||||
* Добавлено отдельное событие 'user_blocked' для блокировки/разблокировки пользователей
|
||||
* Обновлены зависимости
|
||||
|
||||
+1
-1
@@ -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
@@ -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:
|
||||
|
||||
@@ -34,6 +34,7 @@ type AdminUserShort struct {
|
||||
Email string `validate:"required"`
|
||||
Role string
|
||||
Roles []int
|
||||
RoleNames []string
|
||||
Permissions []string
|
||||
IdleTimeoutMs int
|
||||
}
|
||||
|
||||
+7
-2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user