Pine
|
0a6f753584
|
fix(db): 补回 system_configs.description 列(修复 /admin/config 500)
- 此前 MySQL 适配时模型编辑误删 description,导致仓储序列化 AttributeError
- 0037_system_config_description:幂等补列(SQLite 已有则跳过)并回填存量说明
- 与并行的 0037_market 分叉建 merge 版本,统一迁移线(当前 head=02d10eccb1f9)
|
2026-08-31 23:45:03 +08:00 |
|
Pine
|
04808aaf76
|
feat(market): 技能/插件/应用统一市场子应用(目录/管理/定价/购买/支付分发)+ 0037 迁移与权限种子
|
2026-08-31 23:41:59 +08:00 |
|
Pine
|
6d0bfae6aa
|
feat(hall): 服务订单状态机 + 发包方任务操作(0036)
- 0036 迁移 + ServiceOrder ORM/仓储(service_orders:预约/下单→接单→交付→完成)
- /hall/services/{id}/order 预约下单(禁下自己的单);/hall/orders/bought|selling 双视角
- /hall/orders/{id}/{action} 六动作流转(accept/reject/start/deliver/complete/cancel),
服务方/买方/运营三方权限约束 + 状态机非法流转校验
- /hall/tasks/{id}/win|assign|select|cancel:评标定标/指派/报名选定/取消(仅发包方或运营端)
|
2026-08-31 23:09:27 +08:00 |
|
Pine
|
40c2f75b18
|
feat(admin): 大厅与社区治理接口(岗位/OPC服务/人才/大厅任务/帖子)
- /admin/hall/jobs* 岗位列表与审核上下架
- /admin/hall/services* OPC 服务审核
- /admin/hall/talents* 人才档案列表与上架下架
- /admin/hall/tasks* 大厅任务审核列表(含 pending)与通过/驳回/下架
- /admin/community/posts* 帖子列表、隐藏/恢复、置顶/取消置顶
- 全部走 operator 角色 + write_audit 审计
|
2026-08-31 23:05:13 +08:00 |
|
Pine
|
31f8703595
|
chore(seed): 种子脚本去 sqlite 直连 + 大厅/社区演示种子 + 大厅单测
- scripts/db/seed.py:培训种子与 accounts→users 迁移改经 training 数据层(双方言)
- scripts/db/seed_hall_community.py:人才/岗位/服务/帖子演示数据(幂等,离线执行)
- tests/test_hall.py:人才档案/帖子点赞评论计数/register 报名状态机覆盖
|
2026-08-31 22:20:16 +08:00 |
|
Pine
|
4602c8dac7
|
feat(hall): 大厅/社区接口 + 任务报名(register)模式
- 新增 rbac_hall.py:/hall/*(overview/任务列表详情/发布任务/报名/接单列表/
人才列表详情/档案维护/岗位发布详情投递/服务发布列表详情编辑询单)+
/community/*(Hub/帖子/发帖/点赞/评论/载体列表详情/关注/入驻)
- TaskService.register/register_select:报名即占位状态机(复用 can_accept 资格判定,
register_quota 限额、去重、选定转 assigned,任务保持 published)
- can_accept 修复 actor 不在 users 表时 full=None 崩溃;写权限按叠加制 capabilities 判定
- 路由挂载 app/main.py(/hall + /community)
|
2026-08-31 22:20:16 +08:00 |
|
Pine
|
edf9691d7e
|
feat(hall): 大厅与社区数据层(0035 迁移 + ORM + 仓储)
- 0035 迁移:jobs/job_applications/opc_services/service_inquiries/talent_profiles/
community_posts/community_comments/community_likes/community_follows 建表;
tasks.register_quota、bids.material、park_tenants.area_m2/services_json 扩展
- models.py 新增九张大厅/社区表 ORM;tasks/bids/park_tenants 同步扩展列
- 新增 infrastructure/hall_repositories.py(岗位/投递/服务/询单/人才/帖子/评论/点赞/关注仓储,
驼峰出参契约)并挂载进 Database 门面(hall_* / community_*)
- TaskRepository.create/update/_to_dict 补 register_quota;
ParkAdmissionRepository.create(社区入驻复用,source=community)
|
2026-08-31 22:20:16 +08:00 |
|
Pine
|
374767bbca
|
chore: 清理废弃 SQLite 代码与过时注释
- 删除死代码 app/db.py / app/repositories.py / app/dependencies.py(legacy 模块,
import 即损坏且全仓无引用,活跃实现在 app/infrastructure/)
- 删除废弃库文件 serverdata/data/opc.db(2026-08-24 并入总库前的旧分库)
- 注释措辞同步 SQLite→统一总库(DATABASE_URL 决定方言)
|
2026-08-31 21:46:22 +08:00 |
|
Pine
|
ac4c1aabe4
|
chore(db): SQLite→MySQL 迁移脚本 + 测试夹具适配
- scripts/migrate_sqlite_to_mysql.py:离线迁移(MySQL 建表→alembic stamp head→
逐表拷贝[NOT NULL 列类型化兜底]→自增回填→行数校验),支持 --drop-existing 重建与增量续跑
- tests/test_training_persist.py:夹具改 monkeypatch DATABASE_URL + reset_engine,
建表统一走 Base.metadata(原 DB_PATH/SCHEMA 随 sqlite3 直连移除)
|
2026-08-31 21:40:31 +08:00 |
|
Pine
|
176bafdfe5
|
refactor(training): 数据层收编 SQLAlchemy 统一走 DATABASE_URL(去 sqlite3 直连)
- db.py:原生 sqlite3 模块重写为 SQLAlchemy 同步引擎(经 infrastructure.make_sync_engine,
同源 config.DATABASE_URL,SQLite/MySQL 双方言);保留 get_conn/fetch_one/list_all/
insert/update_row/delete_row 签名,get_conn 返回「? 占位符兼容 shim」,20+ 调用点零改动
- SCHEMA 常量存档不再执行(表由 alembic 0003+ 管理);新增 reset_engine 供测试/切库
- main.py:删除 sqlite3 直连残余(未支付订单关闭路径)
|
2026-08-31 21:40:31 +08:00 |
|
Pine
|
ee1dfdfed9
|
feat(db): 数据库层 MySQL 适配(方言钩子/同步驱动映射/种子方言分支)
- infrastructure/db.py:MySQL 方言编译钩子(String 无长度→VARCHAR(255),Text→MEDIUMTEXT);
新增 sync_database_url/make_sync_engine(sqlite+aiosqlite→sqlite,mysql+asyncmy→mysql+pymysql)
- models.py:sessions.token 显式 String(2048)、system_configs.value 改 Text(存量数据超 255,MySQL 需兼容)
- seed.py:_add_agent 幂等插入按方言分支(SQLite=INSERT OR IGNORE / MySQL=INSERT IGNORE)
- park/tenants.py:同步只读引擎改走 make_sync_engine(原 +aiosqlite replace 对 MySQL 无效)
- 依赖补 pymysql;.env.example 补 PINEAGENTS_DEMO_DATABASE_URL 说明
|
2026-08-31 21:40:17 +08:00 |
|
Pine
|
9a5e9176b0
|
feat(park): 载体资料与云南载体地图数据层(0034)
- park_tenants 新增坐标/封面/地址/区域/富文本介绍·政策·入驻流程/联系方式/标签/展示统计列
- 审核流:载体端改动写草案待审(pending),运营端通过后合并生效;运营端直接编辑即时生效
- 接口:运营端 /park/tenants/{tid}/profile(GET/PUT/review),载体端 /park/api/my-park-profile
- C 端公开载体 API:GET /api/parks、GET /api/parks/{pid}(training 子应用)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-31 20:36:53 +08:00 |
|
Pine
|
614804a0a6
|
feat(training): 活动体系重构与报名生命周期闭环
- 活动三维标签(区域/类型/模式)+ 发布范围(本园区/公开)+ 审核流(0031):C 端仅展示 approved,园区活动仅本园区可见
- 独立字段:富文本介绍 body、注意事项 notice(0032)、外链报名 signup_mode/external_url、发布者信息
- 审核端点 /api/events/{eid}/review 双身份(operator 任意 / carrier 限本园区)+ /api/events/mine
- 报名生命周期闭环(0033):未支付/待审核=删除,待参加=取消,结束未签到=爽约可申诉,未支付 15 分钟自动关闭删除
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-31 20:36:42 +08:00 |
|
Pine
|
dbc29eee59
|
feat(membership): 成员制归属重构与叠加制身份(多对多成员表+转园两级审核)
- park_members/company_members 多对多成员表(0028),users.affiliation 为派生缓存由 sync_user_affiliation 刷新
- 转园两级审核状态机(0029):pending_from→pending_to→approved,支持用户/企业整体转园与运营端兜底
- 叠加制身份(0030):身份恒为运营/载体/OPC,企业管理员为能力叠加非身份,去除 enterprise/carrier 直写角色
- rbac 新增 memberships/park-transfers/企业管理员工作台 /admin/ent/* 接口
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-31 20:36:26 +08:00 |
|
Pine
|
bb3559bd51
|
feat(pay): 微信支付子应用与活动定价报名(event_orders/EV_ 前缀/支付后自动确认)
- app/pay 域新增活动订单模型与事件服务,复用充值支付链路(JSAPI+回调验签+幂等+15 分钟过期+对账补单)
- 0027: bookings 加 pay_status/order_no,events 加 price_fen(0=免费)
- 运营端桥透传活动定价字段
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-31 20:36:16 +08:00 |
|
Pine
|
9f57ef25d6
|
refactor(training): 用户识别支持手机号身份并规范同步旁路注释
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-30 22:29:44 +08:00 |
|
Pine
|
7493383f6a
|
feat(users): 建号规则收紧与手机号绑定
- 管理端/园区端创建用户:账号系统随机生成不可指定,手机号必填且全局唯一
- 管理端用户管理支持绑定/更换手机号(PATCH /admin/users/{id}/phone)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-30 22:29:44 +08:00 |
|
Pine
|
e44fea96ca
|
feat(compute): /v1中继鉴权重写与平台用户余额视图
- relay 鉴权重写:JWT→引擎 PAT 逐用户归属,拒绝匿名调用,余额<=0 预检 403
- compute_client 增 list_engine_users/get_engine_user/sync_user_mirror 等
- 运营端新增 /admin/compute/platform-users 平台用户视图(引擎真实余额/折扣/用量)与充值镜像回写
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-30 22:29:44 +08:00 |
|
Pine
|
f1147dced3
|
feat(pay): 微信支付V3子应用与算力充值
- app/pay 独立支付子应用(config/wxpay/models/repository/service/routers),便于后期拆分微服务
- 充值订单表 0026_compute_recharge;套餐支持折扣(discount)与上架开关(enabled),DB system_configs 优先、env 兜底
- 统一小程序支付:桌面端出小程序码→扫码进小程序确认页按 openid 发起 JSAPI→回调幂等到账(引擎 adjust_user_quota+镜像回写)
- 内嵌 wechatpayv3(含 async_),响应验签失败降级告警;新增 aiofiles 依赖
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-30 22:29:44 +08:00 |
|
Pine
|
75b81ca8de
|
chore(scripts): 演示数据临时脚本(资讯4类×25条+活动40场,手动 add/del,不入种子迁移)
|
2026-08-29 00:30:16 +08:00 |
|
Pine
|
9c4908fb87
|
feat(auth): 停用账密登录 + 扫码会话有效期下发 + 叠加制身份模型
- /auth/login 全端口停用(403 引导手机号/小程序扫码登录)
- 扫码会话接口下发 expires_in(前端二维码倒计时)
- role_allowed 叠加制身份:所有账号自带 OPC 基础身份,operator/carrier 仅业务叠加,35 处 C 端端点统一放行
|
2026-08-28 17:17:58 +08:00 |
|
Pine
|
4f11931143
|
feat(content): 资讯发布时间/来源/发布人规范 + 点赞/留言/分享互动体系
- published_at 发布时间(迁移0022):运营端不限、园区端禁早于3天前,双方均支持定时发布;C端/大屏到点才可见
- 发布人:运营端可设(留空显示官方)、园区端固定园区名只能填来源
- 点赞/分享/留言(迁移0023-0025):content_likes 去重点赞、like_count/share_count、留言回复+评论点赞
- 各出口(内容/留言/入驻资料 docs)统一 resolve_url 生成 CDN 直链;入库统一 to_object_path 对象路径
|
2026-08-28 17:17:49 +08:00 |
|
Pine
|
985b85cb4e
|
feat(oss): 统一OSS/CDN对象存储与直链出口体系
- infrastructure/oss.py 重写:服务端上传/预签名上下行/CDN鉴权直链(方式A)/resolve_url·to_object_path 出入口规范
- config.py 新增 OSS_REGION/OSS_CDN_BASE_URL/OSS_CDN_AUTH_KEY
- media_upload 统一走 oss 单例,返回 CDN 直链;dispatcher /oss 前缀路由
- 管理端用户列表头像出口 CDN 化
|
2026-08-28 17:17:38 +08:00 |
|
Pine
|
89396eb6b0
|
chore: 汇总提交(园区资料/内容审核/任务相关)+迁移0019/0021及部署编排调整
|
2026-08-27 21:02:47 +08:00 |
|
Pine
|
4ef0f81629
|
feat(auth): /auth/me 与登录响应暴露 wxBound/wxMiniBound 绑定状态
- UserProfile schema 增加 wxBound/wxMiniBound(LoginResponse/ProfileResponse 继承)
- to_profile 补 wx_openid/wx_mini_openid 判定,web/admin 正确识别手机号+小程序绑定
|
2026-08-27 20:26:34 +08:00 |
|
Pine
|
b745328d49
|
feat(tasks): 运营端任务详情/竞标/报名端点 + 园区发布任务端点
- 运营端 /admin/tasks/{id} 详情、/{id}/bids、/{id}/claims、/{id}/bids/{bid_id}/win 开标定标(余标置lost+进 in_progress)
- 园区端 POST /park/api/park/tasks 发布任务(publisher_role=park/park_id=本园/发布即上架/默认公有)
|
2026-08-27 20:19:40 +08:00 |
|
Pine
|
084f039d10
|
feat(园区端): 放宽 release/assign 作用域(本园发布或指派本园均可) + 新增 /park/api/park/tasks/{id}/status 上架下架
|
2026-08-27 19:48:49 +08:00 |
|
Pine
|
3bed50f316
|
feat(tasks): 企业发标 EnterpriseTaskCreate 增多端配置字段(可见性/指派/园区/名额/条件/托管)
|
2026-08-27 19:42:53 +08:00 |
|
Pine
|
34b662ce38
|
feat(tasks): 任务创建/更新 schema 增多端配置字段(可见性/指派/园区/名额/条件/托管)
|
2026-08-27 19:29:42 +08:00 |
|
Pine
|
ad1bcf5bbf
|
feat(tasks): 阶段A剩余 —— 园区端/大屏任务 + 运营平台资金托管结算
- 大屏 /api/tasks 改为仅展示「当前园区可接」:本园专属(park_id)∪公有(park_public),状态published/claimed/doing
- 园区端 /api/park/tasks(本园发布+指派本园列表) /tasks/{id}/release(园区内发单→park_released+可见性) /tasks/{id}/assign(园区内指派→锁定被指派人)
- 运营托管结算(operator):/admin/escrows(台账) /admin/tasks/{id}/escrow(托管建档/充值,佣金5%) /admin/tasks/{id}/release(验收结算,划佣金+余额代付OPC),全部挂运营平台
|
2026-08-27 19:07:20 +08:00 |
|
Pine
|
076f96af74
|
feat(tasks): 阶段A后端核心 —— 多模式任务字段 + 接单资格判定 + 各模式限额守卫 + 公开广场/详情can_accept
- Task 增扩展列:publisher_role/visibility/c_visible/park_public/assign_type/assign_park_id/assign_opc_id/park_id/park_released/bid_quota/win_quota/eligibility(JSON)/settle_mode(默认operator_escrow)
- TaskRepository._to_dict/create/update 同步新字段;迁移 0020_task_multi_mode
- TaskService.can_accept(task,user):仅被指派/园区专属/指派园区未发单 + eligibility(证书/地域/性别/工时/领域/专长/案例) 判定,返回 ok/reasons
- 抢单(grab)与投标(bid)接入 can_accept 守卫;bid 加报名上限与重复报名校验
- /opc/tasks 公开广场改为 published+c_visible;/opc/tasks/{id} 详情同;登录后附带 can_accept/accept_reasons(经 optional_current_user)
|
2026-08-27 19:05:18 +08:00 |
|
Pine
|
11598abcc1
|
feat(api): 任务广场与任务详情公开化(无需登录)
- GET /opc/tasks 去除 require_roles 改为公开,按 display_priority 降序返回已发布任务
- 新增 GET /opc/tasks/{task_id} 公开任务详情(仅已发布,其余404)
|
2026-08-27 18:36:16 +08:00 |
|
Pine
|
9160183a3c
|
feat(park): GET /park/api/content/feed 大屏资讯流(tenant 解析,含未公开)
|
2026-08-27 15:53:51 +08:00 |
|
Pine
|
89bd7e8390
|
feat(content): 发布体系 大/小图 + 公开 + 园区端发布
- 迁移0018:content_items 加 card_mode/is_public/source/tenant_id
- ContentRepository:_to_dict/create/update 含新字段;list 加 public_only/tenant_id 过滤
- /opc/content 仅 published+公开;/opc/content/{id} 非公开→404
- 园区端 POST /park/api/content:发布人强制=园区名、source=carrier、tenant=本园、is_public 默认false(仅大屏)、card_mode默认small
- 园区端 GET /park/api/content:本园区内容(含未公开)供大屏
- schemas 补 card_mode/is_public
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 15:42:39 +08:00 |
|
Pine
|
a60f0ed180
|
feat(content): 资讯详情 阅读数 + 留言
- 迁移0017:content_items.read_count + content_comments 表
- ContentRepository:_to_dict 加 read_count;incr_read_count/content_comments/add_content_comment
- rbac_opc:GET /opc/content/{id} 自增阅读数;GET/POST /opc/content/{id}/comments(发布需 opc_member,带昵称/头像)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 15:28:27 +08:00 |
|
Pine
|
b80fba6150
|
feat(content): GET /admin/content/{id} 详情(编辑回填)
|
2026-08-27 14:56:21 +08:00 |
|
Pine
|
74d50c829d
|
feat(upload): 媒体上传优先走 OSS(OSS_ENDPOINT 启用→桶,返回 endpoint/bucket/key 绝对URL),本地降级
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 14:53:59 +08:00 |
|
Pine
|
71b1f03bca
|
feat(content): 资讯富编辑(封面/图集/视频/外链/发布人) + 媒体上传
- 迁移0016:content_items 加 cover/images_json/video/video_cover/link/publisher_name/publisher_avatar
- ContentRepository:_to_dict/create/update 支持富字段;images(list)↔images_json;update 白名单含 publisher_id
- schemas:ContentCreate/UpdateRequest 加富字段
- rbac_operator:POST /content 注入发布人(actor 昵称/头像快照);新增 POST /admin/upload(媒体上传)
- app/services/media_upload.py:统一上传(serverdata/uploads + abs_url),与 /api/upload 同契约
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 14:35:32 +08:00 |
|
Pine
|
7ec9b8fd8a
|
fix(db): 每请求独立 AsyncSession(根除并发 500)
- get_db 由「返回 app.state.db 单例」改为「每请求各建一个 Database 并在结束关闭」
- Database.__init__ 复用按 url 缓存的共享异步引擎(_shared_engine),避免每请求重建引擎
- 修复 GET /auth/me、/admin/* 并发时 sqlalchemy.exc.InvalidRequestError: concurrent operations are not permitted(同一 AsyncSession 被并发请求复用)
- 对齐 park 子应用 _carrier_db 的每请求 Database 模式
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 14:17:55 +08:00 |
|
Pine
|
873a70a095
|
feat(content): 资讯增删改 + C端资讯中心(类别)端点
- ContentRepository:+update(部分字段)/get/delete
- schemas.operator:+ContentUpdateRequest(全可选)
- rbac_operator:+PUT/DELETE /admin/content/{id}(action:content.manage+审计)
- rbac_opc:+GET /opc/content?type=policy|news|skill|dynamic(仅published)、/opc/content/{id}(详情)
- 类别字典 policy/news/skill/dynamic
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 14:05:38 +08:00 |
|
Pine
|
5840a5cb4c
|
feat(ops): 课程/活动管理支持编辑与删除
- training_admin_bridge:+update_course/delete_course/update_activity/delete_activity(tdb.update_row/delete_row)
- schemas.operator:+CourseUpdateRequest/ActivityUpdateRequest(字段全可选,仅更新传入项)
- rbac_operator:+PUT/DELETE /admin/courses/{id}、/admin/activities/{id}(action:course.manage/activity.manage + 审计)
- 富操作(增/改/删/态)齐备
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-27 10:33:15 +08:00 |
|
Pine
|
8697119aaa
|
feat(park-company): 园区企业→成员 + 企业算力(折扣%/配额,只增不减) 后端
- 迁移0015:park_companies 加 compute_discount/compute_quota/compute_quota_used/engine_group/owner_user_id;users 加 park_company_id(成员归属一家企业)
- tenants.py:company_members/get/add/remove(写 users.park_company_id)、available_members(候选)、set_company_compute(折扣%/配额 单调非降,越界 ValueError)、sync_company_engine(引擎组倍率同步,best-effort)
- park/routers.py:carrier 端点 company-members GET/POST/DELETE、company-pool、companies/{cid}/compute(monotonic+引擎同步);鉴权 _carrier_user+_my_park 隔离本园区
- compute_client.py:set_user_group_by_username、set_group_group_ratio(组倍率=1-discount%)、grant_user_quota_by_username(解析引擎id后 add_quota)
- rbac_admin.py:平台兜底 GET /park/tenants/{tid}/companies、PUT .../companies/{cid}/compute(monotonic+audit)
- _user_to_dict 暴露 park_company_id
- 单调校验服务端强判:折扣降/配额负增 → 400
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-26 19:57:37 +08:00 |
|
Pine
|
ac2df72b21
|
refactor(auth): 去多身份/多端口——账号单一角色,删 user_identities/select-identity/多端口路由
- 删 UserIdentity 模型/IdentityRepository/db.identities,账号统一单一角色(users.role)
- auth.py 去 select-identity/_identity_summaries,登录恒返回 identities=[];_login_response_for_user 按单角色签发
- 删多端口路由 rbac_government/investor/developer 及其 main 挂载
- seed 去多身份回填(_migrate_identities/_ensure_port_agents/多端身份/端口标签映射)
- dependencies: require_port 去端口隔离(单角色放宽)、optional_current_user 修 identity_id 多余参数
- user_admin_service create_user 不再建端口身份;schemas 去 SelectIdentityRequest
- 新增迁移 0014_drop_user_identities(drop user_identities 表)
- 测试改写为单角色契约(登录空 identities、无 select-identity、账号级智能体)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-26 19:15:51 +08:00 |
|
Pine
|
97f0a0698c
|
feat(park): 平台园区/屏幕绑定 + OPC认证入园转园审核 + 园区端carrier修复
- rbac_admin 新增 /admin/park/screens|tenants|devices/{id}/bind|unbind 及 OPC认证/入园/转园审核端点
- tenants.list_all_screens 带 online(MQTT心跳),bind/unbind 完备
- park/routers: tenant_bind 绑定即 set_role(carrier);_my_park 兜底 username→admin_username 解析园区(修"未关联任何园区")
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-26 19:02:58 +08:00 |
|
Pine
|
745ba678bd
|
feat(auth): 统一鉴权收口,账号单一角色+权限码,去多身份
- dependencies._resolve_identity 收敛为单角色(users.role),不再读身份分支
- auth.login/select_identity 单角色发token、identities 恒空,Pine=operator(运营方)
- repositories.to_profile 按 role 计算 account_type(修复身份标签显示"服务方")
- seed 重构 PERMISSIONS/ROLE_PERMISSIONS:operator 平台全 menu、carrier 园区 menu:park_*,删多端口冗余
- account_types 归一 operator/carrier/opc_member/service
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-08-26 19:02:54 +08:00 |
|
Pine
|
bc6265eb67
|
feat(opc): OPC认证/入园/转园 端点 + 园区端方案B审核 + 迁移0013
- rbac_opc.py: /opc/certification/apply|mine、/opc/park-transfer/apply|mine
- rbac_admin.py: platform operator 兜底 list/review (opc-certifications/park-admissions/park-transfers),通过回填 users.set_classification
- park/routers.py: carrier 角色凭 operator_user_id 定位本园区,/park/api park-admissions|transfers view+review
- park/tenants.py: bind_admin 写 operator_user_id + find_by_operator_user_id
- 迁移 0013: opc_certifications + park_transfers + park_tenants.operator_user_id
|
2026-08-26 15:43:34 +08:00 |
|
Pine
|
30f0baf074
|
feat(opc): OPC认证/园区转园 数据层 — OpcCertification/ParkTransfer 模型 + 三个 repo + schemas
- models.py: ParkTenant 加 operator_user_id(园区归属载体账号);新增 OpcCertification/ParkTransfer 两 ORM 类
- repositories.py: OpcCertificationRepository/ParkTransferRepository/ParkAdmissionRepository + Database 挂载
- schemas/opc.py: OpcCertApplyRequest/ParkTransferApplyRequest
- schemas/admin.py: OpcCertReviewRequest/ParkAdmissionReviewRequest/ParkTransferReviewRequest
|
2026-08-26 15:43:34 +08:00 |
|
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
|
00f43976b3
|
feat(auth): 账号类型收敛为四种 + 对外下发中文标签(文本)
- account_type(role)→operator/carrier/opc_member/service; 非运营非OPC一律service; sub_role置None
- 登录/me/资料统一返回 account_type + account_type_label(运营方/载体方/OPC/服务方); 前端直接渲染文本
- 权限按账号类型解析(service→provider基座), 逻辑集中在 app/domain/account_types.py
|
2026-08-26 13:09:02 +08:00 |
|
Pine
|
af6f01c5a9
|
feat(auth): 账号类型统一为四种(运营方/载体方/OPC/服务方) + 关闭子角色 + 权限逻辑集中
- 新增 app/domain/account_types.py(唯一来源): account_type(role)→operator/carrier/opc/service,
非运营非OPC一律→service(预留服务商/甲方企业); permission_role(类型)→权限角色码; label()
- _issue_token/_profile_for 统一走账号类型: 权限=permissions_for(permission_role(atype)),
子角色置None(停用); 资料暴露 account_type/account_type_label
- 端口角色(role)仅保留做内部路由守卫兼容, 对外鉴权用四种账号类型
|
2026-08-26 13:03:44 +08:00 |
|