Commit Graph
5 Commits
Author SHA1 Message Date
yml f4361c9804 优化发布群租客清退与历史消息 2026-06-18 09:39:23 +08:00
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
yml2213andClaude Opus 4.8 e75a39b03a 新增消息已读状态
复用 chat_participants.last_read_at 推导已读,无需新表/迁移。

- 后端:MessageDTO 增加 is_read,toMessageDTOs 按「全部已读」语义计算
  (所有其他参与者均已读才算已读,1对1 即对方已读);MarkRead 成功后
  推送 conversation_read 事件(含 reader 与 read_at),NotifyConversation
  与 NotifyAllAdmins 双通道通知,使发送方/客服实时刷新已读
- 前端:ChatMessage 增加 is_read,ChatView/AdminChatsView/MobileChatView
  在自己的消息下渲染「已读/未读」;收到 conversation_read 且本端仍有
  未获回执的自己消息时才重载,避免无谓请求

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 22:22:05 +08:00
yml2213andClaude Opus 4.8 cc1c0d33de 修复客服后台聊天无实时刷新
后台 token 仅存 httpOnly cookie,localStorage 无 access token,
useChatSSE 在空 token 时提前 return,导致后台 SSE 从未建立连接,
只有手动刷新才出消息。

- 前端:后台 SSE 不再因空 token 返回,去掉 query token,
  改用 withCredentials 依赖 cookie 鉴权
- 后端:新增 Hub.NotifyAllAdmins,新消息与新会话广播给所有在线客服,
  使「未分配 / 全部」视图实时刷新(参与者客服重复收到由前端按 id 去重)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 19:57:58 +08:00
yml2213 60ff513463 拆分大型 Repository 文件职责 2026-06-10 14:28:16 +08:00