model

package
v3.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 1 module, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MsgTableName = "msg"
	OldestList   = 0
	NewestList   = -1
)
View Source
const (
	VersionStateInsert = iota + 1
	VersionStateDelete
	VersionStateUpdate
)
View Source
const (
	VersionGroupChangeID = ""
	VersionSortChangeID  = "____S_O_R_T_I_D____"
)
View Source
const (
	SubscribeUserTableName = "subscribe_user"
)

SubscribeUserTableName collection constant.

Variables

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

Functions

This section is empty.

Types

type Application added in v3.8.2

type Application struct {
	ID         primitive.ObjectID `bson:"_id"`
	Platform   string             `bson:"platform"`
	Hot        bool               `bson:"hot"`
	Version    string             `bson:"version"`
	Url        string             `bson:"url"`
	Text       string             `bson:"text"`
	Force      bool               `bson:"force"`
	Latest     bool               `bson:"latest"`
	CreateTime time.Time          `bson:"create_time"`
}

type Black

type Black struct {
	OwnerUserID    string    `bson:"owner_user_id"`
	BlockUserID    string    `bson:"block_user_id"`
	CreateTime     time.Time `bson:"create_time"`
	AddSource      int32     `bson:"add_source"`
	OperatorUserID string    `bson:"operator_user_id"`
	Ex             string    `bson:"ex"`
}

type Conversation

type Conversation struct {
	OwnerUserID           string    `bson:"owner_user_id"`
	ConversationID        string    `bson:"conversation_id"`
	ConversationType      int32     `bson:"conversation_type"`
	UserID                string    `bson:"user_id"`
	GroupID               string    `bson:"group_id"`
	RecvMsgOpt            int32     `bson:"recv_msg_opt"`
	IsPinned              bool      `bson:"is_pinned"`
	IsPrivateChat         bool      `bson:"is_private_chat"`
	BurnDuration          int32     `bson:"burn_duration"`
	GroupAtType           int32     `bson:"group_at_type"`
	AttachedInfo          string    `bson:"attached_info"`
	Ex                    string    `bson:"ex"`
	MaxSeq                int64     `bson:"max_seq"`
	MinSeq                int64     `bson:"min_seq"`
	CreateTime            time.Time `bson:"create_time"`
	IsMsgDestruct         bool      `bson:"is_msg_destruct"`
	MsgDestructTime       int64     `bson:"msg_destruct_time"`
	LatestMsgDestructTime time.Time `bson:"latest_msg_destruct_time"`
}

type Friend

type Friend struct {
	ID             primitive.ObjectID `bson:"_id"`
	OwnerUserID    string             `bson:"owner_user_id"`
	FriendUserID   string             `bson:"friend_user_id"`
	Remark         string             `bson:"remark"`
	CreateTime     time.Time          `bson:"create_time"`
	AddSource      int32              `bson:"add_source"`
	OperatorUserID string             `bson:"operator_user_id"`
	Ex             string             `bson:"ex"`
	IsPinned       bool               `bson:"is_pinned"`
}

Friend represents the data structure for a friend relationship in MongoDB.

type FriendRequest

type FriendRequest struct {
	FromUserID    string    `bson:"from_user_id"`
	ToUserID      string    `bson:"to_user_id"`
	HandleResult  int32     `bson:"handle_result"`
	ReqMsg        string    `bson:"req_msg"`
	CreateTime    time.Time `bson:"create_time"`
	HandlerUserID string    `bson:"handler_user_id"`
	HandleMsg     string    `bson:"handle_msg"`
	HandleTime    time.Time `bson:"handle_time"`
	Ex            string    `bson:"ex"`
}

type Group

type Group struct {
	GroupID                string    `bson:"group_id"`
	GroupName              string    `bson:"group_name"`
	Notification           string    `bson:"notification"`
	Introduction           string    `bson:"introduction"`
	FaceURL                string    `bson:"face_url"`
	CreateTime             time.Time `bson:"create_time"`
	Ex                     string    `bson:"ex"`
	Status                 int32     `bson:"status"`
	CreatorUserID          string    `bson:"creator_user_id"`
	GroupType              int32     `bson:"group_type"`
	NeedVerification       int32     `bson:"need_verification"`
	LookMemberInfo         int32     `bson:"look_member_info"`
	ApplyMemberFriend      int32     `bson:"apply_member_friend"`
	NotificationUpdateTime time.Time `bson:"notification_update_time"`
	NotificationUserID     string    `bson:"notification_user_id"`
}

