dao

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Account = NewAccountDao()
View Source
var Contact = NewContactDao()
View Source
var ContactGroup = NewContactGroupDao()
View Source
var Emoticon = NewEmoticonDao()
View Source
var Group = NewGroupDao()
View Source
var GroupApply = NewGroupApplyDao()
View Source
var GroupMember = NewGroupMemberDao()
View Source
var GroupNotice = NewGroupNoticeDao()
View Source
var Invite = NewInviteDao()
View Source
var Note = NewNoteDao()
View Source
var NoteAnnex = NewNoteAnnexDao()
View Source
var NoteClass = NewNoteClassDao()
View Source
var NoteDetail = NewNoteDetailDao()
View Source
var NoteTag = NewNoteTagDao()
View Source
var Robot = NewRobotDao()
View Source
var Sequence = NewSequenceDao()
View Source
var SplitUpload = NewSplitUploadDao()
View Source
var TalkRecords = NewTalkRecordsDao()
View Source
var TalkRecordsVote = NewTalkRecordsVoteDao()
View Source
var TalkSession = NewTalkSessionDao()
View Source
var User = NewUserDao()
View Source
var Vip = NewVipDao()

Functions

func Aggregate

func Aggregate(ctx context.Context, database, collection string, pipeline []bson.M, result interface{}) error

func AggregateByPage

func AggregateByPage(ctx context.Context, database, collection, countField string, paging *db.Paging, countPipeline, pipeline []bson.M, result interface{}) error

func CountDocuments

func CountDocuments(ctx context.Context, database, collection string, filter map[string]interface{}) (int64, error)

func DeleteById

func DeleteById(ctx context.Context, database, collection string, id interface{}) error

func DeleteMany

func DeleteMany(ctx context.Context, database, collection string, filter map[string]interface{}) (int64, error)

func DeleteOne

func DeleteOne(ctx context.Context, database, collection string, filter map[string]interface{}) (int64, error)

func Find

func Find(ctx context.Context, database, collection string, filter map[string]interface{}, result interface{}, sortFields ...string) error

func FindById

func FindById(ctx context.Context, database, collection string, id, result interface{}) error

func FindByIds

func FindByIds(ctx context.Context, database, collection string, ids, result interface{}) error

func FindByPage

func FindByPage(ctx context.Context, database, collection string, paging *db.Paging, filter map[string]interface{}, result interface{}, sortFields ...string) error

func FindOne

func FindOne(ctx context.Context, database, collection string, filter map[string]interface{}, result interface{}, sortFields ...string) error

func Insert

func Insert(ctx context.Context, database string, document interface{}) (string, error)

func Inserts

func Inserts(ctx context.Context, database string, documents []interface{}) ([]string, error)

func UpdateById

func UpdateById(ctx context.Context, database, collection string, id, update interface{}, isUpsert ...bool) error

func UpdateMany

func UpdateMany(ctx context.Context, database, collection string, filter map[string]interface{}, update interface{}, isUpsert ...bool) error

func UpdateOne

func UpdateOne(ctx context.Context, database, collection string, filter map[string]interface{}, update interface{}, isUpsert ...bool) error

Types

type AccountDao added in v1.1.0

type AccountDao struct {
	*MongoDB[entity.Account]
}

func NewAccountDao added in v1.1.0

func NewAccountDao(database ...string) *AccountDao

type ContactDao

type ContactDao struct {
	*MongoDB[entity.Contact]
	// contains filtered or unexported fields
}

func NewContactDao

func NewContactDao(database ...string) *ContactDao

func (*ContactDao) Delete

func (d *ContactDao) Delete(ctx context.Context, uid, friendId int) error

删除好友

func (*ContactDao) GetContactIds

func (d *ContactDao) GetContactIds(ctx context.Context, uid int) []int

func (*ContactDao) GetFriendRemark

func (d *ContactDao) GetFriendRemark(ctx context.Context, uid int, friendId int) string

func (*ContactDao) IsFriend

func (d *ContactDao) IsFriend(ctx context.Context, uid int, friendId int, cache bool) bool

判断是否为好友关系

func (*ContactDao) List

