source

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRequestAddFriendCode

func CheckRequestAddFriendCode(code string, requestUID string) error

CheckRequestAddFriendCode 检测加好友申请code是否有效

func CheckSource

func CheckSource(code string) error

CheckSource 验证加好友来源

func GetSoruce

func GetSoruce(code string) string

GetSoruce 获取好友来源

func GetSources

func GetSources(codes []string) (map[string]string, error)

GetSources 批量获取好友来源 返回 以code为key 来源内容为value的map

func SetGroupMemberProvider

func SetGroupMemberProvider(groupMemberProvide IGetGroupMemberProvider)

SetGroupMemberProvider 设置获取群成员提供者

func SetUserProvider

func SetUserProvider(userProvider IGetUserProvider)

SetUserProvider 设置获取用户提供者

Types

type FriendModel

type FriendModel struct {
	UID     string
	ToUID   string
	Vercode string
	Name    string
}

FriendModel 好友model

type GroupMember

type GroupMember struct {
	UID     string
	Name    string
	GroupNo string
	Vercode string
	Role    int
}

GroupMember 群成员

type GroupModel

type GroupModel struct {
	Name               string
	GroupNo            string
	ForbiddenAddFriend int //群内禁止加好友
}

GroupModel 群model

type IGetGroupMemberProvider

type IGetGroupMemberProvider interface {
	//获取群成员信息
	GetGroupMemberByVercode(vercode string) (*GroupMember, error)
	GetGroupMemberByVercodes(vercodes []string) ([]*GroupMember, error)
	//获取群信息
	GetGroupByGroupNo(groupNo string) (*GroupModel, error)
	// 通过uid获取群成员信息
	GetGroupMemberByUID(uid string, groupNo string) (*GroupMember, error)
}

IGetGroupMemberProvider 获取群成员提供者

type IGetUserProvider

type IGetUserProvider interface {
	//通过vercode获取用户信息
	GetUserByVercode(vercode string) (*UserModel, error)
	//通过手机通讯录验证码获取用户信息
	GetUserByMailListVercode(vercode string) (*UserModel, error)
	//通过qrvercode获取用户信息
	GetUserByQRVercode(qrvercode string) (*UserModel, error)
	//通过UID获取用户信息
	GetUserByUID(uid string) (*UserModel, error)
	//通过vercode获取好友信息
	GetFriendByVercode(vercode string) (*FriendModel, error)
	GetFriendByVercodes(vercodes []string) ([]*FriendModel, error)
}

IGetUserProvider 获取用户提供者

type UserModel

type UserModel struct {
	UID             string
	Name            string
	Vercode         string
	QRVercode       string
	MailListVercode string
}

UserModel 用户model

Jump to

Keyboard shortcuts

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