Skip to content

Commit

Permalink
Merge pull request #151 from suyuan32/dev
Browse files Browse the repository at this point in the history
refactor: rename config fields
  • Loading branch information
suyuan32 authored Jul 5, 2023
2 parents c8372fe + c01c787 commit 490fc7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api/etc/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ DatabaseConf:
CacheTime: 5

ProjectConf:
DefaultRole: 1 # default role id when register
DefaultDepartment: 1 # default department id when register
DefaultPosition: 1 # default position id when register
DefaultRoleId: 1 # default role id when register
DefaultDepartmentId: 1 # default department id when register
DefaultPositionId: 1 # default position id when register

Prometheus:
Host: 0.0.0.0
Expand Down
6 changes: 3 additions & 3 deletions api/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Config struct {
}

type ProjectConf struct {
DefaultRole uint64 `json:",default=1"`
DefaultDepartment uint64 `json:",default=1"`
DefaultPosition uint64 `json:",default=1"`
DefaultRoleId uint64 `json:",default=1"`
DefaultDepartmentId uint64 `json:",default=1"`
DefaultPositionId uint64 `json:",default=1"`
}
6 changes: 3 additions & 3 deletions api/internal/logic/user/register_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func (l *RegisterLogic) Register(req *types.RegisterReq) (resp *types.BaseMsgRes
Nickname: &req.Username,
Status: pointy.GetPointer(uint32(1)),
HomePath: pointy.GetPointer("/dashboard"),
RoleIds: []uint64{l.svcCtx.Config.ProjectConf.DefaultRole},
DepartmentId: pointy.GetPointer(l.svcCtx.Config.ProjectConf.DefaultDepartment),
PositionIds: []uint64{l.svcCtx.Config.ProjectConf.DefaultPosition},
RoleIds: []uint64{l.svcCtx.Config.ProjectConf.DefaultRoleId},
DepartmentId: pointy.GetPointer(l.svcCtx.Config.ProjectConf.DefaultDepartmentId),
PositionIds: []uint64{l.svcCtx.Config.ProjectConf.DefaultPositionId},
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 490fc7c

Please sign in to comment.