service

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) *Service

func (*Service) AcceptGroupApplySvc

func (s *Service) AcceptGroupApplySvc(ctx context.Context, req *types.AcceptGroupApplyReq) (res *types.AcceptGroupApplyResp, err error)

AcceptGroupApplySvc 接受 申请加入团队 的审批

func (*Service) AddGroupMembers

func (s *Service) AddGroupMembers(ctx context.Context, groupId int64, members []*db.GroupMember, opeId string) error

AddGroupMembers 加群并发送通知

func (*Service) AddMembers

func (s *Service) AddMembers(ctx context.Context, group *biz.GroupInfo, members []*biz.GroupMember) error

func (*Service) ChangeOwner

func (s *Service) ChangeOwner(ctx context.Context, group *biz.GroupInfo, owner, member *biz.GroupMember) error

func (*Service) CheckGroupFriendType

func (s *Service) CheckGroupFriendType(friendType int32) (int32, error)

CheckGroupFriendType 检查friendType是否合法

func (*Service) CheckGroupJoinType

func (s *Service) CheckGroupJoinType(joinType int32) (int32, error)

CheckGroupJoinType 检查joinType是否合法

func (*Service) CheckGroupMemberNum

func (s *Service) CheckGroupMemberNum(newMembers int32, groupMaximum int32) error

CheckGroupMemberNum 检查新增群员是否会超过群人数上限

func (*Service) CheckGroupMuteType

func (s *Service) CheckGroupMuteType(muteType int32) (int32, error)

CheckGroupMuteType 检查muteType是否合法

func (*Service) CheckInGroup

func (s *Service) CheckInGroup(memberId string, groupId int64) (bool, error)

CheckInGroup 查询并检查该成员是否在群中

func (*Service) CheckSetAdminType

func (s *Service) CheckSetAdminType(memberType int32) (int32, error)

CheckSetAdminType 检查SetAdmin是否合法

func (Service) Config

func (s Service) Config() *config.Config

func (*Service) CreateGroup

func (s *Service) CreateGroup(ctx context.Context, group *biz.GroupInfo, owner *biz.GroupMember, members []*biz.GroupMember) (int64, error)

func (*Service) CreateGroupApplySvc

func (s *Service) CreateGroupApplySvc(ctx context.Context, req *types.CreateGroupApplyReq) (res *types.CreateGroupApplyResp, err error)

func (*Service) CreateGroupSvc

func (s *Service) CreateGroupSvc(ctx context.Context, req *types.CreateGroupRequest) (res *types.CreateGroupResponse, err error)

CreateGroupSvc 创建群, 返回群信息

func (*Service) ExecChangeOwner

func (s *Service) ExecChangeOwner(groupId int64, ownerId, memberId string) error

ExecChangeOwner 转让群主

func (*Service) ExecCreateGroupApply

func (s *Service) ExecCreateGroupApply(groupId int64, inviterId string, memberIds []string, applyNote string) error

func (*Service) ExecGroupDisband

func (s *Service) ExecGroupDisband(groupId int64) error

ExecGroupDisband 执行解散群操作

func (*Service) ExecGroupExit

func (s *Service) ExecGroupExit(ctx context.Context, groupId int64, memberId string) error

ExecGroupExit 执行退群操作

func (*Service) ExecJoinGroupMembers

func (s *Service) ExecJoinGroupMembers(members []*db.GroupMember) error

ExecJoinGroupMembers 执行邀请群成员操作

func (*Service) ExitGroup

func (s *Service) ExitGroup(ctx context.Context, group *biz.GroupInfo, member *biz.GroupMember) error

func (*Service) FilteredGroupMembers

func (s *Service) FilteredGroupMembers(members []*biz.GroupMember) []*biz.GroupMember

FilteredGroupMembers 过滤已经在群里的成员

func (*Service) GetFilteredGroupMembers

func (s *Service) GetFilteredGroupMembers(ctx context.Context, group *biz.GroupInfo, memberIds []string) []*biz.GroupMember

