db

package
v0.0.0-...-4702bed Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignalCache      = "SIGNAL_CACHE:"
	SignalListCache  = "SIGNAL_LIST_CACHE:"
	GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT"
	FcmToken         = "FCM_TOKEN:"
)
View Source
const MaxNum = 100

Variables

View Source
var ErrMsgListNotExist = errors.New("user not have msg in mongoDB")

Functions

func GetCurrentTimestampByMill

func GetCurrentTimestampByMill() int64

func GetExtendMsgMaxNum

func GetExtendMsgMaxNum() int32

func GetExtendMsgSourceID

func GetExtendMsgSourceID(ID string, index int32) string

func GetSeqUid

func GetSeqUid(uid string, seq uint32) string

func GetSingleGocMsgNum

func GetSingleGocMsgNum() int

func SplitSourceIDAndGetIndex

func SplitSourceIDAndGetIndex(sourceID string) int32

Types

type AppVersion

type AppVersion struct {
	Version     string `gorm:"column:version;size:64" json:"version"`
	Type        int    `gorm:"column:type;primary_key" json:"type"`
	UpdateTime  int    `gorm:"column:update_time" json:"update_time"`
	ForceUpdate bool   `gorm:"column:force_update" json:"force_update"`
	FileName    string `gorm:"column:file_name" json:"file_name"`
	YamlName    string `gorm:"column:yaml_name" json:"yaml_name"`
	UpdateLog   string `gorm:"column:update_log" json:"update_log"`
}

func (AppVersion) TableName

func (AppVersion) TableName() string

type Black

type Black struct {
	OwnerUserID    string    `gorm:"column:owner_user_id;primary_key;size:64"`
	BlockUserID    string    `gorm:"column:block_user_id;primary_key;size:64"`
	CreateTime     time.Time `gorm:"column:create_time"`
	AddSource      int32     `gorm:"column:add_source"`
	OperatorUserID string    `gorm:"column:operator_user_id;size:64"`
	Ex             string    `gorm:"column:ex;size:1024"`
}

message BlackInfo{ string OwnerUserID = 1; int64 CreateTime = 2; PublicUserInfo BlackUserInfo = 4; int32 AddSource = 5; string OperatorUserID = 6; string Ex = 7; } open_im_sdk.BlackInfo(BlackUserInfo) != imdb.Black (BlockUserID)

type BlackList

type BlackList struct {
	UserId           string    `gorm:"column:uid"`
	BeginDisableTime time.Time `gorm:"column:begin_disable_time"`
	EndDisableTime   time.Time `gorm:"column:end_disable_time"`
}

type ChatLog

type ChatLog struct {
	ServerMsgID      string    `gorm:"column:server_msg_id;primary_key;type:char(64)" json:"serverMsgID"`
	ClientMsgID      string    `gorm:"column:client_msg_id;type:char(64)" json:"clientMsgID"`
	SendID           string    `gorm:"column:send_id;type:char(64);index:send_id,priority:2" json:"sendID"`
	RecvID           string    `gorm:"column:recv_id;type:char(64);index:recv_id,priority:2" json:"recvID"`
	SenderPlatformID int32     `gorm:"column:sender_platform_id" json:"senderPlatformID"`
	SenderNickname   string    `gorm:"column:sender_nick_name;type:varchar(255)" json:"senderNickname"`
	SenderFaceURL    string    `gorm:"column:sender_face_url;type:varchar(255);" json:"senderFaceURL"`
	SessionType      int32     `gorm:"column:session_type;index:session_type,priority:2;index:session_type_alone" json:"sessionType"`
	MsgFrom          int32     `gorm:"column:msg_from" json:"msgFrom"`
	ContentType      int32     `gorm:"column:content_type;index:content_type,priority:2;index:content_type_alone" json:"contentType"`
	Content          string    `gorm:"column:content;type:varchar(3000)" json:"content"`
	Status           int32     `gorm:"column:status" json:"status"`
	SendTime         time.Time `` /* 164-byte string literal not displayed */
	CreateTime       time.Time `gorm:"column:create_time" json:"createTime"`
	Ex               string    `gorm:"column:ex;type:varchar(1024)" json:"ex"`
}

func (ChatLog) TableName

func (ChatLog) TableName() string

type ClientInitConfig

type ClientInitConfig struct {
	DiscoverPageURL string `gorm:"column:discover_page_url;size:64" json:"version"`
}

func (ClientInitConfig) TableName

func (ClientInitConfig) TableName() string

type Comment

type Comment struct {
	UserID        string `bson:"user_id" json:"user_id"`
	UserName      string `bson:"user_name" json:"user_name"`
	ReplyUserID   string `bson:"reply_user_id" json:"reply_user_id"`
	ReplyUserName string `bson:"reply_user_name" json:"reply_user_name"`
	ContentID     string `bson:"content_id" json:"content_id"`
	Content       string `bson:"content" json:"content"`
	CreateTime    int32  `bson:"create_time" json:"create_time"`
}