type GroupCount

type GroupCount struct {
	GroupID string `bson:"group_id"`
	Count   int64  `bson:"count"`
}

type GroupMember

type GroupMember struct {
	GroupID        string    `bson:"group_id"`
	UserID         string    `bson:"user_id"`
	Nickname       string    `bson:"nickname"`
	FaceURL        string    `bson:"face_url"`
	RoleLevel      int32     `bson:"role_level"`
	JoinTime       time.Time `bson:"join_time"`
	JoinSource     int32     `bson:"join_source"`
	InviterUserID  string    `bson:"inviter_user_id"`
	OperatorUserID string    `bson:"operator_user_id"`
	MuteEndTime    time.Time `bson:"mute_end_time"`
	Ex             string    `bson:"ex"`
}

type GroupRequest

type GroupRequest struct {
	UserID        string    `bson:"user_id"`
	GroupID       string    `bson:"group_id"`
	HandleResult  int32     `bson:"handle_result"`
	ReqMsg        string    `bson:"req_msg"`
	HandledMsg    string    `bson:"handled_msg"`
	ReqTime       time.Time `bson:"req_time"`
	HandleUserID  string    `bson:"handle_user_id"`
	HandledTime   time.Time `bson:"handled_time"`
	JoinSource    int32     `bson:"join_source"`
	InviterUserID string    `bson:"inviter_user_id"`
	Ex            string    `bson:"ex"`
}

type Log

type Log struct {
	LogID        string    `bson:"log_id"`
	Platform     string    `bson:"platform"`
	UserID       string    `bson:"user_id"`
	CreateTime   time.Time `bson:"create_time"`
	Url          string    `bson:"url"`
	FileName     string    `bson:"file_name"`
	SystemType   string    `bson:"system_type"`
	AppFramework string    `bson:"app_framework"`
	Version      string    `bson:"version"`
	Ex           string    `bson:"ex"`
}

type MsgDataModel

type MsgDataModel struct {
	SendID           string            `bson:"send_id"`
	RecvID           string            `bson:"recv_id"`
	GroupID          string            `bson:"group_id"`
	ClientMsgID      string            `bson:"client_msg_id"`
	ServerMsgID      string            `bson:"server_msg_id"`
	SenderPlatformID int32             `bson:"sender_platform_id"`
	SenderNickname   string            `bson:"sender_nickname"`
	SenderFaceURL    string            `bson:"sender_face_url"`
	SessionType      int32             `bson:"session_type"`
	MsgFrom          int32             `bson:"msg_from"`
	ContentType      int32             `bson:"content_type"`
	Content          string            `bson:"content"`
	Seq              int64             `bson:"seq"`
	SendTime         int64             `bson:"send_time"`
	CreateTime       int64             `bson:"create_time"`
	Status           int32             `bson:"status"`
	IsRead           bool              `bson:"is_read"`
	Options          map[string]bool   `bson:"options"`
	OfflinePush      *OfflinePushModel `bson:"offline_push"`
	AtUserIDList     []string          `bson:"at_user_id_list"`
	AttachedInfo     string            `bson:"attached_info"`
	Ex               string            `bson:"ex"`
}

type MsgDocModel

type MsgDocModel struct {
	DocID string          `bson:"doc_id"`
	Msg   []*MsgInfoModel `bson:"msgs"`
}

func (*MsgDocModel) GenExceptionMessageBySeqs

func (*MsgDocModel) GenExceptionMessageBySeqs(seqs []int64) (exceptionMsg []*sdkws.MsgData)

func (*MsgDocModel) GetDocID

func (m *MsgDocModel) GetDocID(conversationID string, seq int64) string

func (*MsgDocModel) GetDocIDSeqsMap