func (*Service) GetGroupApplyByIdSvc

func (s *Service) GetGroupApplyByIdSvc(ctx context.Context, req *types.GetGroupApplyByIdReq) (res *types.GetGroupApplysResp, err error)

func (*Service) GetGroupApplysSvc

func (s *Service) GetGroupApplysSvc(ctx context.Context, req *types.GetGroupApplysReq) (res *types.GetGroupApplysResp, err error)

func (*Service) GetGroupIdsByMemberId

func (s *Service) GetGroupIdsByMemberId(memberId string) ([]int64, error)

GetGroupIdsByMemberId 查询用户所有加入的群 ID

func (*Service) GetGroupInfoByConditionSvc

func (s *Service) GetGroupInfoByConditionSvc(ctx context.Context, req *types.GetGroupInfoByConditionReq) (res *types.GetGroupInfoByConditionResp, err error)

GetGroupInfoByConditionSvc 通过搜索得到群列表

func (*Service) GetGroupInfoByGroupId

func (s *Service) GetGroupInfoByGroupId(ctx context.Context, groupId int64) (*biz.GroupInfo, error)

GetGroupInfoByGroupId 根据 GroupId 查询群信息

func (*Service) GetGroupInfoByGroupMarkId

func (s *Service) GetGroupInfoByGroupMarkId(groupMarkId string) (*biz.GroupInfo, error)

GetGroupInfoByGroupMarkId 根据 GroupMarkId 查询群信息 没用到

func (*Service) GetGroupInfoHttp

func (s *Service) GetGroupInfoHttp(ctx context.Context, req *types.GetGroupInfoRequest) (res *types.GetGroupInfoResponse, err error)

GetGroupInfoHttp 查询群资料

func (*Service) GetGroupListSvc

func (s *Service) GetGroupListSvc(ctx context.Context, req *types.GetGroupListRequest) (res *types.GetGroupListResponse, err error)

GetGroupListSvc 查询群列表

func (*Service) GetGroupMemberInfoSvc

func (s *Service) GetGroupMemberInfoSvc(ctx context.Context, req *types.GetGroupMemberInfoRequest) (res *types.GetGroupMemberInfoResponse, err error)

GetGroupMemberInfoSvc 查询群成员信息

func (*Service) GetGroupMemberListSvc

func (s *Service) GetGroupMemberListSvc(ctx context.Context, req *types.GetGroupMemberListRequest) (res *types.GetGroupMemberListResponse, err error)

GetGroupMemberListSvc 查询群成员列表

func (*Service) GetGroupMemberMuteTime

func (s *Service) GetGroupMemberMuteTime(groupId int64, memberId string) (int64, error)

GetGroupMemberMuteTime 查询群成员禁言时间

func (*Service) GetGroupMembersByGroupIdWithLimit

func (s *Service) GetGroupMembersByGroupIdWithLimit(groupId, n, m int64) ([]*biz.GroupMember, error)

GetGroupMembersByGroupIdWithLimit 查询群内前 n 个群成员信息

func (*Service) GetGroupMembersMutedByGroupId

func (s *Service) GetGroupMembersMutedByGroupId(groupId int64) ([]*biz.GroupMember, error)

GetGroupMembersMutedByGroupId 查询群内被禁言的群成员信息

func (*Service) GetGroupPubInfoSvc

func (s *Service) GetGroupPubInfoSvc(ctx context.Context, req *types.GetGroupPubInfoRequest) (res *types.GetGroupPubInfoResponse, err error)

GetGroupPubInfoSvc 查询群资料

func (*Service) GetGroupsByGroupIds

func (s *Service) GetGroupsByGroupIds(ctx context.Context, groupIds []int64) ([]*biz.GroupInfo, error)

GetGroupsByGroupIds 查询用户所有加入的群 todo: 有 bug

func (*Service) GetLog

func (s *Service) GetLog() zerolog.Logger

func (*Service) GetLogWithTrace