type Conversation

type Conversation struct {
	OwnerUserID           string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"`
	ConversationID        string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"`
	ConversationType      int32  `gorm:"column:conversation_type" json:"conversationType"`
	UserID                string `gorm:"column:user_id;type:char(64)" json:"userID"`
	GroupID               string `gorm:"column:group_id;type:char(128)" json:"groupID"`
	RecvMsgOpt            int32  `gorm:"column:recv_msg_opt" json:"recvMsgOpt"`
	UnreadCount           int32  `gorm:"column:unread_count" json:"unreadCount"`
	DraftTextTime         int64  `gorm:"column:draft_text_time" json:"draftTextTime"`
	IsPinned              bool   `gorm:"column:is_pinned" json:"isPinned"`
	IsPrivateChat         bool   `gorm:"column:is_private_chat" json:"isPrivateChat"`
	BurnDuration          int32  `gorm:"column:burn_duration;default:30" json:"burnDuration"`
	GroupAtType           int32  `gorm:"column:group_at_type" json:"groupAtType"`
	IsNotInGroup          bool   `gorm:"column:is_not_in_group" json:"isNotInGroup"`
	UpdateUnreadCountTime int64  `gorm:"column:update_unread_count_time" json:"updateUnreadCountTime"`
	AttachedInfo          string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"`
	Ex                    string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
}

func (Conversation) TableName

func (Conversation) TableName() string

type DataBases

type DataBases struct {
	MysqlDB mysqlDB

	RDB    go_redis.UniversalClient
	Rc     *rockscache.Client
	WeakRc *rockscache.Client
	// contains filtered or unexported fields
}
var DB DataBases

func (*DataBases) AddGroupMember

func (d *DataBases) AddGroupMember(groupID, uid string) error

func (*DataBases) AddTokenFlag

func (d *DataBases) AddTokenFlag(userID string, platformID int, token string, flag int) error

Store userid and platform class to redis

func (*DataBases) AddUserToSuperGroup

func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) error

func (*DataBases) AddUserToSuperGroups

func (d *DataBases) AddUserToSuperGroups(groupIDList []string, userID string) error

func (*DataBases) BatchInsertChat2Cache

func (d *DataBases) BatchInsertChat2Cache(insertID string, msgList []*pbMsg.MsgDataToMQ, operationID string) (error, uint64)

func (*DataBases) BatchInsertChat2DB

func (d *DataBases) BatchInsertChat2DB(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string, currentMaxSeq uint64) error

func (*DataBases) CleanUpOneUserAllMsgFromRedis

func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID string) error

func (*DataBases) CleanUpUserMsgFromMongo

func (d *DataBases) CleanUpUserMsgFromMongo(userID string, operationID string) error

func (*DataBases) CommentOneWorkMoment

func (d *DataBases) CommentOneWorkMoment(comment *Comment, workMomentID string) (WorkMoment, error)

func (*DataBases) CreateExtendMsgSet

func (d *DataBases) CreateExtendMsgSet(set *ExtendMsgSet) error

func (*DataBases) CreateOneWorkMoment

func (d *DataBases) CreateOneWorkMoment(workMoment *WorkMoment) error

func (*DataBases) CreateSuperGroup

func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, memberNumCount int) error

func (*DataBases) CreateTag

func (d *DataBases) CreateTag(userID, tagName string, userList []string) error

func (*DataBases) DelFcmToken

func (d *DataBases) DelFcmToken(account string, platformID int) error

func (*DataBases) DelGroupMember

func (d *DataBases) DelGroupMember(groupID, uid string) error

func (*DataBases) DelMongoMsgs

func (d *DataBases) DelMongoMsgs(IDList []string) error

func (*DataBases) DelMsgByIndex

func (d *DataBases) DelMsgByIndex(suffixUserID string, msg *open_im_sdk.MsgData, operationID string, seqIndex int) error

func (*DataBases) DelMsgBySeqList

func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID string) (totalUnExistSeqList []uint32, err error)

deleteMsgByLogic

func (*DataBases) DelMsgBySeqListInOneDoc

func (d *DataBases) DelMsgBySeqListInOneDoc(suffixUserID string, seqList []uint32, operationID string) ([]uint32, error)

func (*DataBases) DelMsgFromCache

func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID string)

func (*DataBases) DelMsgLogic

func (d *DataBases) DelMsgLogic(uid string, seqList []uint32, operationID string) error

deleteMsgByLogic

func (*DataBases) DelUserChat

func (d *DataBases) DelUserChat(uid string) error

func (*DataBases) DelUserChatMongo2

func (d *DataBases) DelUserChatMongo2(uid string) error