func (d *ContactDao) List(ctx context.Context, uid int) ([]*entity.Contact, []*entity.User, error)

好友列表

func (*ContactDao) LoadContactCache

func (d *ContactDao) LoadContactCache(ctx context.Context, uid int) error

func (*ContactDao) MoveGroup

func (d *ContactDao) MoveGroup(ctx context.Context, uid int, friendId int, groupId string) error

func (*ContactDao) Remarks

func (d *ContactDao) Remarks(ctx context.Context, uid int, fids []int) (map[int]string, error)

获取好友备注

func (*ContactDao) SetFriendRemark

func (d *ContactDao) SetFriendRemark(ctx context.Context, uid int, friendId int, remark string) error

func (*ContactDao) UpdateRemark

func (d *ContactDao) UpdateRemark(ctx context.Context, uid int, friendId int, remark string) error

修改好友备注

type ContactGroupDao

type ContactGroupDao struct {
	*MongoDB[entity.ContactGroup]
}

func NewContactGroupDao

func NewContactGroupDao(database ...string) *ContactGroupDao

func (*ContactGroupDao) FindContactGroupList

func (d *ContactGroupDao) FindContactGroupList(ctx context.Context, userId int) ([]*entity.ContactGroup, error)

type EmoticonDao

type EmoticonDao struct {
	*MongoDB[entity.Emoticon]
}

func NewEmoticonDao

func NewEmoticonDao(database ...string) *EmoticonDao

func (*EmoticonDao) AddUserSysEmoticon

func (d *EmoticonDao) AddUserSysEmoticon(ctx context.Context, uid int, emoticonId string) error

func (*EmoticonDao) DeleteCollect

func (d *EmoticonDao) DeleteCollect(ctx context.Context, uid int, ids []int) (int64, error)

删除自定义表情包

func (*EmoticonDao) GetDetailsAll

func (d *EmoticonDao) GetDetailsAll(ctx context.Context, uid int) ([]*entity.EmoticonItem, error)

获取系统表情包分组详情列表

func (*EmoticonDao) GetSystemEmoticonList

func (d *EmoticonDao) GetSystemEmoticonList(ctx context.Context) ([]*entity.Emoticon, error)

获取系统表情包分组列表

func (*EmoticonDao) GetUserInstallIds

func (d *EmoticonDao) GetUserInstallIds(ctx context.Context, uid int) []string

获取用户激活的表情包

func (*EmoticonDao) RemoveUserSysEmoticon

func (d *EmoticonDao) RemoveUserSysEmoticon(ctx context.Context, uid int, emoticonId string) error

type GroupApplyDao

type GroupApplyDao struct {
	*MongoDB[entity.GroupApply]
}

func NewGroupApplyDao

func NewGroupApplyDao(database ...string) *GroupApplyDao

func (*GroupApplyDao) Auth

func (d *GroupApplyDao) Auth(ctx context.Context, applyId string, userId int) bool

func (*GroupApplyDao) Delete

func (d *GroupApplyDao) Delete(ctx context.Context, applyId string, userId int) error

func (*GroupApplyDao) List

func (d *GroupApplyDao) List(ctx context.Context, groupIds []int) ([]*entity.GroupApply, []*entity.User, error)

type GroupDao

type GroupDao struct {
	*MongoDB[entity.Group]
	// contains filtered or unexported fields
}

func NewGroupDao

func NewGroupDao(database ...string) *GroupDao

func (*GroupDao) Create

func (d *GroupDao) Create(ctx context.Context, create *do.GroupCreate) (int, error)

创建群聊

func (*GroupDao) Dismiss

func (d *GroupDao) Dismiss(ctx context.Context, groupId int, uid int) error

解散群聊[群主权限]

func (*GroupDao) FindGroupByGroupId

func (d *GroupDao) FindGroupByGroupId(ctx context.Context, groupId int) (*entity.Group, error)

根据groupId查询群信息

func (*GroupDao) FindGroupListByGroupIds

func (d *GroupDao) FindGroupListByGroupIds(ctx context.Context, groupIds []int) ([]*entity.Group, error)

根据groupIds查询群列表

func (*GroupDao) Invite

