feat(auth): 角色映射按平台字典(1-7)校准,并移除资源库模块对接
build / build-push (push) Successful in 52s

- 角色字典实测校准(采样 200+ 账号 currentRole/roles):
  1 老师 / 2 校领导 / 3 学生 / 4 家长 / 5 局领导 / 6 工作号 / 7 管理员
  → agent.roles: student=[3] teacher=[1,6] parent=[4] admin=[2,5,7]
  (旧默认 student=[1]/teacher=[2,3]/admin=[4..7] 系臆测,导致老师账号被显示为学生)
- 新增家长身份 AgentRole.PARENT;活动报名/取消改由 STUDENT_OR_PARENT 放行
- 当前身份识别增加 roleName 关键词兜底,避免识别不出就降级为访客
- 移除资源库对接:删除 ResourceTools 及注册/编排/agent.modules/module-landing
- 测试 48/48 通过
This commit is contained in:
lijing
2026-10-12 16:10:39 +08:00
parent 57766c8bba
commit 67e55f1875
11 changed files with 265 additions and 135 deletions
@@ -10,7 +10,6 @@ import com.yunhai.agent.tool.defs.DormNoticeTools;
import com.yunhai.agent.tool.defs.HomeworkTools;
import com.yunhai.agent.tool.defs.LeaveTools;
import com.yunhai.agent.tool.defs.ProfessionTools;
import com.yunhai.agent.tool.defs.ResourceTools;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -75,7 +74,6 @@ public class ToolRegistry {
register(DormNoticeTools.defs());
register(ActivityTools.defs());
register(HomeworkTools.defs());
register(ResourceTools.defs());
register(ProfessionTools.defs());
// 套用「学生 / 教师」角色能力策略(未显式声明角色的工具在此落定)
RolePolicy.apply(tools.values());