4 Commits

Author SHA1 Message Date
Pine f6f2008498 refactor(auth): 账号类型彻底收敛为四种 + 各端口守卫改 service(去除冗余角色)
- 迁移守卫: provider/enterprise/government/investor/developer 一律 require_roles("service")
- token/profile.role 归一为四种(operator/carrier/opc_member/service); require_roles 与之一致
- 账号类型集中 app/domain/account_types.py; 子角色停用
2026-08-26 13:15:06 +08:00
Pine 01ef3c9637 refactor: schemas 抽取(DTO 从 models.py 与路由内联迁至 api/schemas/)
- 新建 api/schemas/:auth/agents/admin/ecosystem/investor/opc/operator/org/portals
- models.py 移除 15 个 Pydantic DTO(保留 ORM 数据模型层)
- 13 个路由内联 DTO 全部迁出,路由瘦身仅剩处理逻辑
- 全量 66 测试通过
2026-08-24 09:51:52 +08:00
Pine 413bd29390 feat: 业务层 services 抽取(财务/结算/补贴)
- FinanceService:opc_add_finance 直写 ORM 改为走 Repository.create(修复四层依赖违规)
- SettlementService:结算佣金(5%)/电子合同幂等/争议联动/投资撮合评分
- SubsidyService:政务三级审批状态机(区县→市→省→发放)
- rbac_ecosystem/rbac_government/rbac_opc 接线,路由瘦身
2026-08-24 01:54:04 +08:00
Pine 980a2db6d9 refactor: 平台应用异步四层架构(接口/业务/领域/基础设施)
- 基础设施层 async:SQLAlchemy 异步引擎/会话、33 Repository async 化、models/security/seed 迁入 infrastructure、新增 cache.py(redis.asyncio) 与 oss.py(aioboto3)
- 接口层:routers 迁 api/routers 并全 async,dependencies 迁 api/dependencies(get_db/get_current_user async)
- 依赖:sqlalchemy[asyncio]/aiosqlite/asyncmy/redis/aioboto3;config 异步 URL + Redis/OSS 配置
- 删除废弃:旧同步 db/dependencies/repositories/storage
- 验证:平台 19 路由 + 培训 48 路由全注册;/health /auth/login /auth/me /admin/tasks /notifications 等接口 async 可用
2026-08-23 23:52:58 +08:00