Files
websopy-taro/.workbuddy/memory/MEMORY.md
赵忠林 2ec3383fd0 feat(weapp): 新增开发者中心与平台管理入口及功能
- 小程序端新增开发者中心和平台管理页面模块,完善功能入口
- 新增开发者中心页面(概览、我的应用、API Key和工单)
- 新增平台管理页面(管理首页、应用审核、Git权限审核、域名绑定审核和工单处理)
- 复刻PC端/api/app/*相关API接口,基地址使用WEBSOPY_API_BASE_URL
- 增加公共组件StatCard、EntryGrid、CellRow以支持新页面UI
- 修改首页增加开发者中心和平台管理角色入口,仅对对应用户显示
- 用户页面菜单新增开发者中心和平台管理入口条件展示
- 约定开发者身份使用sys_user.is_developer布尔字段,不再依赖角色表
- 更新登录态业务,菜单是否显示基于登录接口返回的isDeveloper/isAdmin字段
- vip-review审核通过流程调整为只调用setUserDeveloper,后台替换角色为developer并置isDeveloper=1
2026-07-22 16:42:15 +08:00

18 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 项目长期记忆websopy-taro
## 核心约定
### 开发者身份的表示方式
- **开发者身份主校验位 = `sys_user.is_developer` 布尔位**(数据库列 `is_developer`),登录态 `MainController.loginByDeveloperSms` 校验它才允许开发者登录。
- 后端仓库:`/Users/gxwebsoft/JAVA/com.gxwebsoft.core`(单 Maven 模块,包名 `com.gxwebsoft` 分包)。
- 标记接口:`PUT /api/system/user/developer/{userId}``UserController.setDeveloper``UserService.markAsDeveloper`),成功后经 `syncMessageProducer` 同步 websopy。
- 前端调用:`@/api/system/user``setUserDeveloper(userId)`
- **vip-review 审核通过流程(用户 2026-07-22 最终确认)**:前端 `handleApprove` 只调 `setUserDeveloper(userId)`(不碰 `sys_user_role`)。后端 `markAsDeveloper` 做两件事:① 把 `sys_user.is_developer``1`;② **替换**用户角色为 `developer`——`roleService.getByRoleCode(roleCode=developer, tenantId=用户租户)` 找到角色 → 删掉该用户现有 `sys_user_role` → 只绑定 developer 这一个角色,**不与原角色并存**(角色替换包 try/catch失败不影响 isDeveloper 落库)。即"升级为开发者 = 单角色 developer + isDeveloper 标记位",不是新增第二个角色。
- 注意:前端 `vip-review` / `vip-upgrade` 等页面的变量名仍残留 `VIP_ROLE_*``pendingVipCount``dealerPrice` 等旧标识符(仅文案改成了「开发者」),后端角色与缓存 key 仍对应这些旧名,重命名需谨慎。
### 后端代码风格com.gxwebsoft.core
- Controller 继承 `BaseController`,统一返回 `ApiResult`(成功 `code=0`,失败 `code=1`),用 `success()/fail()`
- 「按 userId 置一个标志位」的范式:`new User(){{setUserId(); setXxx();}}``userService.updateById(u)`(参考 `updateStatus`/`updateRecommend`/`auditUser`)。
- 用户变更后如需同步 websopy`syncMessageProducer.sendUserSyncMessage("websopy","UPDATE",user)`(在 `UserServiceImpl` 内,`@Autowired(required=false)` 注入)。
- 用户相关代码都在 `com.gxwebsoft.common.system`entity/service/controller业务应用数据在 `com.gxwebsoft.websopy`(无 Controller