func (d *GroupDao) Invite(ctx context.Context, invite *do.GroupInvite) error

邀请加入群聊

func (*GroupDao) List

func (d *GroupDao) List(ctx context.Context, userId int) ([]*entity.Group, []*entity.GroupMember, []*entity.TalkSession, error)

func (*GroupDao) RemoveMember

func (d *GroupDao) RemoveMember(ctx context.Context, remove *do.GroupMemberRemove) error

群成员移除群聊

func (*GroupDao) SearchOvertList

func (d *GroupDao) SearchOvertList(ctx context.Context, overt *do.SearchOvert) ([]*entity.Group, error)

func (*GroupDao) Secede

func (d *GroupDao) Secede(ctx context.Context, groupId int, uid int) error

退出群聊[仅管理员及群成员]

func (*GroupDao) Update

func (d *GroupDao) Update(ctx context.Context, update *do.GroupUpdate) error

更新群信息

type GroupMemberDao

type GroupMemberDao struct {
	*MongoDB[entity.GroupMember]
}

func NewGroupMemberDao

func NewGroupMemberDao(database ...string) *GroupMemberDao

func (*GroupMemberDao) CheckUserGroup

func (d *GroupMemberDao) CheckUserGroup(ctx context.Context, ids []int, userId int) ([]int, error)

func (*GroupMemberDao) CountGroupMemberNum

func (d *GroupMemberDao) CountGroupMemberNum(ctx context.Context, ids []int) ([]*entity.CountGroupMember, error)

func (*GroupMemberDao) CountMemberTotal

func (d *GroupMemberDao) CountMemberTotal(ctx context.Context, gid int) int64

统计群成员总数

func (*GroupMemberDao) FindByUserId

func (d *GroupMemberDao) FindByUserId(ctx context.Context, gid, uid int) (*entity.GroupMember, error)

func (*GroupMemberDao) FindGroupIds

func (d *GroupMemberDao) FindGroupIds(ctx context.Context, userId int) ([]int, error)

func (*GroupMemberDao) FindGroupMemberListByUserId

func (d *GroupMemberDao) FindGroupMemberListByUserId(ctx context.Context, userId int) ([]*entity.GroupMember, error)

func (*GroupMemberDao) GetMemberIds

func (d *GroupMemberDao) GetMemberIds(ctx context.Context, groupId int) []int

获取所有群成员用户ID

func (*GroupMemberDao) GetMemberRemark

func (d *GroupMemberDao) GetMemberRemark(ctx context.Context, groupId int, userId int) string

获取指定群成员的备注信息

func (*GroupMemberDao) GetMembers

func (d *GroupMemberDao) GetMembers(ctx context.Context, groupId int) ([]*entity.GroupMember, []*entity.User, error)

获取群聊成员列表

func (*GroupMemberDao) GetUserGroupIds

func (d *GroupMemberDao) GetUserGroupIds(ctx context.Context, uid int) []int

获取用户所有群ID

func (*GroupMemberDao) Handover

func (d *GroupMemberDao) Handover(ctx context.Context, groupId int, userId int, memberId int) error

交接群主权限

func (*GroupMemberDao) IsLeader

func (d *GroupMemberDao) IsLeader(ctx context.Context, gid, uid int) bool

判断是否是群主或管理员

func (*GroupMemberDao) IsMaster

func (d *GroupMemberDao) IsMaster(ctx context.Context, gid, uid int) bool

判断是否是群主

func (*GroupMemberDao) IsMember

func (d *GroupMemberDao) IsMember(ctx context.Context, gid, uid int, cache bool) bool

检测是属于群成员

func (*GroupMemberDao) SetLeaderStatus

func (d *GroupMemberDao) SetLeaderStatus(ctx context.Context, groupId int, userId int, leader int) error

func (*GroupMemberDao) SetMuteStatus

func (d *GroupMemberDao) SetMuteStatus(ctx context.Context, groupId int, userId int, status int) error

type GroupNoticeDao

type GroupNoticeDao struct {
	*MongoDB[entity.GroupNotice]
}

func NewGroupNoticeDao

func NewGroupNoticeDao(database ...string) *GroupNoticeDao

