Documentation
¶
Index ¶
- Constants
- type Account
- type Contact
- type ContactApply
- type ContactGroup
- type Emoticon
- type EmoticonItem
- type Group
- type GroupApply
- type GroupCreate
- type GroupInvite
- type GroupMember
- type GroupMemberRemove
- type GroupNotice
- type GroupUpdate
- type InviteRecord
- type Note
- type NoteAnnex
- type NoteClass
- type NoteCreate
- type NoteDetail
- type NoteEdit
- type NoteList
- type NoteTag
- type RemoveRecord
- type Robot
- type SearchOvert
- type SplitUpload
- type TalkRecordExtraForward
- type TalkRecords
- type TalkRecordsDelete
- type TalkRecordsQuery
- type TalkRecordsVote
- type TalkRecordsVoteAnswer
- type TalkSession
- type TalkSessionCreate
- type TalkSessionDisturb
- type TalkSessionOpenContext
- type TalkSessionTop
- type User
- type UserEmoticon
- type Vip
Constants ¶
View Source
const ( CONTACT_COLLECTION = "contact" CONTACT_APPLY_COLLECTION = "contact_apply" CONTACT_GROUP_COLLECTION = "contact_group" )
View Source
const ( EMOTICON_COLLECTION = "emoticon" EMOTICON_ITEM_COLLECTION = "emoticon_item" USER_EMOTICON_COLLECTION = "user_emoticon" )
View Source
const ( GROUP_COLLECTION = "group" GROUP_MEMBER_COLLECTION = "group_member" GROUP_APPLY_COLLECTION = "group_apply" GROUP_NOTICE_COLLECTION = "group_notice" )
View Source
const ( NOTE_COLLECTION = "note" NOTE_DETAIL_COLLECTION = "note_detail" NOTE_CLASS_COLLECTION = "note_class" NOTE_TAG_COLLECTION = "note_tag" NOTE_ANNEX_COLLECTION = "note_annex" )
View Source
const ( TALK_SESSION_COLLECTION = "talk_session" TALK_RECORDS_COLLECTION = "talk_records" TALK_RECORDS_VOTE_COLLECTION = "talk_records_vote" TALK_RECORDS_VOTE_ANSWER_COLLECTION = "talk_records_vote_answer" TALK_RECORDS_DELETE_COLLECTION = "talk_records_delete" )
View Source
const ( USER_COLLECTION = "user" ACCOUNT_COLLECTION = "account" )
View Source
const ( VIP_COLLECTION = "vip" INVITE_RECORD_COLLECTION = "invite_record" )
View Source
const (
ROBOT_COLLECTION = "robot"
)
View Source
const (
SPLIT_UPLOAD_COLLECTION = "split_upload"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { gmeta.Meta `collection:"account" bson:"-"` Uid string `bson:"uid,omitempty"` // 用户主键ID UserId int `bson:"user_id,omitempty"` // 用户ID Account string `bson:"account,omitempty"` // 账号 Password string `bson:"password,omitempty"` // 密码 Salt string `bson:"salt,omitempty"` // 盐 LastLoginIP string `bson:"last_login_ip"` // 最后登录IP LastLoginTime int64 `bson:"last_login_time"` // 最后登录时间 Status int `bson:"status,omitempty"` // 状态[1:正常;2:禁用;-1:删除] CreatedAt int64 `bson:"created_at,omitempty"` // 注册时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type Contact ¶
type Contact struct { gmeta.Meta `collection:"contact" bson:"-"` UserId int `bson:"user_id,omitempty"` // 用户id FriendId int `bson:"friend_id,omitempty"` // 好友id Remark string `bson:"remark,omitempty"` // 好友的备注 Status int `bson:"status,omitempty"` // 好友状态 [0:否;1:是] GroupId string `bson:"group_id,omitempty"` // 分组id CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type ContactApply ¶
type ContactApply struct { gmeta.Meta `collection:"contact_apply" bson:"-"` UserId int `bson:"user_id,omitempty"` // 申请人ID Nickname string `bson:"nickname,omitempty"` // 申请人昵称 Avatar string `bson:"avatar,omitempty"` // 申请人头像地址 FriendId int `bson:"friend_id,omitempty"` // 被申请人 Remark string `bson:"remark,omitempty"` // 申请备注 CreatedAt int64 `bson:"created_at,omitempty"` // 申请时间 }
type ContactGroup ¶
type ContactGroup struct { gmeta.Meta `collection:"contact_group" bson:"-"` UserId int `bson:"user_id"` // 用户ID Name string `bson:"name"` // 分组名称 Count int `json:"count"` // 成员总数 Sort int `bson:"sort"` // 分组名称 CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 }
好友分组
type EmoticonItem ¶
type EmoticonItem struct { gmeta.Meta `collection:"emoticon_item" bson:"-"` EmoticonId string `bson:"emoticon_id"` // 表情分组ID UserId int `bson:"user_id"` // 用户ID(0: 代码系统表情包) Describe string `bson:"describe"` // 表情描述 Url string `bson:"url"` // 图片链接 FileSuffix string `bson:"file_suffix"` // 文件后缀名 FileSize int `bson:"file_size"` // 文件大小(单位字节) CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 }
type Group ¶
type Group struct { gmeta.Meta `collection:"group" bson:"-"` GroupId int `bson:"group_id,omitempty"` // 群聊ID Type int `bson:"type,omitempty"` // 群类型[1:普通群;2:企业群;] CreatorId int `bson:"creator_id,omitempty"` // 创建者ID(群主ID) Name string `bson:"group_name,omitempty"` // 群名称 Profile string `bson:"profile,omitempty"` // 群介绍 IsDismiss int `bson:"is_dismiss,omitempty"` // 是否已解散[0:否;1:是;] Avatar string `bson:"avatar,omitempty"` // 群头像 MaxNum int `bson:"max_num,omitempty"` // 最大群成员数量 IsOvert int `bson:"is_overt,omitempty"` // 是否公开可见[0:否;1:是;] IsMute int `bson:"is_mute,omitempty"` // 是否全员禁言 [0:否;1:是;], 提示:不包含群主或管理员 CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type GroupApply ¶
type GroupApply struct { gmeta.Meta `collection:"group_apply" bson:"-"` GroupId int `bson:"group_id"` // 群聊ID UserId int `bson:"user_id"` // 用户ID Status int `bson:"status"` // 申请状态 Remark string `bson:"remark"` // 备注信息 Reason string `bson:"reason"` // 拒绝原因 CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 }
type GroupCreate ¶
type GroupInvite ¶
type GroupMember ¶
type GroupMember struct { gmeta.Meta `collection:"group_member" bson:"-"` GroupId int `bson:"group_id,omitempty"` // 群聊ID UserId int `bson:"user_id,omitempty"` // 用户ID Leader int `bson:"leader"` // 成员属性[0:普通成员;1:管理员;2:群主;] UserCard string `bson:"user_card,omitempty"` // 群名片 IsQuit int `bson:"is_quit"` // 是否退群[0:否;1:是;] IsMute int `bson:"is_mute"` // 是否禁言[0:否;1:是;] MinRecordId int `bson:"min_record_id,omitempty"` // 可查看历史记录最小ID JoinTime int64 `bson:"join_time,omitempty"` // 入群时间 CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type GroupMemberRemove ¶
type GroupNotice ¶
type GroupNotice struct { gmeta.Meta `collection:"group_notice" bson:"-"` GroupId int `bson:"group_id"` // 群聊ID CreatorId int `bson:"creator_id"` // 创建者用户ID Title string `bson:"title"` // 公告标题 Content string `bson:"content"` // 公告内容 ConfirmUsers string `bson:"confirm_users"` // 已确认成员 IsDelete int `bson:"is_delete"` // 是否删除[0:否;1:是;] IsTop int `bson:"is_top"` // 是否置顶[0:否;1:是;] IsConfirm int `bson:"is_confirm"` // 是否需群成员确认公告[0:否;1:是;] CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 DeletedAt int64 `bson:"deleted_at"` // 删除时间 }
type GroupUpdate ¶
type InviteRecord ¶ added in v1.1.0
type InviteRecord struct { gmeta.Meta `collection:"invite_record" bson:"-"` Id string `bson:"_id,omitempty"` // ID Nickname string `bson:"nickname,omitempty"` // 用户昵称 Email string `bson:"email,omitempty"` // 用户邮箱 CreatedAt int64 `bson:"created_at,omitempty"` // 注册时间 Inviter int `bson:"inviter,omitempty"` // 用户ID }
type Note ¶
type Note struct { gmeta.Meta `collection:"note" bson:"-"` UserId int `bson:"user_id,omitempty"` // 用户ID ClassId string `bson:"class_id,omitempty"` // 分类ID TagsId string `bson:"tags_id,omitempty"` // 笔记关联标签 Title string `bson:"title,omitempty"` // 笔记标题 Abstract string `bson:"abstract,omitempty"` // 笔记摘要 Image string `bson:"image,omitempty"` // 笔记首图 IsAsterisk int `bson:"is_asterisk,omitempty"` // 是否星标笔记[0:否;1:是;] Status int `bson:"status,omitempty"` // 笔记状态[1:正常;2:已删除;] CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 DeletedAt int64 `bson:"deleted_at,omitempty"` // 删除时间 }
type NoteAnnex ¶
type NoteAnnex struct { gmeta.Meta `collection:"note_annex" bson:"-"` UserId int `bson:"user_id,omitempty"` // 上传文件的用户ID NoteId string `bson:"note_id,omitempty"` // 笔记ID Drive int `bson:"drive,omitempty"` // 文件驱动[1:local;2:cos;] Suffix string `bson:"suffix,omitempty"` // 文件后缀名 Size int `bson:"size,omitempty"` // 文件大小 Path string `bson:"path,omitempty"` // 文件地址(相对地址) OriginalName string `bson:"original_name,omitempty"` // 原文件名 Status int `bson:"status,omitempty"` // 附件状态[1:正常;2:已删除;] CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 DeletedAt int64 `bson:"deleted_at,omitempty"` // 删除时间 }
type NoteClass ¶
type NoteClass struct { gmeta.Meta `collection:"note_class" bson:"-"` UserId int `bson:"user_id,omitempty"` // 用户ID ClassName string `bson:"class_name,omitempty"` // 分类名 Sort int `bson:"sort,omitempty"` // 排序 IsDefault int `bson:"is_default,omitempty"` // 默认分类[0:否;1:是;] CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type NoteCreate ¶
type NoteDetail ¶
type NoteTag ¶
type NoteTag struct { gmeta.Meta `collection:"note_tag" bson:"-"` UserId int `bson:"user_id,omitempty"` // 用户ID TagName string `bson:"tag_name,omitempty"` // 标签名 Sort int `bson:"sort,omitempty"` // 排序 CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type RemoveRecord ¶
type Robot ¶
type Robot struct { gmeta.Meta `collection:"robot" bson:"-"` UserId int `bson:"user_id,omitempty"` // 绑定的用户ID IsTalk int `bson:"is_talk,omitempty"` // 是否可发送消息[0:否;1:是;] Type int `bson:"type,omitempty"` // 机器人类型 Status int `bson:"status,omitempty"` // 状态[-1:已删除;0:正常;1:已禁用;] Corp string `bson:"corp,omitempty"` // 公司 Model string `bson:"model,omitempty"` // 模型 ModelType string `bson:"model_type,omitempty"` // 模型类型, 文生文: text, 画图: image Role string `bson:"role,omitempty"` // 角色 Prompt string `bson:"prompt,omitempty"` // 提示 Proxy string `bson:"proxy,omitempty"` // 代理 Key string `bson:"key,omitempty"` // 密钥 CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type SplitUpload ¶
type SplitUpload struct { gmeta.Meta `collection:"split_upload" bson:"-"` Type int `bson:"type"` // 文件属性[1:合并文件;2:拆分文件] Drive int `bson:"drive"` // 驱动类型[1:local;2:cos;] UploadId string `bson:"upload_id"` // 临时文件hash名 UserId int `bson:"user_id"` // 上传的用户ID OriginalName string `bson:"original_name"` // 原文件名 SplitIndex int `bson:"split_index"` // 当前索引块 SplitNum int `bson:"split_num"` // 总上传索引块 Path string `bson:"path"` // 临时保存路径 FileExt string `bson:"file_ext"` // 文件后缀名 FileSize int64 `bson:"file_size"` // 文件大小 IsDelete int `bson:"is_delete"` // 文件是否删除[0:否;1:是;] Attr string `bson:"attr"` // 额外参数json CreatedAt int64 `bson:"created_at"` // 更新时间 UpdatedAt int64 `bson:"updated_at"` // 创建时间 }
type TalkRecordExtraForward ¶
type TalkRecords ¶
type TalkRecords struct { gmeta.Meta `collection:"talk_records" bson:"-"` RecordId int `bson:"record_id"` // 记录ID MsgId string `bson:"msg_id"` // 消息唯一ID Sequence int64 `bson:"sequence"` // 消息时序ID TalkType int `bson:"talk_type"` // 对话类型[1:私聊;2:群聊;] MsgType int `bson:"msg_type"` // 消息类型 UserId int `bson:"user_id"` // 发送者ID[0:系统用户;] ReceiverId int `bson:"receiver_id"` // 接收者ID(用户ID 或 群ID) IsRevoke int `bson:"is_revoke"` // 是否撤回消息[0:否;1:是;] IsMark int `bson:"is_mark"` // 是否重要消息[0:否;1:是;] IsRead int `bson:"is_read"` // 是否已读[0:否;1:是;] QuoteId string `bson:"quote_id"` // 引用消息ID Content string `bson:"content"` // 文本消息 Extra string `bson:"extra"` // 扩展信信息 CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 Sender *model.Sender `json:"sender,omitempty" bson:"sender,omitempty"` // 发送者 Receiver *model.Receiver `json:"receiver,omitempty" bson:"receiver,omitempty"` // 接收者 Mention *model.Mention `json:"mention,omitempty" bson:"mention,omitempty"` Reply *model.Reply `json:"reply,omitempty" bson:"reply,omitempty"` Text *model.Text `json:"text,omitempty" bson:"text,omitempty"` Code *model.Code `json:"code,omitempty" bson:"code,omitempty"` Image *model.Image `json:"image,omitempty" bson:"image,omitempty"` Voice *model.Voice `json:"voice,omitempty" bson:"voice,omitempty"` Video *model.Video `json:"video,omitempty" bson:"video,omitempty"` File *model.File `json:"file,omitempty" bson:"file,omitempty"` Vote *model.Vote `json:"vote,omitempty" bson:"vote,omitempty"` Mixed *model.Mixed `json:"mixed,omitempty" bson:"mixed,omitempty"` Forward *model.Forward `json:"forward,omitempty" bson:"forward,omitempty"` Emoticon *model.Emoticon `json:"emoticon,omitempty" bson:"emoticon,omitempty"` Card *model.Card `json:"card,omitempty" bson:"card,omitempty"` Location *model.Location `json:"location,omitempty" bson:"location,omitempty"` GroupCreate *model.GroupCreate `json:"group_create,omitempty" bson:"group_create,omitempty"` GroupJoin *model.GroupJoin `json:"group_join,omitempty" bson:"group_join,omitempty"` GroupTransfer *model.GroupTransfer `json:"group_transfer,omitempty" bson:"group_transfer,omitempty"` GroupMuted *model.GroupMuted `json:"group_muted,omitempty" bson:"group_muted,omitempty"` GroupCancelMuted *model.GroupCancelMuted `json:"group_cancel_muted,omitempty" bson:"group_cancel_muted,omitempty"` GroupMemberMuted *model.GroupMemberMuted `json:"group_member_muted,omitempty" bson:"group_member_muted,omitempty"` GroupMemberCancelMuted *model.GroupMemberCancelMuted `json:"group_member_cancel_muted,omitempty" bson:"group_member_cancel_muted,omitempty"` GroupDismissed *model.GroupDismissed `json:"group_dismissed,omitempty" bson:"group_dismissed,omitempty"` GroupMemberQuit *model.GroupMemberQuit `json:"group_member_quit,omitempty" bson:"group_member_quit,omitempty"` GroupMemberKicked *model.GroupMemberKicked `json:"group_member_kicked,omitempty" bson:"group_member_kicked,omitempty"` GroupMessageRevoke *model.GroupMessageRevoke `json:"group_message_revoke,omitempty" bson:"group_message_revoke,omitempty"` GroupNotice *model.GroupNotice `json:"group_notice,omitempty" bson:"group_notice,omitempty"` Login *model.Login `json:"login,omitempty" bson:"login,omitempty"` }
type TalkRecordsDelete ¶
type TalkRecordsQuery ¶
type TalkRecordsVote ¶
type TalkRecordsVote struct { gmeta.Meta `collection:"talk_records_vote" bson:"-"` RecordId int `bson:"record_id"` // 消息记录ID UserId int `bson:"user_id"` // 用户ID Title string `bson:"title"` // 投票标题 AnswerMode int `bson:"answer_mode"` // 答题模式[0:单选;1:多选;] AnswerOption string `bson:"answer_option"` // 答题选项 AnswerNum int `bson:"answer_num"` // 应答人数 AnsweredNum int `bson:"answered_num"` // 已答人数 IsAnonymous int `bson:"is_anonymous"` // 匿名投票[0:否;1:是;] Status int `bson:"status"` // 投票状态[0:投票中;1:已完成;] CreatedAt int64 `bson:"created_at"` // 创建时间 UpdatedAt int64 `bson:"updated_at"` // 更新时间 }
type TalkRecordsVoteAnswer ¶
type TalkSession ¶
type TalkSession struct { gmeta.Meta `collection:"talk_session" bson:"-"` TalkType int `bson:"talk_type,omitempty"` // 聊天类型[1:私聊;2:群聊;] UserId int `bson:"user_id,omitempty"` // 用户ID ReceiverId int `bson:"receiver_id,omitempty"` // 接收者ID(用户ID 或 群ID) IsTop int `bson:"is_top"` // 是否置顶[0:否;1:是;] IsDisturb int `bson:"is_disturb"` // 消息免打扰[0:否;1:是;] IsDelete int `bson:"is_delete"` // 是否删除[0:否;1:是;] IsRobot int `bson:"is_robot"` // 是否机器人[0:否;1:是;] CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 IsTalk int `bson:"is_talk,omitempty"` // 是否允许对话[0:否;1:是;] IsOpenContext int `bson:"is_open_context"` // 是否开启上下文[0:是;1:否;] }
type TalkSessionCreate ¶
type TalkSessionDisturb ¶
type TalkSessionOpenContext ¶ added in v1.0.0
type TalkSessionTop ¶
type User ¶
type User struct { gmeta.Meta `collection:"user" bson:"-"` UserId int `bson:"user_id,omitempty"` // 用户ID Nickname string `bson:"nickname,omitempty"` // 昵称 Avatar string `bson:"avatar,omitempty"` // 头像 Gender int `bson:"gender"` // 性别[0:保密;1:男;2:女] Mobile string `bson:"mobile,omitempty"` // 手机号 Email string `bson:"email,omitempty"` // 邮箱 Birthday string `bson:"birthday"` // 生日 Motto string `bson:"motto"` // 座右铭 VipLevel int `bson:"vip_level,omitempty"` // 会员等级 SecretKey string `bson:"secret_key,omitempty"` // 密钥 Status int `bson:"status,omitempty"` // 状态[1:正常;2:禁用;-1:删除] CreatedAt int64 `bson:"created_at,omitempty"` // 注册时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
type UserEmoticon ¶
type Vip ¶ added in v1.1.0
type Vip struct { gmeta.Meta `collection:"vip" bson:"-"` Level int `bson:"level,omitempty"` // 等级 Name string `bson:"name,omitempty"` // 名称 Models []string `bson:"models,omitempty"` // 模型权限 FreeTokens int `bson:"free_tokens,omitempty"` // 免费额度 MinuteLimit int `bson:"minute_limit,omitempty"` // 分钟限额 DailyLimit int `bson:"daily_limit,omitempty"` // 每日限额 Rule entity.Rule `bson:"rule,omitempty"` // 规则 Remark string `bson:"remark,omitempty"` // 备注 Status int `bson:"status,omitempty"` // 状态[1:正常;2:下线;-1:删除] CreatedAt int64 `bson:"created_at,omitempty"` // 创建时间 UpdatedAt int64 `bson:"updated_at,omitempty"` // 更新时间 }
Click to show internal directories.
Click to hide internal directories.