Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename config fields #151

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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