func (*GroupNoticeDao) GetLatestNotice

func (d *GroupNoticeDao) GetLatestNotice(ctx context.Context, groupId int) (*entity.GroupNotice, error)

获取最新公告

func (*GroupNoticeDao) GetListAll

func (d *GroupNoticeDao) GetListAll(ctx context.Context, groupId int) ([]*entity.GroupNotice, []*entity.User, error)

type IMongoDB

type IMongoDB interface{}

type InviteDao added in v1.1.0

type InviteDao struct {
	*MongoDB[entity.InviteRecord]
}

func NewInviteDao added in v1.1.0

func NewInviteDao(database ...string) *InviteDao

type MongoDB

type MongoDB[T IMongoDB] struct {
	*db.MongoDB
}

func NewMongoDB

func NewMongoDB[T IMongoDB](database, collection string) *MongoDB[T]

func (*MongoDB[T]) Aggregate

func (m *MongoDB[T]) Aggregate(ctx context.Context, pipeline []bson.M, result interface{}) error

func (*MongoDB[T]) AggregateByPage

func (m *MongoDB[T]) AggregateByPage(ctx context.Context, countField string, paging *db.Paging, countPipeline, pipeline []bson.M, result interface{}) error

func (*MongoDB[T]) CountDocuments

func (m *MongoDB[T]) CountDocuments(ctx context.Context, filter map[string]interface{}) (int64, error)

func (*MongoDB[T]) DeleteById

func (m *MongoDB[T]) DeleteById(ctx context.Context, id interface{}) error

func (*MongoDB[T]) DeleteMany

func (m *MongoDB[T]) DeleteMany(ctx context.Context, filter map[string]interface{}) (int64, error)

func (*MongoDB[T]) DeleteOne

func (m *MongoDB[T]) DeleteOne(ctx context.Context, filter map[string]interface{}) (int64, error)

func (*MongoDB[T]) Find

func (m *MongoDB[T]) Find(ctx context.Context, filter map[string]interface{}, sortFields ...string) ([]*T, error)

func (*MongoDB[T]) FindById

func (m *MongoDB[T]) FindById(ctx context.Context, id interface{}) (*T, error)

func (*MongoDB[T]) FindByIds

func (m *MongoDB[T]) FindByIds(ctx context.Context, ids interface{}) ([]*T, error)

func (*MongoDB[T]) FindByPage

func (m *MongoDB[T]) FindByPage(ctx context.Context, paging *db.Paging, filter map[string]interface{}, sortFields ...string) ([]*T, error)

func (*MongoDB[T]) FindOne

func (m *MongoDB[T]) FindOne(ctx context.Context, filter map[string]interface{}, sortFields ...string) (*T, error)

func (*MongoDB[T]) Insert

func (m *MongoDB[T]) Insert(ctx context.Context, document interface{}) (string, error)

func (*MongoDB[T]) Inserts

func (m *MongoDB[T]) Inserts(ctx context.Context, documents []interface{}) ([]string, error)

func (*MongoDB[T]) UpdateById

func (m *MongoDB[T]) UpdateById(ctx context.Context, id, update interface{}, isUpsert ...bool) error

func (*MongoDB[T]) UpdateMany

func (m *MongoDB[T]) UpdateMany(ctx context.Context, filter map[string]interface{}, update interface{}, isUpsert ...bool) error

func (*MongoDB[T]) UpdateOne

func (m *MongoDB[T]) UpdateOne(ctx context.Context, filter map[string]interface{}, update interface{}, isUpsert ...bool) error

type NoteAnnexDao

type NoteAnnexDao struct {
	*MongoDB[entity.NoteAnnex]
	// contains filtered or unexported fields
}

func NewNoteAnnexDao

func NewNoteAnnexDao(database ...string) *NoteAnnexDao

func (*NoteAnnexDao) AnnexList

func (d *NoteAnnexDao) AnnexList(ctx context.Context, uid int, noteId string) ([]*entity.NoteAnnex, error)

func (*NoteAnnexDao) ForeverDelete

func (d *NoteAnnexDao) ForeverDelete(ctx context.Context, uid int, id string) error

永久删除笔记附件