func (*DataBases) DelUserSignalList

func (d *DataBases) DelUserSignalList(userID string) error

func (*DataBases) DeleteComment

func (d *DataBases) DeleteComment(workMomentID, contentID, opUserID string) error

func (*DataBases) DeleteMessageFromCache

func (d *DataBases) DeleteMessageFromCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error

func (*DataBases) DeleteOneMessageKey

func (d *DataBases) DeleteOneMessageKey(clientMsgID string, sessionType int32, subKey string) error

func (*DataBases) DeleteOneWorkMoment

func (d *DataBases) DeleteOneWorkMoment(workMomentID string) error

func (*DataBases) DeleteReactionExtendMsgSet

func (d *DataBases) DeleteReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error

delete TypeKey

func (*DataBases) DeleteSuperGroup

func (d *DataBases) DeleteSuperGroup(groupID string) error

func (*DataBases) DeleteTag

func (d *DataBases) DeleteTag(userID, tagID string) error

func (*DataBases) DeleteTokenByUidPid

func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int, fields []string) error

func (*DataBases) GetAccountCode

func (d *DataBases) GetAccountCode(account string) (string, error)

func (*DataBases) GetAllExtendMsgSet

func (d *DataBases) GetAllExtendMsgSet(ID string, opts *GetAllExtendMsgSetOpts) (sets []*ExtendMsgSet, err error)

func (*DataBases) GetAvailableSignalInvitationInfo

func (d *DataBases) GetAvailableSignalInvitationInfo(userID string) (invitationInfo *pbRtc.SignalInviteReq, err error)

func (*DataBases) GetExtendMsg

func (d *DataBases) GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *ExtendMsg, err error)

func (*DataBases) GetExtendMsgSet

func (d *DataBases) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64, c *mongo.Collection) (*ExtendMsgSet, error)

func (*DataBases) GetFcmToken

func (d *DataBases) GetFcmToken(account string, platformID int) (string, error)

func (*DataBases) GetGetuiTaskID

func (d *DataBases) GetGetuiTaskID() (string, error)

func (*DataBases) GetGetuiToken

func (d *DataBases) GetGetuiToken() (string, error)

func (*DataBases) GetGroupMaxSeq

func (d *DataBases) GetGroupMaxSeq(groupID string) (uint64, error)

func (*DataBases) GetGroupMember

func (d *DataBases) GetGroupMember(groupID string) []string

func (*DataBases) GetGroupUserMinSeq

func (d *DataBases) GetGroupUserMinSeq(groupID, userID string) (uint64, error)

func (*DataBases) GetMessageListBySeq

func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error)

func (*DataBases) GetMessageTypeKeyValue

func (d *DataBases) GetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey string) (string, error)

func (*DataBases) GetMinSeqFromMongo

func (d *DataBases) GetMinSeqFromMongo(uid string) (MinSeq uint32, err error)

func (*DataBases) GetMinSeqFromMongo2

func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error)

func (*DataBases) GetMsgAndIndexBySeqListInOneMongo2

func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexList []int, unexistSeqList []uint32, err error)

func (*DataBases) GetMsgBySeqIndex

func (d *DataBases) GetMsgBySeqIndex(uid string, seq uint32, operationID string) (*open_im_sdk.MsgData, error)

func (*DataBases) GetMsgBySeqList

func (d *DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error)

func (*DataBases) GetMsgBySeqListMongo2

func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error)

func (*DataBases) GetNewestMsg

func (d *DataBases) GetNewestMsg(ID string) (msg *open_im_sdk.MsgData, err error)

func (*DataBases) GetOldestMsg

func (d *DataBases) GetOldestMsg(ID string) (msg *open_im_sdk.MsgData, err error)

func (*DataBases) GetOneMessageAllReactionList

func (d *DataBases) GetOneMessageAllReactionList(clientMsgID string, sessionType int32) (map[string]string, error)

func (*DataBases) GetSendMsgStatus

func (d *DataBases) GetSendMsgStatus(operationID string) (int, error)

func (*DataBases) GetSignalInfoFromCacheByClientMsgID

func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error)

func (*DataBases) GetSingleConversationRecvMsgOpt

func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error)

func (*DataBases) GetSuperGroup

func (d *DataBases) GetSuperGroup(groupID string) (SuperGroup, error)

func (*DataBases) GetSuperGroupByUserID

func (d *DataBases) GetSuperGroupByUserID(userID string) (UserToSuperGroup, error)

func (*DataBases) GetSuperGroupMsgBySeqListMongo

func (d *DataBases) GetSuperGroupMsgBySeqListMongo(groupID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexes map[uint32]int, err error)

func (*DataBases) GetSuperGroupUserReceiveNotNotifyMessageIDList

func (d *DataBases) GetSuperGroupUserReceiveNotNotifyMessageIDList(groupID string) ([]string, error)

