From 743ccd1172b0811577d66aceef1c7a661baaf1e0 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 8 Nov 2025 23:50:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8F=90=E5=8F=96=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-protocol/bean/BaseChatSettingsBean.ts | 5 +++++ client-protocol/bean/ChatBean.ts | 3 ++- client-protocol/bean/GroupSettingsBean.ts | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 client-protocol/bean/BaseChatSettingsBean.ts diff --git a/client-protocol/bean/BaseChatSettingsBean.ts b/client-protocol/bean/BaseChatSettingsBean.ts new file mode 100644 index 0000000..074b789 --- /dev/null +++ b/client-protocol/bean/BaseChatSettingsBean.ts @@ -0,0 +1,5 @@ +interface BaseChatSettings { + [key: string]: unknown +} + +export default BaseChatSettings diff --git a/client-protocol/bean/ChatBean.ts b/client-protocol/bean/ChatBean.ts index 4b1de08..eabae02 100644 --- a/client-protocol/bean/ChatBean.ts +++ b/client-protocol/bean/ChatBean.ts @@ -1,3 +1,4 @@ +import BaseChatSettingsBean from "./BaseChatSettingsBean.ts" import ChatType from "./ChatType.ts" export default class ChatBean { @@ -5,7 +6,7 @@ export default class ChatBean { declare id: string declare title: string declare avatar_file_hash?: string - declare settings?: { [key: string]: unknown } + declare settings?: BaseChatSettingsBean declare is_member: boolean declare is_admin: boolean diff --git a/client-protocol/bean/GroupSettingsBean.ts b/client-protocol/bean/GroupSettingsBean.ts index 3adface..5ae3f0e 100644 --- a/client-protocol/bean/GroupSettingsBean.ts +++ b/client-protocol/bean/GroupSettingsBean.ts @@ -1,4 +1,6 @@ -interface GroupSettingsBean { +import BaseChatSettings from "./BaseChatSettingsBean.ts" + +interface GroupSettingsBean extends BaseChatSettings { allow_new_member_join?: boolean allow_new_member_from_invitation?: boolean new_member_join_method?: 'disabled' | 'allowed_by_admin' | 'answered_and_allowed_by_admin' @@ -7,8 +9,6 @@ interface GroupSettingsBean { // 下面两个比较特殊, 由服务端给予 group_title: string group_name: string - - [key: string]: unknown } export default GroupSettingsBean