func (*NoteAnnexDao) RecoverList

func (d *NoteAnnexDao) RecoverList(ctx context.Context, uid int) ([]*entity.NoteAnnex, []*entity.Note, error)

func (*NoteAnnexDao) UpdateStatus

func (d *NoteAnnexDao) UpdateStatus(ctx context.Context, uid int, id string, status int) error

更新附件状态

type NoteClassDao

type NoteClassDao struct {
	*MongoDB[entity.NoteClass]
}

func NewNoteClassDao

func NewNoteClassDao(database ...string) *NoteClassDao

func (*NoteClassDao) Create

func (d *NoteClassDao) Create(ctx context.Context, uid int, name string) (string, error)

Create 创建分类

func (*NoteClassDao) Delete

func (d *NoteClassDao) Delete(ctx context.Context, uid int, cid string) error

func (*NoteClassDao) GroupCount

func (d *NoteClassDao) GroupCount(ctx context.Context, uid int) (map[string]int, error)

func (*NoteClassDao) List

func (d *NoteClassDao) List(ctx context.Context, uid int) ([]*entity.NoteClass, error)

分类列表

func (*NoteClassDao) MaxSort

func (d *NoteClassDao) MaxSort(ctx context.Context, uid int) (int, error)

func (*NoteClassDao) MinSort

func (d *NoteClassDao) MinSort(ctx context.Context, uid int) (int, error)

func (*NoteClassDao) SetDefaultClass

func (d *NoteClassDao) SetDefaultClass(ctx context.Context, uid int) error

设置默认分类

func (*NoteClassDao) Sort

func (d *NoteClassDao) Sort(ctx context.Context, uid int, cid string, mode int) error

func (*NoteClassDao) Update

func (d *NoteClassDao) Update(ctx context.Context, uid int, cid, name string) error

type NoteDao

type NoteDao struct {
	*MongoDB[entity.Note]
}

func NewNoteDao

func NewNoteDao(database ...string) *NoteDao

func (*NoteDao) Asterisk

func (d *NoteDao) Asterisk(ctx context.Context, uid int, noteId string, mode int) error

笔记标记星号

func (*NoteDao) Create

func (d *NoteDao) Create(ctx context.Context, create *do.NoteCreate) (string, error)

新建笔记

func (*NoteDao) Detail

func (d *NoteDao) Detail(ctx context.Context, uid int, noteId string) (*entity.Note, *entity.NoteDetail, error)

笔记详情

func (*NoteDao) ForeverDelete

func (d *NoteDao) ForeverDelete(ctx context.Context, uid int, noteId string) error

永久删除笔记

func (*NoteDao) List

func (d *NoteDao) List(ctx context.Context, list *do.NoteList) ([]*entity.Note, []*entity.NoteClass, error)

笔记列表

func (*NoteDao) Move

func (d *NoteDao) Move(ctx context.Context, uid int, noteId, classId string) error

移动笔记分类

func (*NoteDao) Tag

func (d *NoteDao) Tag(ctx context.Context, uid int, noteId string, tags []int) error

更新笔记标签

func (*NoteDao) Update

func (d *NoteDao) Update(ctx context.Context, edit *do.NoteEdit) error

更新笔记信息

func (*NoteDao) UpdateStatus

func (d *NoteDao) UpdateStatus(ctx context.Context, uid int, noteId string, status int) error

修改笔记状态

type NoteDetailDao

type NoteDetailDao struct {
	*MongoDB[entity.NoteDetail]
}

func NewNoteDetailDao

func NewNoteDetailDao(database ...string) *NoteDetailDao

type NoteTagDao

type NoteTagDao struct {
	*MongoDB[entity.NoteTag]
}

func NewNoteTagDao

func NewNoteTagDao(database ...string) *NoteTagDao

func (*NoteTagDao) Create

func (d *NoteTagDao) Create(ctx context.Context, uid int, tag string) (string, error)

func (*NoteTagDao) Delete

func (d *NoteTagDao) Delete(ctx context.Context, uid int, tagId string) error

func (*NoteTagDao) List

func (d *NoteTagDao) List(ctx context.Context, uid int) ([]*entity.NoteTag, map[string]int, error)

