Documentation ¶
Index ¶
- Constants
- Variables
- func NewGroupIdFromContext(ctx context.Context) (int64, error)
- type GroupApplyBiz
- type GroupInfo
- type GroupMember
- func (m *GroupMember) IsAdmin() error
- func (m *GroupMember) IsOwner() error
- func (m *GroupMember) RemoveOneMember(member *GroupMember) error
- func (m *GroupMember) ToTypes() *types.GroupMember
- func (m *GroupMember) TryInvite(group *GroupInfo) InviteFlow
- func (m *GroupMember) WithContext(ctx context.Context) context.Context
- type InviteFlow
Constants ¶
View Source
const ( DisPlayNum = 10 // 查看群信息默认显示的人数 MuteMaximum = int64(^uint(0) >> 1) // 永久禁言的时间 9223372036854775807 )
View Source
const ( GroupApplyWait = 0 GroupApplyAccept = 1 GroupApplyReject = 2 GroupApplyIgnore = 10 )
View Source
const ( // GroupContextKey . GroupContextKey = groupContextKey("FZM-Group-Token") GroupIdContextKey = groupContextKey("FZM-Group-Id") )
View Source
const ( GroupStatusNormal = 0 // 正常 GroupStatusBlock = 1 // 封禁 GroupStatusDisBand = 2 // 解散 GroupJoinTypeAny = 0 // 无需审批(默认) GroupJoinTypeAdmin = 1 // 禁止加群,群主和管理员邀请加群 GroupJoinTypeApply = 2 // 普通人邀请需要审批,群主和管理员直接加群 GroupMuteTypeAny = 0 // 全员可发言 GroupMuteTypeAdmin = 1 // 全员禁言(除群主和管理员) GroupFriendTypeAllow = 0 // 群内可加好友 GroupFriendTypeDeny = 1 // 群内禁止加好友 // 群类型 GroupTypeNormal = 0 // 普通群 GroupTypeEnt = 1 // 全员群 GroupTypeDep = 2 // 部门群 )
View Source
const ( GroupMemberTypeOwner = 2 // 群主 GroupMemberTypeAdmin = 1 // 管理员 GroupMemberTypeNormal = 0 // 群员 GroupMemberTypeOther = 10 // 退群 )
View Source
const (
// GroupMemberContextKey .
GroupMemberContextKey = groupMemberContextKey("FZM-Group-Member-Token")
)
Variables ¶
View Source
var ( GroupMaximum int32 = 2000 AdminNum int32 = 10 )
Functions ¶
Types ¶
type GroupApplyBiz ¶
type GroupApplyBiz struct { // 审批 ID ApplyId int64 // 群 ID GroupId int64 // 邀请人 ID, 空表示是自己主动申请的 InviterId string // 申请加入人 ID MemberId string // 申请备注 ApplyNote string // 审批人 ID OperatorId string // 审批情况 0=待审批, 1=审批通过, 2=审批不通过, 10=审批忽略 ApplyStatus int32 // 拒绝原因 RejectReason string // 创建时间 ms CreateTime int64 // 修改时间 ms UpdateTime int64 }
func (*GroupApplyBiz) ToTypes ¶
func (g *GroupApplyBiz) ToTypes() *types.GroupApplyInfo
ToTypes 将业务模型转换为 api 展示信息
type GroupInfo ¶
type GroupInfo struct { GroupId int64 GroupMarkId string GroupName string GroupAvatar string // 群人数 GroupMemberNum int32 // 群人数上限 GroupMaximum int32 GroupIntroduce string // 群状态,0=正常 1=封禁 2=解散 GroupStatus int32 GroupOwnerId string GroupCreateTime int64 GroupUpdateTime int64 // 加群方式,0=无需审批(默认),1=禁止加群,群主和管理员邀请加群, 2=普通人邀请需要审批,群主和管理员直接加群 GroupJoinType int32 // 禁言, 0=全员可发言, 1=全员禁言(除群主和管理员) GroupMuteType int32 // 加好友限制, 0=群内可加好友,1=群内禁止加好友 GroupFriendType int32 // 群内当前被禁言的人数 MuteNum int32 `json:"muteNum"` // 群内管理员数量 AdminNum int32 `json:"adminNum"` // AESKey string // GroupPubName string // 群类型 (0: 普通群, 1: 全员群, 2: 部门群) GroupType int32 }
func NewGroupInfoFromContext ¶
func (*GroupInfo) ToTypes ¶
func (g *GroupInfo) ToTypes(owner *types.GroupMember, person *types.GroupMember) *types.GroupInfo
func (*GroupInfo) TrySetAdmin ¶
type GroupMember ¶
type GroupMember struct { GroupId int64 GroupMemberId string GroupMemberName string // 用户角色,0=群员,1=管理员, 2=群主,10=退群 GroupMemberType int32 // 该用户被禁言结束的时间 9223372036854775807=永久禁言 GroupMemberMuteTime int64 GroupMemberJoinTime int64 }
func NewGroupMemberFromContext ¶
func NewGroupMemberFromContext(ctx context.Context) (*GroupMember, error)
func (*GroupMember) IsAdmin ¶
func (m *GroupMember) IsAdmin() error
func (*GroupMember) IsOwner ¶
func (m *GroupMember) IsOwner() error
func (*GroupMember) RemoveOneMember ¶
func (m *GroupMember) RemoveOneMember(member *GroupMember) error
func (*GroupMember) ToTypes ¶
func (m *GroupMember) ToTypes() *types.GroupMember
func (*GroupMember) TryInvite ¶
func (m *GroupMember) TryInvite(group *GroupInfo) InviteFlow
func (*GroupMember) WithContext ¶
func (m *GroupMember) WithContext(ctx context.Context) context.Context
type InviteFlow ¶
type InviteFlow int
const ( InviteOk InviteFlow = 1 InviteApply InviteFlow = 2 InviteFail InviteFlow = 3 )
Click to show internal directories.
Click to hide internal directories.