func (*DataBases) GetTagByID

func (d *DataBases) GetTagByID(userID, tagID string) (Tag, error)

func (*DataBases) GetTagSendLogs

func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32) ([]TagSendLog, error)

func (*DataBases) GetTokenMapByUidPid

func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error)

func (*DataBases) GetUserBadgeUnreadCountSum

func (d *DataBases) GetUserBadgeUnreadCountSum(uid string) (int, error)

func (*DataBases) GetUserFriendWorkMoments

func (d *DataBases) GetUserFriendWorkMoments(showNumber, pageNumber int32, userID string, friendIDList []string) ([]WorkMoment, error)

func (*DataBases) GetUserGlobalMsgRecvOpt

func (d *DataBases) GetUserGlobalMsgRecvOpt(userID string) (int, error)

func (*DataBases) GetUserIDListByTagID

func (d *DataBases) GetUserIDListByTagID(userID, tagID string) ([]string, error)

func (*DataBases) GetUserMaxSeq

func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error)

Get the largest Seq

func (*DataBases) GetUserMinSeq

func (d *DataBases) GetUserMinSeq(uid string) (uint64, error)

Get the smallest Seq

func (*DataBases) GetUserMsgListByIndex

func (d *DataBases) GetUserMsgListByIndex(ID string, index int64) (*UserChat, error)

func (*DataBases) GetUserSelfWorkMoments

func (d *DataBases) GetUserSelfWorkMoments(userID string, showNumber, pageNumber int32) ([]WorkMoment, error)

func (*DataBases) GetUserTags

func (d *DataBases) GetUserTags(userID string) ([]Tag, error)

func (*DataBases) GetUserWorkMoments

func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, pageNumber int32, friendIDList []string) ([]WorkMoment, error)

func (*DataBases) GetWorkMomentByID

func (d *DataBases) GetWorkMomentByID(workMomentID string) (*WorkMoment, error)

func (*DataBases) HandleSignalInfo

func (d *DataBases) HandleSignalInfo(operationID string, msg *pbCommon.MsgData, pushToUserID string) (isSend bool, err error)

func (*DataBases) IncrGroupMaxSeq

func (d *DataBases) IncrGroupMaxSeq(groupID string) (uint64, error)

func (*DataBases) IncrUserBadgeUnreadCountSum

func (d *DataBases) IncrUserBadgeUnreadCountSum(uid string) (int, error)

func (*DataBases) IncrUserSeq

func (d *DataBases) IncrUserSeq(uid string) (uint64, error)

Perform seq auto-increment operation of user messages

func (*DataBases) InsertExtendMsg

func (d *DataBases) InsertExtendMsg(sourceID string, sessionType int32, msg *ExtendMsg) error

first modify msg

func (*DataBases) InsertOrUpdateReactionExtendMsgSet

func (d *DataBases) InsertOrUpdateReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error

insert or update

func (*DataBases) JudgeAccountEXISTS

func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error)

func (*DataBases) JudgeMessageReactionEXISTS

func (d *DataBases) JudgeMessageReactionEXISTS(clientMsgID string, sessionType int32) (bool, error)

func (*DataBases) LikeOneWorkMoment

func (d *DataBases) LikeOneWorkMoment(likeUserID, userName, workMomentID string) (*WorkMoment, bool, error)

func (*DataBases) LockMessageTypeKey

func (d *DataBases) LockMessageTypeKey(clientMsgID string, TypeKey string) error

func (*DataBases) MgoSkipUID

func (d *DataBases) MgoSkipUID(count int) (string, error)

func (*DataBases) MgoUserCount

func (d *DataBases) MgoUserCount() (int, error)

func (*DataBases) RemoveGroupFromUser

func (d *DataBases) RemoveGroupFromUser(ctx, sCtx context.Context, groupID string, userIDList []string) error

func (*DataBases) RemoverUserFromSuperGroup

func (d *DataBases) RemoverUserFromSuperGroup(groupID string, userIDList []string) error

func (*DataBases) ReplaceMsgByIndex

func (d *DataBases) ReplaceMsgByIndex(uid string, msg *open_im_sdk.MsgData, index int) error

func (*DataBases) ReplaceMsgBySeq

func (d *DataBases) ReplaceMsgBySeq(uid string, msg *open_im_sdk.MsgData, operationID string) error

func (*DataBases) ReplaceMsgToBlankByIndex

func (d *DataBases) ReplaceMsgToBlankByIndex(suffixID string, index int) (replaceMaxSeq uint32, err error)

func (*DataBases) SaveTagSendLog

func (d *DataBases) SaveTagSendLog(tagSendLog *TagSendLog) error

func (*DataBases) SaveUserChat

func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error

func (*DataBases) SaveUserChatMongo2

func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error