func (*NoteTagDao) Update

func (d *NoteTagDao) Update(ctx context.Context, uid int, tagId string, tag string) error

type RobotDao

type RobotDao struct {
	*MongoDB[entity.Robot]
}

func NewRobotDao

func NewRobotDao(database ...string) *RobotDao

func (*RobotDao) GetLoginRobot

func (d *RobotDao) GetLoginRobot(ctx context.Context) (*entity.Robot, error)

获取登录机器的信息

func (*RobotDao) GetRobotByUserId

func (d *RobotDao) GetRobotByUserId(ctx context.Context, userId int) (*entity.Robot, error)

根据绑定userId获取机器人的信息

func (*RobotDao) GetRobotList

func (d *RobotDao) GetRobotList(ctx context.Context, userIds ...int) ([]*entity.Robot, error)

获取机器人列表

func (*RobotDao) GetRobotUserList

func (d *RobotDao) GetRobotUserList(ctx context.Context) ([]*entity.User, error)

获取机器人用户列表

type SequenceDao

type SequenceDao struct {
	*MongoDB[entity.TalkRecords]
	// contains filtered or unexported fields
}

func NewSequenceDao

func NewSequenceDao(database ...string) *SequenceDao

func (*SequenceDao) BatchGet

func (d *SequenceDao) BatchGet(ctx context.Context, userId int, receiverId int, num int64) []int64

BatchGet 批量获取会话间的时序ID

func (*SequenceDao) Get

func (d *SequenceDao) Get(ctx context.Context, userId int, receiverId int) int64

Get 获取会话间的时序ID

type SplitUploadDao

type SplitUploadDao struct {
	*MongoDB[entity.SplitUpload]
}

func NewSplitUploadDao

func NewSplitUploadDao(database ...string) *SplitUploadDao

func (*SplitUploadDao) GetFile

func (d *SplitUploadDao) GetFile(ctx context.Context, uid int, uploadId string) (*entity.SplitUpload, error)

func (*SplitUploadDao) GetSplitList

func (d *SplitUploadDao) GetSplitList(ctx context.Context, uploadId string) ([]*entity.SplitUpload, error)

type TalkRecordsDao

type TalkRecordsDao struct {
	*MongoDB[entity.TalkRecords]
}

func NewTalkRecordsDao

func NewTalkRecordsDao(database ...string) *TalkRecordsDao

func (*TalkRecordsDao) DeleteRecord added in v1.0.0

func (d *TalkRecordsDao) DeleteRecord(ctx context.Context, remove *do.RemoveRecord) error

删除消息记录

func (*TalkRecordsDao) FindByRecordId

func (d *TalkRecordsDao) FindByRecordId(ctx context.Context, recordId int) (*entity.TalkRecords, error)

func (*TalkRecordsDao) GetForwardRecords

func (d *TalkRecordsDao) GetForwardRecords(ctx context.Context, uid, recordId int) ([]*entity.TalkRecords, []*entity.User, error)

获取转发消息记录

func (*TalkRecordsDao) GetTalkRecord

func (d *TalkRecordsDao) GetTalkRecord(ctx context.Context, recordId int) (*entity.TalkRecords, *entity.User, error)

func (*TalkRecordsDao) GetTalkRecords

获取对话消息

func (*TalkRecordsDao) HandleTalkRecords

func (d *TalkRecordsDao) HandleTalkRecords(ctx context.Context, items []*model.TalkRecordsItem) ([]*model.TalkRecordsItem, error)

func (*TalkRecordsDao) SearchTalkRecords

func (d *TalkRecordsDao) SearchTalkRecords()

对话搜索消息

type TalkRecordsVoteDao

type TalkRecordsVoteDao struct {
	*MongoDB[entity.TalkRecordsVote]
	// contains filtered or unexported fields
}

func NewTalkRecordsVoteDao

func NewTalkRecordsVoteDao(database ...string) *TalkRecordsVoteDao

func (*TalkRecordsVoteDao) GetVoteAnswerUser

func (d *TalkRecordsVoteDao) GetVoteAnswerUser(ctx context.Context, vid string) ([]int, error)