func (s *Service) GetLogWithTrace(ctx context.Context) zerolog.Logger

func (*Service) GetMemberByMemberIdAndGroupId

func (s *Service) GetMemberByMemberIdAndGroupId(ctx context.Context, memberId string, groupId int64) (*biz.GroupMember, error)

GetMemberByMemberIdAndGroupId 查询对方在群里的信息

func (*Service) GetMembersByGroupId

func (s *Service) GetMembersByGroupId(groupId int64) ([]*biz.GroupMember, error)

GetMembersByGroupId 查询群里的所有成员信息

func (*Service) GetMuteListSvc

func (s *Service) GetMuteListSvc(ctx context.Context, req *types.GetMuteListRequest) (res *types.GetMuteListResponse, err error)

GetMuteListSvc 查询群内禁言列表

func (*Service) GetOpe

func (s *Service) GetOpe(ctx context.Context) string

func (*Service) GetPersonByMemberIdAndGroupId

func (s *Service) GetPersonByMemberIdAndGroupId(ctx context.Context, memberId string, groupId int64) (*biz.GroupMember, error)

GetPersonByMemberIdAndGroupId 查询本人在群里的信息

func (*Service) GetTrace

func (s *Service) GetTrace(ctx context.Context) string

func (*Service) GroupDisband

func (s *Service) GroupDisband(ctx context.Context, groupId int64, opeId string) error

func (*Service) GroupDisbandHttp

func (s *Service) GroupDisbandHttp(ctx context.Context, req *types.GroupDisbandRequest) (res *types.GroupDisbandResponse, err error)

GroupDisbandHttp 解散群

func (*Service) GroupExitHttp

func (s *Service) GroupExitHttp(ctx context.Context, req *types.GroupExitRequest) (res *types.GroupExitResponse, err error)

GroupExitHttp 退群

func (*Service) GroupRemoveSvc

func (s *Service) GroupRemoveSvc(ctx context.Context, req *types.GroupRemoveRequest) (res *types.GroupRemoveResponse, err error)

GroupRemoveSvc 踢人

func (*Service) InsertGroupMembers

func (s *Service) InsertGroupMembers(tx *mysql.MysqlTx, groupMembers []*db.GroupMember) error

InsertGroupMembers 批量插入群成员

func (*Service) InviteGroupMembersSvc

func (s *Service) InviteGroupMembersSvc(ctx context.Context, req *types.InviteGroupMembersRequest) (res *types.InviteGroupMembersResponse, err error)

InviteGroupMembersSvc 邀请新群员 加群设置为 Any

  • 邀请人为空, 直接加入
  • 邀请人不为空, 直接加入

加群设置为 Apply

  • 邀请人为空, 走审批流程
  • 邀请人为普通人, 走审批流程
  • 邀请人为管理员, 直接加入

加群设置为 Admin

  • 邀请人为空, 拒绝加入
  • 邀请人为普通人, 拒绝加入
  • 邀请人为管理员, 直接加入

func (*Service) InviteMembers

func (s *Service) InviteMembers(ctx context.Context, group *biz.GroupInfo, newMemberIds []string) error

func (*Service) JoinGroups

func (s *Service) JoinGroups(ctx context.Context, members []*biz.GroupMember)

func (*Service) LogicNoticeDel

func (s *Service) LogicNoticeDel(ctx context.Context, groupId int64) error

func (*Service) LogicNoticeJoin

func (s *Service) LogicNoticeJoin(ctx context.Context, groupId int64, groupMemberIds []string) error

func (*Service) LogicNoticeLeave

func (s *Service) LogicNoticeLeave(ctx context.Context, groupId int64, groupMemberIds []string) error

func (*Service) MaintainGroupAESKey

func (s *Service) MaintainGroupAESKey() error

MaintainGroupAESKey 给旧的群设置 aes key

func (*Service) NoticeInviteMembers

func (s *Service) NoticeInviteMembers(ctx context.Context, groupId int64, inviterId string, newMembers []string)

NoticeInviteMembers 新成员加入群发起通知