func (*DataBases) SetAccountCode

func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error)

func (*DataBases) SetFcmToken

func (d *DataBases) SetFcmToken(account string, platformID int, fcmToken string, expireTime int64) (err error)

func (*DataBases) SetGetuiTaskID

func (d *DataBases) SetGetuiTaskID(taskID string, expireTime int64) error

func (*DataBases) SetGetuiToken

func (d *DataBases) SetGetuiToken(token string, expireTime int64) error

func (*DataBases) SetGroupMaxSeq

func (d *DataBases) SetGroupMaxSeq(groupID string, maxSeq uint64) error

func (*DataBases) SetGroupMinSeq

func (d *DataBases) SetGroupMinSeq(groupID string, minSeq uint32) error

func (*DataBases) SetGroupUserMinSeq

func (d *DataBases) SetGroupUserMinSeq(groupID, userID string, minSeq uint64) (err error)

func (*DataBases) SetMessageReactionExpire

func (d *DataBases) SetMessageReactionExpire(clientMsgID string, sessionType int32, expiration time.Duration) (bool, error)

func (*DataBases) SetMessageToCache

func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) (error, int)

func (*DataBases) SetMessageTypeKeyValue

func (d *DataBases) SetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey, value string) error

func (*DataBases) SetSendMsgStatus

func (d *DataBases) SetSendMsgStatus(status int32, operationID string) error

func (*DataBases) SetSingleConversationRecvMsgOpt

func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error

func (*DataBases) SetSuperGroupUserReceiveNotNotifyMessage

func (d *DataBases) SetSuperGroupUserReceiveNotNotifyMessage(groupID, userID string) error

func (*DataBases) SetSuperGroupUserReceiveNotifyMessage

func (d *DataBases) SetSuperGroupUserReceiveNotifyMessage(groupID, userID string) error

func (*DataBases) SetTag

func (d *DataBases) SetTag(userID, tagID, newName string, increaseUserIDList []string, reduceUserIDList []string) error

func (*DataBases) SetTokenMapByUidPid

func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int, m map[string]int) error

func (*DataBases) SetUserBadgeUnreadCountSum

func (d *DataBases) SetUserBadgeUnreadCountSum(uid string, value int) error

func (*DataBases) SetUserGlobalMsgRecvOpt

func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error

func (*DataBases) SetUserMaxSeq

func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error

set the largest Seq

func (*DataBases) SetUserMinSeq

func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error)

Set the user's minimum seq

func (*DataBases) SetUserWorkMomentsLevel

func (d *DataBases) SetUserWorkMomentsLevel(userID string, level int32) error

func (*DataBases) UnLockMessageTypeKey

func (d *DataBases) UnLockMessageTypeKey(clientMsgID string, TypeKey string) error

func (*DataBases) UpdateOneMsgList

func (d *DataBases) UpdateOneMsgList(msg *UserChat) error

type Department

type Department struct {
	DepartmentID   string    `gorm:"column:department_id;primary_key;size:64" json:"departmentID"`
	FaceURL        string    `gorm:"column:face_url;size:255" json:"faceURL"`
	Name           string    `gorm:"column:name;size:256" json:"name" binding:"required"`
	ParentID       string    `gorm:"column:parent_id;size:64" json:"parentID" binding:"required"` // "0" or Real parent id
	Order          int32     `gorm:"column:order" json:"order" `                                  // 1, 2, ...
	DepartmentType int32     `gorm:"column:department_type" json:"departmentType"`                //1, 2...
	RelatedGroupID string    `gorm:"column:related_group_id;size:64" json:"relatedGroupID"`
	CreateTime     time.Time `gorm:"column:create_time" json:"createTime"`
	Ex             string    `gorm:"column:ex;type:varchar(1024)" json:"ex"`
}

func (Department) TableName

func (Department) TableName() string

type DepartmentMember

type DepartmentMember struct {
	UserID       string    `gorm:"column:user_id;primary_key;size:64"`
	DepartmentID string    `gorm:"column:department_id;primary_key;size:64"`
	Order        int32     `gorm:"column:order" json:"order"` //1,2
	Position     string    `gorm:"column:position;size:256" json:"position"`
	Leader       int32     `gorm:"column:leader" json:"leader"` //-1, 1
	Status       int32     `gorm:"column:status" json:"status"` //-1, 1
	CreateTime   time.Time `gorm:"column:create_time"`
	Ex           string    `gorm:"column:ex;type:varchar(1024)" json:"ex"`
}

func (DepartmentMember) TableName

func (DepartmentMember) TableName() string

type ExtendMsg

