refactor: 重構 對話 成員的儲存邏輯

* 使用關聯資料庫, 鏈接 user_id 和 chat_id
This commit is contained in:
CrescentLeaf
2025-09-23 09:20:30 +08:00
parent 0ef2859291
commit 5d5b04ba05
3 changed files with 58 additions and 15 deletions

View File

@@ -13,7 +13,7 @@ export default class ChatPrivate extends Chat {
static createForPrivate(userA: User, userB: User) {
const chat = this.create(this.getChatIdByUsersId(userA.bean.id, userB.bean.id), 'private')
chat.setMembers([
chat.addMembers([
userA.bean.id,
userB.bean.id
])