From 7aa05453a2c0b1341f0390d41c4769e44b1a75a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Tue, 11 Jan 2022 14:57:25 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=AE=8C=E5=96=84=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=BE=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/param/request.go | 18 ++++++++++++++---- common/group.go | 12 ++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 common/group.go diff --git a/api/param/request.go b/api/param/request.go index 8466e38..ac4858a 100644 --- a/api/param/request.go +++ b/api/param/request.go @@ -1,5 +1,7 @@ package param +import "gitee.ltd/lxh/txim/common" + // AccountImportReq 单个账号导入 type AccountImportReq struct { Identifier string `json:"Identifier"` // 用户名,长度不超过32字节 @@ -35,10 +37,18 @@ type AccountDeleteReqItem struct { // GroupCreateReq 建群 type GroupCreateReq struct { - OwnerAccount string `json:"Owner_Account"` - Type string `json:"Type"` - Name string `json:"Name"` - ApplyJoinOption string `json:"ApplyJoinOption"` + OwnerAccount string `json:"Owner_Account"` // 群主的 UserId(选填) + Type common.GroupType `json:"Type"` // 群组类型(不支持创建直播群) + Name string `json:"Name"` // 群名称(必填) + ApplyJoinOption string `json:"ApplyJoinOption"` // 申请加群处理方式(选填) -> FreeAccess(自由加入),NeedPermission(需要验证),DisableApply(禁止加群),不填默认为 NeedPermission(需要验证) + GroupId string `json:"GroupId"` // 自定义的群组Id + MemberList []GroupMemberItem `json:"MemberList"` // 群组成员 +} + +// GroupMemberItem 群成员 +type GroupMemberItem struct { + MemberAccount string `json:"Member_Account"` // 群成员 UserId(必填) + Role string `json:"Role"` // 群成员身份(选填) } // ======================================================== diff --git a/common/group.go b/common/group.go new file mode 100644 index 0000000..2930e75 --- /dev/null +++ b/common/group.go @@ -0,0 +1,12 @@ +package common + +// GroupType 群类型 +type GroupType string + +const ( + GroupTypeWork GroupType = "Work" // Work(好友工作群) + GroupTypePublic GroupType = "Public" // Public(陌生人社交群) + GroupTypeMeeting GroupType = "Meeting" // Meeting(临时会议群) + GroupTypeAVChatRoom GroupType = "AVChatRoom" // AVChatRoom(直播群) + GroupTypeCommunity GroupType = "Community" // Community(社群) +)