func (*Service) NoticeMsgDeleteGroup

func (s *Service) NoticeMsgDeleteGroup(ctx context.Context, groupId int64, personId string) error

func (*Service) NoticeMsgKickOutGroup

func (s *Service) NoticeMsgKickOutGroup(ctx context.Context, groupId int64, personId string, memberIds []string) error

func (*Service) NoticeMsgSignInGroup

func (s *Service) NoticeMsgSignInGroup(ctx context.Context, groupId int64, personId string, memberIds []string) error

func (*Service) NoticeMsgSignOutGroup

func (s *Service) NoticeMsgSignOutGroup(ctx context.Context, groupId int64, personId string) error

func (*Service) NoticeMsgUpdateGroupMemberMutedTime

func (s *Service) NoticeMsgUpdateGroupMemberMutedTime(ctx context.Context, groupId int64, personId string, memberIds []string) error

func (*Service) NoticeMsgUpdateGroupMuted

func (s *Service) NoticeMsgUpdateGroupMuted(ctx context.Context, groupId int64, personId string, muteType int32) error

func (*Service) NoticeMsgUpdateGroupName

func (s *Service) NoticeMsgUpdateGroupName(ctx context.Context, groupId int64, personId string, name string) error

func (*Service) NoticeMsgUpdateGroupOwner

func (s *Service) NoticeMsgUpdateGroupOwner(ctx context.Context, groupId int64, personId, newOwner string) error

func (*Service) Ping

func (s *Service) Ping() error

func (*Service) PushGroupNoticeMsg

func (s *Service) PushGroupNoticeMsg(ctx context.Context, groupId int64, personId string, noticeMsgMsg *xproto.NoticeMsg) error

func (*Service) PushNoticeMsg

func (s *Service) PushNoticeMsg(ctx context.Context, channelType int32, from, target string, data []byte) error

func (*Service) PusherSignalDel

func (s *Service) PusherSignalDel(ctx context.Context, groupId int64) error

func (*Service) PusherSignalFriendType

func (s *Service) PusherSignalFriendType(ctx context.Context, groupId int64, friendType int32) error

func (*Service) PusherSignalGroupAvatar

func (s *Service) PusherSignalGroupAvatar(ctx context.Context, groupId int64, avatar string) error

func (*Service) PusherSignalGroupName

func (s *Service) PusherSignalGroupName(ctx context.Context, groupId int64, name string) error

func (*Service) PusherSignalJoin

func (s *Service) PusherSignalJoin(ctx context.Context, groupId int64, groupMemberIds []string) error

func (*Service) PusherSignalJoinType

func (s *Service) PusherSignalJoinType(ctx context.Context, groupId int64, joinType int32) error

func (*Service) PusherSignalLeave

func (s *Service) PusherSignalLeave(ctx context.Context, groupId int64, groupMemberIds []string) error

func (*Service) PusherSignalMemberMuteTime

func (s *Service) PusherSignalMemberMuteTime(ctx context.Context, groupId int64, memberIds []string, muteTime int64) error

func (*Service) PusherSignalMemberType

func (s *Service) PusherSignalMemberType(ctx context.Context, groupId int64, memberId string, memberType int32) error

func (*Service) PusherSignalMuteType

func (s *Service) PusherSignalMuteType(ctx context.Context, groupId int64, muteType int32) error

func (*Service) RejectGroupApplySvc

func (s *Service) RejectGroupApplySvc(ctx context.Context, req *types.RejectGroupApplyReq) (res *types.RejectGroupApplyResp, err error)

func (*Service) RemoveGroupMembers

func (s *Service) RemoveGroupMembers(ctx context.Context, group *biz.GroupInfo, members []*biz.GroupMember) error

RemoveGroupMembers 执行踢人操作

func (*Service) SetAdmin

func (s *Service) SetAdmin(ctx context.Context, group *biz.GroupInfo, member *biz.GroupMember, memberType int32) error

func (*Service) SetAdminSvc

