 ymlandClaude Opus 4.8
|
ad70b24fb6
|
提交2: 发布群核心功能实现
- 实现 EnsureListingConversation: 发布时建发布群,发欢迎语+二维码
- 实现 AddRenterToListingConversation: 付款后拉租客进群
- 实现 RemoveRenterFromListingConversation: 订单终态移出租客
- 实现消息可见性过滤: 租客只能看到 joined_at 之后的消息
- listing 模块注入 ListingChatCreator 接口,发布时建群
- ListingDTO 新增 listing_group_conversation_id 字段
- 付款流程改为拉租客进发布群(替代建订单群)
- 订单完成和取消时自动移出租客
- 创建 chat 适配器实现接口解耦
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-17 15:57:10 +08:00 |
|
yml
|
6ff7692f3e
|
支付确认强一致化: 订单推进与标 paid 合并为单事务
confirmPaid 原为「先 ConfirmPaidFromChannel 独立事务推进订单, 再 Updates 标 paid」两步非原子, 崩溃在中间会出现订单已 pending_handoff 但 payment 仍 paying 的不一致窗口, 恢复依赖渠道回调重发而非事务闭环。
改造:
- 新增 ConfirmPaidFromChannelTx(tx, orderID) 让 order 模块共享 payment 模块的外部事务, 订单推进与 payment 标 paid 落进同一事务, 崩溃一致性窗口消除
- NotifyNewConversation 提到事务提交后触发, 避免事务回滚后误发会话通知
- payment_orders 加行锁后 Updates, 防并发回调覆盖写
- 删除未使用的 providerBizNo 死参数
锁顺序全局一致 (order→listing→account→payment), 与 payment_start/refund/Cancel 路径无反向加锁, 无死锁风险。
新增集成测试:
- 正向: 验证 confirmPaid 后 order/listing/account/payment 全部正确推进
- 回滚: payment 更新失败时 order 不残留 pending_handoff, 验证事务原子性
go build/vet/test 通过。
|
2026-06-14 09:42:26 +08:00 |
|