feat(tenant): 成员管理新增 CASDOOR 同步与批量导入部门匹配(000156)
deploy-hxtesting / build-and-deploy (push) Failing after 1s
deploy-hxtesting / build-and-deploy (push) Failing after 1s
同步CASDOOR成员: - 经 Casdoor 管理 API 拉全量用户目录:部门落组织架构(org_depts),账号 工号优先匹配/邮箱兜底,未注册自动开户并加入空间;单向增量幂等, 无部门数据自动降级为纯成员同步 - 新增 OIDC_AUTH_ADMIN_* 配置段(client_credentials/服务账号密码两种模式、 部门字段映射),集成层见 internal/integrations/casdoor 用户部门字段(迁移 000156): - users.dept_code/dept_name 同步态字段:成员列表「所属部门」列展示, 组织中心从平台用户添加时按部门自动预选 批量导入部门列: - 模板调整为 工号/姓名/部门/邮箱/角色 五列,六语言弹窗文案同步更新 - 部门列按部门管理自动匹配:名称/编号精确命中 → 唯一子串兜底,多候选 歧义不匹配;命中回写所属部门,未命中留空不阻断该行导入;部门管理 不可用时整列降级忽略(与 Casdoor 同步降级同思路) 构建: - Dockerfile: browserskill 预构建产物快速通道,rustup 按需安装 + BuildKit 缓存挂载
This commit is contained in:
1 parent
27c4d96ae1
commit
168057db78
32 files changed
+2408
-49
No files matched your search
@@ -36,6 +36,12 @@ import (
|
||||
type TenantMemberHandler struct {
|
||||
memberService interfaces.TenantMemberService
|
||||
userService interfaces.UserService
|
||||
// orgService 驱动批量导入的部门列自动匹配(读本租户部门管理 org_depts);
|
||||
// 未装配时导入照常进行,部门列整列忽略(handler 内 nil 兜底)。
|
||||
orgService interfaces.OrgCenterService
|
||||
// syncService 驱动「同步CASDOOR成员」(000156);未启用管理 API 时
|
||||
// 依赖仍注入(SyncMembers 返回配置提示),handler 只做 nil 兜底。
|
||||
syncService interfaces.CasdoorMemberSyncService
|
||||
// config is optional for the CRUD paths; ImportMembers reads
|
||||
// OIDCAuth.EmailFallbackDomain from it to synthesise placeholder
|
||||
// emails when a roster row has none (same source of truth as the
|
||||
@@ -52,11 +58,15 @@ type TenantMemberHandler struct {
|
||||
func NewTenantMemberHandler(
|
||||
memberService interfaces.TenantMemberService,
|
||||
userService interfaces.UserService,
|
||||
orgService interfaces.OrgCenterService,
|
||||
syncService interfaces.CasdoorMemberSyncService,
|
||||
cfg *config.Config,
|
||||
) *TenantMemberHandler {
|
||||
return &TenantMemberHandler{
|
||||
memberService: memberService,
|
||||
userService: userService,
|
||||
orgService: orgService,
|
||||
syncService: syncService,
|
||||
config: cfg,
|
||||
}
|
||||
}
|
||||
@@ -156,6 +166,7 @@ func (h *TenantMemberHandler) ListMembers(c *gin.Context) {
|
||||
row.Email = u.Email
|
||||
row.Username = u.Username
|
||||
row.DisplayName = u.DisplayName
|
||||
row.DeptName = u.DeptName
|
||||
row.Avatar = u.Avatar
|
||||
}
|
||||
resp = append(resp, row)
|
||||
|
||||
Reference in new issue
Block a user