func (s *Service) SetAdminSvc(ctx context.Context, req *types.SetAdminRequest) (res *types.SetAdminResponse, err error)

SetAdminSvc 设置管理员

func (*Service) UpdateGroupAvatar

func (s *Service) UpdateGroupAvatar(ctx context.Context, group *biz.GroupInfo, avatar string) error

func (*Service) UpdateGroupAvatarSvc

func (s *Service) UpdateGroupAvatarSvc(ctx context.Context, req *types.UpdateGroupAvatarRequest) (res *types.UpdateGroupAvatarResponse, err error)

UpdateGroupAvatarSvc 更新群头像

func (*Service) UpdateGroupFriendType

func (s *Service) UpdateGroupFriendType(ctx context.Context, group *biz.GroupInfo, friendType int32) error

func (*Service) UpdateGroupFriendTypeSvc

func (s *Service) UpdateGroupFriendTypeSvc(ctx context.Context, req *types.UpdateGroupFriendTypeRequest) (res *types.UpdateGroupFriendTypeResponse, err error)

UpdateGroupFriendTypeSvc 更新群内加好友设置

func (*Service) UpdateGroupInfoMemberNum

func (s *Service) UpdateGroupInfoMemberNum(ctx context.Context, groupId int64) (int32, error)

UpdateGroupInfoMemberNum 更新群成员数量

func (*Service) UpdateGroupJoinType

func (s *Service) UpdateGroupJoinType(ctx context.Context, group *biz.GroupInfo, joinType int32) error

func (*Service) UpdateGroupJoinTypeSvc

func (s *Service) UpdateGroupJoinTypeSvc(ctx context.Context, req *types.UpdateGroupJoinTypeRequest) (res *types.UpdateGroupJoinTypeResponse, err error)

UpdateGroupJoinTypeSvc 更新加群设置 todo 改造完后就弃用

func (*Service) UpdateGroupMemberType

func (s *Service) UpdateGroupMemberType(ctx context.Context, groupId int64, memberId string, memberType int32) error

UpdateGroupMemberType 更新群成员类型

func (*Service) UpdateGroupMuteType

func (s *Service) UpdateGroupMuteType(ctx context.Context, group *biz.GroupInfo, muteType int32) error

func (*Service) UpdateGroupMuteTypeSvc

func (s *Service) UpdateGroupMuteTypeSvc(ctx context.Context, req *types.UpdateGroupMuteTypeRequest) (res *types.UpdateGroupMuteTypeResponse, err error)

UpdateGroupMuteTypeSvc 更新群禁言设置

func (*Service) UpdateGroupName

func (s *Service) UpdateGroupName(ctx context.Context, group *biz.GroupInfo, name, pubName string) error

func (*Service) UpdateGroupNameSvc

func (s *Service) UpdateGroupNameSvc(ctx context.Context, req *types.UpdateGroupNameRequest) (res *types.UpdateGroupNameResponse, err error)

UpdateGroupNameSvc 更新群名称

func (*Service) UpdateGroupType

func (s *Service) UpdateGroupType(groupId int64, groupType int32) error

UpdateGroupType 更新群类型 rpc 专用

func (*Service) UpdateMemberName

func (s *Service) UpdateMemberName(ctx context.Context, group *biz.GroupInfo, person *biz.GroupMember, memberName string) error

func (*Service) UpdateMemberNameSvc

func (s *Service) UpdateMemberNameSvc(ctx context.Context, req *types.UpdateGroupMemberNameRequest) (res *types.UpdateGroupMemberNameResponse, err error)

UpdateMemberNameSvc 更新群成员昵称

func (*Service) UpdateMembersMuteTime

func (s *Service) UpdateMembersMuteTime(ctx context.Context, group *biz.GroupInfo, members []*biz.GroupMember, muteTime int64) ([]*biz.GroupMember, error)

func (*Service) UpdateMembersMuteTimeSvc

UpdateMembersMuteTimeSvc 设置群成员禁言时间

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL