Branch: cfclub (146 commits ahead of master)
三方平台型家庭教育服务系统,连接客户(家长)、服务商(成长规划师/活动方/供应商)和平台运营三方角色。三端架构:Spring Boot 2.7.18 后端 + uni-app 微信小程序 + Vue 2 Web管理端。另有 dan/danshop/ 独立商城子系统(Spring Boot 项目)。
cfc/
├── cfc-backend/ # Spring Boot 2.7.18, MyBatis-Plus, JWT, Java 8
│ └── src/main/java/com/etotem/cfc/
│ ├── controller/ # 按功能子包: admin, auth, assessment, family, guide, task, reward, energy, sncp, market, vendor, payment, stats, streak
│ ├── service/ # 业务逻辑
│ ├── entity/ # MyBatis-Plus 实体
│ ├── config/ # JWT / 多数据源 / DatabaseInitializer
│ └── common/ # Result<T>, JwtUtil
├── cfc-frontend/ # uni-app 微信小程序 (Vue 2, Options API)
│ ├── pages/ # 页面 (index/, body/, mind/, action/, profile/, teacher/, games/, assessment/, shop/, ...)
│ ├── pages.json # TabBar (首页/身体/心智/行动/我的) + 分包注册
│ ├── config.js # 环境自适应 baseUrl (develop/trial/release)
│ └── store/ # Vuex 双角色状态
├── cfc-web/ # Vue 2 + Element UI 管理端
│ └── src/
│ ├── views/ # admin/ + teacher/ 视图
│ ├── router/ # 角色权限路由守卫
│ └── store/ # 认证状态
├── dan/danshop/ # 独立商城 Spring Boot 子系统 (localhost:8888)
├── tests/ # unit, integration, e2e (Playwright)
└── docs/ # 需求/设计/测试文档
| 项目 | 命令/端口 | 备注 |
|---|---|---|
| 后端 | mvn clean compile / mvn spring-boot:run |
localhost:9082 |
| 小程序 | npm install → 微信开发者工具导入 |
dev:mp-weixin 需通过 uni-app CLI 或 HBuilderX |
| Web管理端 | npm run serve |
localhost:8082 |
| 数据库 | 192.168.16.251:3306/zxyj |
账号 zxyj / zxyj@123 |
| sfms源库 | bianwoyou.mysql.rds.aliyuncs.com:3305/sfms |
只读,用于数据迁移 |
| Danshop | localhost:8888 |
独立 Spring Boot 商城子系统 |
| 数据迁移 | curl -X POST http://localhost:9082/api/migration/run |
sfms → zxyj |
@PostMapping,禁止 @GetMapping/@PutMapping/@DeleteMapping@TableName + @TableId(type = IdType.AUTO)Result<T> (code/message/data)Authorization Header;JwtInterceptor 拦截 /api/**(8个公开路径除外)@Resource 替代 @Autowired,字段名匹配默认 Bean Name@RequestAttribute("role")?.(用 && 替代)、禁止 CSS Grid(用 flexbox)grep -rn '@Mapping' cfc-backend/src/.../controller/ | grep -oP '@\w+Mapping\("\K[^"]*' | sort -u 检查重复role=teacher,可登录规划师端,也可切换回家长视角SfmsDataSourceConfig)config.js 通过 uni.getAccountInfoSync() 自动切换 develop/trial/release 的 API 地址wechat.test-mode: true 跳过微信 API,使用模拟数据# 后端
cd cfc-backend && mvn clean compile # 编译验证
mvn spring-boot:run # 启动 (localhost:9082)
mvn test # 运行测试
# Web管理端
cd cfc-web && npm run serve # 开发 (localhost:8082)
npm run build # 生产构建
npm test # Jest 测试
# 小程序 (uni-app, 需全局 CLI 或 HBuilderX)
cd cfc-frontend && npm install
# 通过微信开发者工具导入项目根目录
# 数据迁移 (从 sfms 导入历史数据)
curl -X POST http://localhost:9082/api/migration/run
cfc-backend/AGENTS.md — 后端详细规范cfc-frontend/AGENTS.md — 小程序前端规范cfc-web/AGENTS.md — Web管理端规范tests/AGENTS.md — 分层测试策略