type ExtendMsg struct {
	ReactionExtensionList map[string]KeyValue `bson:"reaction_extension_list" json:"reactionExtensionList"`
	ClientMsgID           string              `bson:"client_msg_id" json:"clientMsgID"`
	MsgFirstModifyTime    int64               `bson:"msg_first_modify_time" json:"msgFirstModifyTime"` // this extendMsg create time
	AttachedInfo          string              `bson:"attached_info" json:"attachedInfo"`
	Ex                    string              `bson:"ex" json:"ex"`
}

type ExtendMsgSet

type ExtendMsgSet struct {
	SourceID         string               `bson:"source_id" json:"sourceID"`
	SessionType      int32                `bson:"session_type" json:"sessionType"`
	ExtendMsgs       map[string]ExtendMsg `bson:"extend_msgs" json:"extendMsgs"`
	ExtendMsgNum     int32                `bson:"extend_msg_num" json:"extendMsgNum"`
	CreateTime       int64                `bson:"create_time" json:"createTime"`               // this block's create time
	MaxMsgUpdateTime int64                `bson:"max_msg_update_time" json:"maxMsgUpdateTime"` // index find msg
}

type Friend

type Friend struct {
	OwnerUserID    string    `gorm:"column:owner_user_id;primary_key;size:64"`
	FriendUserID   string    `gorm:"column:friend_user_id;primary_key;size:64"`
	Remark         string    `gorm:"column:remark;size:255"`
	CreateTime     time.Time `gorm:"column:create_time"`
	AddSource      int32     `gorm:"column:add_source"`
	OperatorUserID string    `gorm:"column:operator_user_id;size:64"`
	Ex             string    `gorm:"column:ex;size:1024"`
}

message FriendInfo{ string OwnerUserID = 1; string Remark = 2; int64 CreateTime = 3; UserInfo FriendUser = 4; int32 AddSource = 5; string OperatorUserID = 6; string Ex = 7; } open_im_sdk.FriendInfo(FriendUser) != imdb.Friend(FriendUserID)

type FriendRequest

type FriendRequest struct {
	FromUserID    string    `gorm:"column:from_user_id;primary_key;size:64"`
	ToUserID      string    `gorm:"column:to_user_id;primary_key;size:64"`
	HandleResult  int32     `gorm:"column:handle_result"`
	ReqMsg        string    `gorm:"column:req_msg;size:255"`
	CreateTime    time.Time `gorm:"column:create_time"`
	HandlerUserID string    `gorm:"column:handler_user_id;size:64"`
	HandleMsg     string    `gorm:"column:handle_msg;size:255"`
	HandleTime    time.Time `gorm:"column:handle_time"`
	Ex            string    `gorm:"column:ex;size:1024"`
}

message FriendRequest{ string FromUserID = 1; string ToUserID = 2; int32 HandleResult = 3; string ReqMsg = 4; int64 CreateTime = 5; string HandlerUserID = 6; string HandleMsg = 7; int64 HandleTime = 8; string Ex = 9; } open_im_sdk.FriendRequest(nickname, farce url ...) != imdb.FriendRequest

func (FriendRequest) TableName

func (FriendRequest) TableName() string

type GetAllExtendMsgSetOpts

type GetAllExtendMsgSetOpts struct {
	ExcludeExtendMsgs bool
}

type Group

