feat(auth): 新增微信同步登录接口 wechat-sync(小程序BFF用) #185
Reference in New Issue
Block a user
Delete Branch "feat/wechat-sync-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
功能说明
新增系统级内部接口
POST /api/v1/auth/wechat-sync,供小程序BFF层调用,实现微信 openid → 查找/创建SaaS用户 → 返回 token 的完整链路。改动清单
领域层 (Domain)
packages/domain/entities.py:User 实体新增wechat_openid、wechat_unionid字段端口层 (Ports)
packages/ports/user_repository.py:新增find_by_wechat_openid()、find_by_wechat_unionid()抽象方法适配器层 (Adapters)
packages/adapters/sqlalchemy_impl/user_repository.py:实现微信openid/unionid查询方法,save和_to_entity同步映射应用层 (Application)
packages/application/auth/wechat_sync_use_case.py(新增):微信同步登录用例路由层 (API Routes)
apps/api/app/api/routes/auth.py:新增/wechat-sync路由数据库
025_add_user_wechat_fields已在 develop 分支上安全设计
关联项目
小虾智剪微信小程序(miniapp)BFF层依赖此接口