func (m *MsgDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[string][]int64

func (*MsgDocModel) GetMinSeq added in v3.8.3

func (*MsgDocModel) GetMinSeq(index int) int64

func (*MsgDocModel) GetMsgIndex

func (*MsgDocModel) GetMsgIndex(seq int64) int64

func (*MsgDocModel) GetSingleGocMsgNum

func (*MsgDocModel) GetSingleGocMsgNum() int64

func (*MsgDocModel) GetSingleGocMsgNum5000

func (*MsgDocModel) GetSingleGocMsgNum5000() int64

func (*MsgDocModel) IsFull

func (m *MsgDocModel) IsFull() bool

func (*MsgDocModel) TableName

func (*MsgDocModel) TableName() string

type MsgInfoModel

type MsgInfoModel struct {
	Msg     *MsgDataModel `bson:"msg"`
	Revoke  *RevokeModel  `bson:"revoke"`
	DelList []string      `bson:"del_list"`
	IsRead  bool          `bson:"is_read"`
}

type Object

type Object struct {
	Name        string    `bson:"name"`
	UserID      string    `bson:"user_id"`
	Hash        string    `bson:"hash"`
	Engine      string    `bson:"engine"`
	Key         string    `bson:"key"`
	Size        int64     `bson:"size"`
	ContentType string    `bson:"content_type"`
	Group       string    `bson:"group"`
	CreateTime  time.Time `bson:"create_time"`
}

type OfflinePushModel

type OfflinePushModel struct {
	Title         string `bson:"title"`
	Desc          string `bson:"desc"`
	Ex            string `bson:"ex"`
	IOSPushSound  string `bson:"ios_push_sound"`
	IOSBadgeCount bool   `bson:"ios_badge_count"`
}

type RevokeModel

type RevokeModel struct {
	Role     int32  `bson:"role"`
	UserID   string `bson:"user_id"`
	Nickname string `bson:"nickname"`
	Time     int64  `bson:"time"`
}

type SeqConversation

type SeqConversation struct {
	ConversationID string `bson:"conversation_id"`
	MaxSeq         int64  `bson:"max_seq"`
	MinSeq         int64  `bson:"min_seq"`
}

type SeqUser

type SeqUser struct {
	UserID         string `bson:"user_id"`
	ConversationID string `bson:"conversation_id"`
	MinSeq         int64  `bson:"min_seq"`
	MaxSeq         int64  `bson:"max_seq"`
	ReadSeq        int64  `bson:"read_seq"`
}

type SubscribeUser

type SubscribeUser struct {
	UserID     string   `bson:"user_id"      json:"userID"`
	UserIDList []string `bson:"user_id_list" json:"userIDList"`
}

SubscribeUser collection structure.

func (SubscribeUser) TableName

func (SubscribeUser) TableName() string

type User

type User struct {
	UserID           string    `bson:"user_id"`
	Nickname         string    `bson:"nickname"`
	FaceURL          string    `bson:"face_url"`
	Ex               string    `bson:"ex"`
	AppMangerLevel   int32     `bson:"app_manger_level"`
	GlobalRecvMsgOpt int32     `bson:"global_recv_msg_opt"`
	CreateTime       time.Time `bson:"create_time"`
}

func (*User) GetEx

func (u *User) GetEx() string

func (*User) GetFaceURL

func (u *User) GetFaceURL() string

func (*User) GetNickname

func (u *User) GetNickname() string

func (*User) GetUserID

func (u *User) GetUserID() string

type UserCount

type UserCount struct {
	UserID string `bson:"user_id"`
	Count  int64  `bson:"count"`
}

type VersionLog

type VersionLog struct {
	ID         primitive.ObjectID `bson:"_id"`
	DID        string             `bson:"d_id"`
	Logs       []VersionLogElem   `bson:"logs"`
	Version    uint               `bson:"version"`
	Deleted    uint               `bson:"deleted"`
	LastUpdate time.Time          `bson:"last_update"`
	LogLen     int                `bson:"log_len"`
}

func (*VersionLog) DeleteAndChangeIDs

func (v *VersionLog) DeleteAndChangeIDs() (insertIds, deleteIds, updateIds []string)

type VersionLogElem

type VersionLogElem struct {
	EID        string    `bson:"e_id"`
	State      int32     `bson:"state"`
	Version    uint      `bson:"version"`
	LastUpdate time.Time `bson:"last_update"`
}

type VersionLogTable

type VersionLogTable struct {
	ID         primitive.ObjectID `bson:"_id"`
	DID        string             `bson:"d_id"`
	Logs       []VersionLogElem   `bson:"logs"`
	Version    uint               `bson:"version"`
	Deleted    uint               `bson:"deleted"`
	LastUpdate time.Time          `bson:"last_update"`
}

func (*VersionLogTable) VersionLog

func (v *VersionLogTable) VersionLog() *VersionLog

Jump to

Keyboard shortcuts

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