type Group struct {
	//`json:"operationID" binding:"required"`
	//`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"`
	GroupID                string    `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`
	GroupName              string    `gorm:"column:name;size:255" json:"groupName"`
	Notification           string    `gorm:"column:notification;size:255" json:"notification"`
	Introduction           string    `gorm:"column:introduction;size:255" json:"introduction"`
	FaceURL                string    `gorm:"column:face_url;size:255" json:"faceURL"`
	CreateTime             time.Time `gorm:"column:create_time;index:create_time"`
	Ex                     string    `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
	Status                 int32     `gorm:"column:status"`
	CreatorUserID          string    `gorm:"column:creator_user_id;size:64"`
	GroupType              int32     `gorm:"column:group_type"`
	NeedVerification       int32     `gorm:"column:need_verification"`
	LookMemberInfo         int32     `gorm:"column:look_member_info" json:"lookMemberInfo"`
	ApplyMemberFriend      int32     `gorm:"column:apply_member_friend" json:"applyMemberFriend"`
	NotificationUpdateTime time.Time `gorm:"column:notification_update_time"`
	NotificationUserID     string    `gorm:"column:notification_user_id;size:64"`
}
message GroupInfo{
 string GroupID = 1;
 string GroupName = 2;
 string Notification = 3;
 string Introduction = 4;
 string FaceUrl = 5;
 string OwnerUserID = 6;
 uint32 MemberCount = 8;
 int64 CreateTime = 7;
 string Ex = 9;
 int32 Status = 10;
 string CreatorUserID = 11;
 int32 GroupType = 12;
}
open_im_sdk.GroupInfo (OwnerUserID ,  MemberCount )> imdb.Group

type GroupMember

type GroupMember struct {
	GroupID        string    `gorm:"column:group_id;primary_key;size:64"`
	UserID         string    `gorm:"column:user_id;primary_key;size:64"`
	Nickname       string    `gorm:"column:nickname;size:255"`
	FaceURL        string    `gorm:"column:user_group_face_url;size:255"`
	RoleLevel      int32     `gorm:"column:role_level"`
	JoinTime       time.Time `gorm:"column:join_time"`
	JoinSource     int32     `gorm:"column:join_source"`
	InviterUserID  string    `gorm:"column:inviter_user_id;size:64"`
	OperatorUserID string    `gorm:"column:operator_user_id;size:64"`
	MuteEndTime    time.Time `gorm:"column:mute_end_time"`
	Ex             string    `gorm:"column:ex;size:1024"`
}

message GroupMemberFullInfo { string GroupID = 1 ; string UserID = 2 ; int32 roleLevel = 3; int64 JoinTime = 4; string NickName = 5; string FaceUrl = 6; int32 JoinSource = 8; string OperatorUserID = 9; string Ex = 10; int32 AppMangerLevel = 7; //if >0 } open_im_sdk.GroupMemberFullInfo(AppMangerLevel) > imdb.GroupMember

type GroupMember_x

type GroupMember_x struct {
	GroupID string
	UIDList []string
}

type GroupRequest

type GroupRequest struct {
	UserID        string    `gorm:"column:user_id;primary_key;size:64"`
	GroupID       string    `gorm:"column:group_id;primary_key;size:64"`
	HandleResult  int32     `gorm:"column:handle_result"`
	ReqMsg        string    `gorm:"column:req_msg;size:1024"`
	HandledMsg    string    `gorm:"column:handle_msg;size:1024"`
	ReqTime       time.Time `gorm:"column:req_time"`
	HandleUserID  string    `gorm:"column:handle_user_id;size:64"`
	HandledTime   time.Time `gorm:"column:handle_time"`
	JoinSource    int32     `gorm:"column:join_source"`
	InviterUserID string    `gorm:"column:inviter_user_id;size:64"`
	Ex            string    `gorm:"column:ex;size:1024"`
}

message GroupRequest{ string UserID = 1; string GroupID = 2; string HandleResult = 3; string ReqMsg = 4; string HandleMsg = 5; int64 ReqTime = 6; string HandleUserID = 7; int64 HandleTime = 8; string Ex = 9; }open_im_sdk.GroupRequest == imdb.GroupRequest

type Invitation

type Invitation struct {
	InvitationCode string    `gorm:"column:invitation_code;primary_key;type:varchar(32)"`
	CreateTime     time.Time `gorm:"column:create_time"`
	UserID         string    `gorm:"column:user_id;index:userID"`
	LastTime       time.Time `gorm:"column:last_time"`
	Status         int32     `gorm:"column:status"`
}

type IpLimit

type IpLimit struct {
	Ip            string    `gorm:"column:ip;primary_key;size:15"`
	LimitRegister int32     `gorm:"column:limit_register;size:1"`
	LimitLogin    int32     `gorm:"column:limit_login;size:1"`
	CreateTime    time.Time `gorm:"column:create_time"`
	LimitTime     time.Time `gorm:"column:limit_time"`
}

ip limit login

type KeyValue

type KeyValue struct {
	TypeKey          string `bson:"type_key" json:"typeKey"`
	Value            string `bson:"value" json:"value"`
	LatestUpdateTime int64  `bson:"latest_update_time" json:"latestUpdateTime"`
}

type MsgInfo

type MsgInfo struct {
	SendTime int64
	Msg      []byte
}

type OrganizationUser

type OrganizationUser struct {
	UserID      string    `gorm:"column:user_id;primary_key;size:64"`
	Nickname    string    `gorm:"column:nickname;size:256"`
	EnglishName string    `gorm:"column:english_name;size:256"`
	FaceURL     string    `gorm:"column:face_url;size:256"`
	Gender      int32     `gorm:"column:gender"` //1 ,2
	Mobile      string    `gorm:"column:mobile;size:32"`
	Telephone   string    `gorm:"column:telephone;size:32"`
	Birth       time.Time `gorm:"column:birth"`
	Email       string    `gorm:"column:email;size:64"`
	CreateTime  time.Time `gorm:"column:create_time"`
	Ex          string    `gorm:"column:ex;size:1024"`
}

func (OrganizationUser) TableName

func (OrganizationUser) TableName() string

type RedisClient

type RedisClient struct {
	go_redis.UniversalClient
	// contains filtered or unexported fields
}

type Register

type Register struct {
	Account        string `gorm:"column:account;primary_key;type:char(255)" json:"account"`
	Password       string `gorm:"column:password;type:varchar(255)" json:"password"`
	Ex             string `gorm:"column:ex;size:1024" json:"ex"`
	UserID         string `gorm:"column:user_id;type:varchar(255)" json:"userID"`
	AreaCode       string `gorm:"column:area_code;type:varchar(255)"`
	InvitationCode string `gorm:"column:invitation_code;type:varchar(255)"`
	RegisterIP     string `gorm:"column:register_ip;type:varchar(255)"`
}

type RegisterAddFriend

type RegisterAddFriend struct {
	UserID string `gorm:"column:user_id;primary_key;size:64"`
}

func (RegisterAddFriend) TableName

func (RegisterAddFriend) TableName() string

type SuperGroup

type SuperGroup struct {
	GroupID string `bson:"group_id" json:"groupID"`
	//MemberNumCount int      `bson:"member_num_count"`
	MemberIDList []string `bson:"member_id_list" json:"memberIDList"`
}

type Tag

type Tag struct {
	UserID   string   `bson:"user_id"`
	TagID    string   `bson:"tag_id"`
	TagName  string   `bson:"tag_name"`
	UserList []string `bson:"user_list"`
}

type TagSendLog

type TagSendLog struct {
	UserList         []TagUser `bson:"tag_list"`
	SendID           string    `bson:"send_id"`
	SenderPlatformID int32     `bson:"sender_platform_id"`
	Content          string    `bson:"content"`
	SendTime         int64     `bson:"send_time"`
}

type TagUser

type TagUser struct {
	UserID   string `bson:"user_id"`
	UserName string `bson:"user_name"`
}

type User

type User struct {
	UserID           string    `gorm:"column:user_id;primary_key;size:64"`
	Nickname         string    `gorm:"column:name;size:255"`
	FaceURL          string    `gorm:"column:face_url;size:255"`
	Gender           int32     `gorm:"column:gender"`
	PhoneNumber      string    `gorm:"column:phone_number;size:32"`
	Birth            time.Time `gorm:"column:birth"`
	Email            string    `gorm:"column:email;size:64"`
	Ex               string    `gorm:"column:ex;size:1024"`
	CreateTime       time.Time `gorm:"column:create_time;index:create_time"`
	AppMangerLevel   int32     `gorm:"column:app_manger_level"`
	GlobalRecvMsgOpt int32     `gorm:"column:global_recv_msg_opt"`
	// contains filtered or unexported fields
}

string UserID = 1; string Nickname = 2; string FaceUrl = 3; int32 Gender = 4; string PhoneNumber = 5; string Birth = 6; string Email = 7; string Ex = 8; string CreateIp = 9; int64 CreateTime = 10; int32 AppMangerLevel = 11; open_im_sdk.User == imdb.User

type UserChat

type UserChat struct {
	UID string
	//ListIndex int `bson:"index"`
	Msg []MsgInfo
}

type UserIpLimit

type UserIpLimit struct {
	UserID     string    `gorm:"column:user_id;primary_key;size:64"`
	Ip         string    `gorm:"column:ip;primary_key;size:15"`
	CreateTime time.Time `gorm:"column:create_time"`
}

ip login

type UserIpRecord

type UserIpRecord struct {
	UserID        string    `gorm:"column:user_id;primary_key;size:64"`
	CreateIp      string    `gorm:"column:create_ip;size:15"`
	LastLoginTime time.Time `gorm:"column:last_login_time"`
	LastLoginIp   string    `gorm:"column:last_login_ip;size:15"`
	LoginTimes    int32     `gorm:"column:login_times"`
}

type UserToSuperGroup

type UserToSuperGroup struct {
	UserID      string   `bson:"user_id" json:"userID"`
	GroupIDList []string `bson:"group_id_list" json:"groupIDList"`
}

type WorkMoment

type WorkMoment struct {
	WorkMomentID         string            `bson:"work_moment_id"`
	UserID               string            `bson:"user_id"`
	UserName             string            `bson:"user_name"`
	FaceURL              string            `bson:"face_url"`
	Content              string            `bson:"content"`
	LikeUserList         []*WorkMomentUser `bson:"like_user_list"`
	AtUserList           []*WorkMomentUser `bson:"at_user_list"`
	PermissionUserList   []*WorkMomentUser `bson:"permission_user_list"`
	Comments             []*Comment        `bson:"comments"`
	PermissionUserIDList []string          `bson:"permission_user_id_list"`
	Permission           int32             `bson:"permission"`
	CreateTime           int32             `bson:"create_time"`
}

type WorkMomentUser

type WorkMomentUser struct {
	UserID   string `bson:"user_id"`
	UserName string `bson:"user_name"`
}

type Writer

type Writer struct{}

func (Writer) Printf

func (w Writer) Printf(format string, args ...interface{})

Directories

Path Synopsis
mysql_model
im_mysql_msg_model
** description("").
** description("").

Jump to

Keyboard shortcuts

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