func (*TalkRecordsVoteDao) GetVoteStatistics

func (d *TalkRecordsVoteDao) GetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)

func (*TalkRecordsVoteDao) SetVoteAnswerUser

func (d *TalkRecordsVoteDao) SetVoteAnswerUser(ctx context.Context, vid string) ([]int, error)

func (*TalkRecordsVoteDao) SetVoteStatistics

func (d *TalkRecordsVoteDao) SetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)

type TalkSessionDao

type TalkSessionDao struct {
	*MongoDB[entity.TalkSession]
}

func NewTalkSessionDao

func NewTalkSessionDao(database ...string) *TalkSessionDao

func (*TalkSessionDao) BatchAddList

func (d *TalkSessionDao) BatchAddList(ctx context.Context, uid int, values map[string]int)

批量添加会话列表

func (*TalkSessionDao) Create

创建会话列表

func (*TalkSessionDao) Delete

func (d *TalkSessionDao) Delete(ctx context.Context, uid int, id string) error

删除会话

func (*TalkSessionDao) Disturb

func (d *TalkSessionDao) Disturb(ctx context.Context, disturb *do.TalkSessionDisturb) error

会话免打扰

func (*TalkSessionDao) FindBySessionId

func (d *TalkSessionDao) FindBySessionId(ctx context.Context, uid int, receiverId int, talkType int) (string, error)

func (*TalkSessionDao) IsDisturb

func (d *TalkSessionDao) IsDisturb(ctx context.Context, uid int, receiverId int, talkType int) bool

是否开启会话免打扰

func (*TalkSessionDao) List

func (d *TalkSessionDao) List(ctx context.Context, uid int) ([]*entity.TalkSession, []*entity.User, []*entity.Group, error)

func (*TalkSessionDao) OpenContext added in v1.0.0

func (d *TalkSessionDao) OpenContext(ctx context.Context, openContext *do.TalkSessionOpenContext) error

开启/关闭上下文

func (*TalkSessionDao) Top

会话置顶

type UserDao

type UserDao struct {
	*MongoDB[entity.User]
}

func NewUserDao

func NewUserDao(database ...string) *UserDao

func (*UserDao) ChangeAccountById

func (d *UserDao) ChangeAccountById(ctx context.Context, id, account string) error

func (*UserDao) ChangePasswordByUserId

func (d *UserDao) ChangePasswordByUserId(ctx context.Context, userId int, password string) error

func (*UserDao) CreateAccount

func (d *UserDao) CreateAccount(ctx context.Context, account *do.Account) (string, error)

func (*UserDao) FindAccount

func (d *UserDao) FindAccount(ctx context.Context, account string) (*entity.Account, error)

func (*UserDao) FindAccountByUserId

func (d *UserDao) FindAccountByUserId(ctx context.Context, userId int) (*entity.Account, error)

func (*UserDao) FindAccountsByUserId

func (d *UserDao) FindAccountsByUserId(ctx context.Context, userId int) ([]*entity.Account, error)

func (*UserDao) FindUserByAccount

func (d *UserDao) FindUserByAccount(ctx context.Context, account string) (*entity.User, error)

根据账号查询用户

func (*UserDao) FindUserByUserId

func (d *UserDao) FindUserByUserId(ctx context.Context, userId int) (*entity.User, error)

根据userId查询用户

func (*UserDao) FindUserListByUserIds

func (d *UserDao) FindUserListByUserIds(ctx context.Context, userIds []int) ([]*entity.User, error)

根据userIds查询用户列表

func (*UserDao) IsAccountExist

func (d *UserDao) IsAccountExist(ctx context.Context, account string) bool

判断账号是否存在

func (*UserDao) IsEmailExist

func (d *UserDao) IsEmailExist(ctx context.Context, email string) bool

判断邮箱是否存在

func (*UserDao) IsMobileExist

func (d *UserDao) IsMobileExist(ctx context.Context, mobile string) bool

判断手机号是否存在

type VipDao added in v1.1.0

type VipDao struct {
	*MongoDB[entity.Vip]
}

func NewVipDao added in v1.1.0

func NewVipDao(database ...string) *VipDao

Jump to

Keyboard shortcuts

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