Documentation ¶
Index ¶
- Variables
- func Aggregate(ctx context.Context, database, collection string, pipeline []bson.M, ...) error
- func AggregateByPage(ctx context.Context, database, collection, countField string, ...) error
- func CountDocuments(ctx context.Context, database, collection string, ...) (int64, error)
- func DeleteById(ctx context.Context, database, collection string, id interface{}) error
- func DeleteMany(ctx context.Context, database, collection string, ...) (int64, error)
- func DeleteOne(ctx context.Context, database, collection string, ...) (int64, error)
- func Find(ctx context.Context, database, collection string, ...) error
- func FindById(ctx context.Context, database, collection string, id, result interface{}) error
- func FindByIds(ctx context.Context, database, collection string, ids, result interface{}) error
- func FindByPage(ctx context.Context, database, collection string, paging *db.Paging, ...) error
- func FindOne(ctx context.Context, database, collection string, ...) error
- func Insert(ctx context.Context, database string, document interface{}) (string, error)
- func Inserts(ctx context.Context, database string, documents []interface{}) ([]string, error)
- func UpdateById(ctx context.Context, database, collection string, id, update interface{}, ...) error
- func UpdateMany(ctx context.Context, database, collection string, ...) error
- func UpdateOne(ctx context.Context, database, collection string, ...) error
- type ContactDao
- type GroupDao
- type GroupMemberDao
- type IMongoDB
- type MongoDB
- func (m *MongoDB[T]) Aggregate(ctx context.Context, pipeline []bson.M, result interface{}) error
- func (m *MongoDB[T]) AggregateByPage(ctx context.Context, countField string, paging *db.Paging, ...) error
- func (m *MongoDB[T]) CountDocuments(ctx context.Context, filter map[string]interface{}) (int64, error)
- func (m *MongoDB[T]) DeleteById(ctx context.Context, id interface{}) error
- func (m *MongoDB[T]) DeleteMany(ctx context.Context, filter map[string]interface{}) (int64, error)
- func (m *MongoDB[T]) DeleteOne(ctx context.Context, filter map[string]interface{}) (int64, error)
- func (m *MongoDB[T]) Find(ctx context.Context, filter map[string]interface{}, sortFields ...string) ([]*T, error)
- func (m *MongoDB[T]) FindById(ctx context.Context, id interface{}) (*T, error)
- func (m *MongoDB[T]) FindByIds(ctx context.Context, ids interface{}) ([]*T, error)
- func (m *MongoDB[T]) FindByPage(ctx context.Context, paging *db.Paging, filter map[string]interface{}, ...) ([]*T, error)
- func (m *MongoDB[T]) FindOne(ctx context.Context, filter map[string]interface{}, sortFields ...string) (*T, error)
- func (m *MongoDB[T]) Insert(ctx context.Context, document interface{}) (string, error)
- func (m *MongoDB[T]) Inserts(ctx context.Context, documents []interface{}) ([]string, error)
- func (m *MongoDB[T]) UpdateById(ctx context.Context, id, update interface{}, isUpsert ...bool) error
- func (m *MongoDB[T]) UpdateMany(ctx context.Context, filter map[string]interface{}, update interface{}, ...) error
- func (m *MongoDB[T]) UpdateOne(ctx context.Context, filter map[string]interface{}, update interface{}, ...) error
- type RobotDao
- func (d *RobotDao) GetLoginRobot(ctx context.Context) (*entity.Robot, error)
- func (d *RobotDao) GetRobotByUserId(ctx context.Context, userId int) (*entity.Robot, error)
- func (d *RobotDao) GetRobotList(ctx context.Context, userIds ...int) ([]*entity.Robot, error)
- func (d *RobotDao) GetRobotUserList(ctx context.Context) ([]*entity.User, error)
- type SequenceDao
- type TalkRecordsDao
- func (d *TalkRecordsDao) FindByRecordId(ctx context.Context, recordId int) (*entity.TalkRecords, error)
- func (d *TalkRecordsDao) GetTalkRecord(ctx context.Context, recordId int) (*entity.TalkRecords, *entity.User, error)
- func (d *TalkRecordsDao) HandleTalkRecords(ctx context.Context, items []*model.TalkRecordsItem) ([]*model.TalkRecordsItem, error)
- type TalkRecordsVoteDao
- func (d *TalkRecordsVoteDao) GetVoteAnswerUser(ctx context.Context, vid string) ([]int, error)
- func (d *TalkRecordsVoteDao) GetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)
- func (d *TalkRecordsVoteDao) SetVoteAnswerUser(ctx context.Context, vid string) ([]int, error)
- func (d *TalkRecordsVoteDao) SetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)
- type UserDao
Constants ¶
This section is empty.
Variables ¶
View Source
var Contact = NewContactDao()
View Source
var Group = NewGroupDao()
View Source
var GroupMember = NewGroupMemberDao()
View Source
var Robot = NewRobotDao()
View Source
var Sequence = NewSequenceDao()
View Source
var TalkRecords = NewTalkRecordsDao()
View Source
var TalkRecordsVote = NewTalkRecordsVoteDao()
View Source
var User = NewUserDao()
Functions ¶
func AggregateByPage ¶
func CountDocuments ¶
func DeleteById ¶
func DeleteMany ¶
func FindByPage ¶
func UpdateById ¶
func UpdateMany ¶
Types ¶
type ContactDao ¶
func NewContactDao ¶
func NewContactDao(database ...string) *ContactDao
func (*ContactDao) GetContactIds ¶
func (d *ContactDao) GetContactIds(ctx context.Context, uid int) []int
type GroupDao ¶
func NewGroupDao ¶
type GroupMemberDao ¶
type GroupMemberDao struct { *MongoDB[entity.GroupMember] }
func NewGroupMemberDao ¶
func NewGroupMemberDao(database ...string) *GroupMemberDao
func (*GroupMemberDao) GetMemberIds ¶
func (d *GroupMemberDao) GetMemberIds(ctx context.Context, groupId int) []int
获取所有群成员用户ID
func (*GroupMemberDao) GetUserGroupIds ¶
func (d *GroupMemberDao) GetUserGroupIds(ctx context.Context, uid int) []int
获取所有群成员ID
type MongoDB ¶
func NewMongoDB ¶
func (*MongoDB[T]) AggregateByPage ¶
func (*MongoDB[T]) CountDocuments ¶
func (*MongoDB[T]) DeleteById ¶
func (*MongoDB[T]) DeleteMany ¶
func (*MongoDB[T]) FindByPage ¶
func (*MongoDB[T]) UpdateById ¶
func (*MongoDB[T]) UpdateMany ¶
type RobotDao ¶
func NewRobotDao ¶
func (*RobotDao) GetLoginRobot ¶
获取登录机器的信息
func (*RobotDao) GetRobotByUserId ¶
根据绑定userId获取机器人的信息
func (*RobotDao) GetRobotList ¶
获取机器人列表
type SequenceDao ¶
type SequenceDao struct { *MongoDB[entity.TalkRecords] // contains filtered or unexported fields }
func NewSequenceDao ¶
func NewSequenceDao(database ...string) *SequenceDao
type TalkRecordsDao ¶
type TalkRecordsDao struct { *MongoDB[entity.TalkRecords] }
func NewTalkRecordsDao ¶
func NewTalkRecordsDao(database ...string) *TalkRecordsDao
func (*TalkRecordsDao) FindByRecordId ¶
func (d *TalkRecordsDao) FindByRecordId(ctx context.Context, recordId int) (*entity.TalkRecords, error)
func (*TalkRecordsDao) GetTalkRecord ¶
func (d *TalkRecordsDao) GetTalkRecord(ctx context.Context, recordId int) (*entity.TalkRecords, *entity.User, error)
获取对话消息
func (*TalkRecordsDao) HandleTalkRecords ¶
func (d *TalkRecordsDao) HandleTalkRecords(ctx context.Context, items []*model.TalkRecordsItem) ([]*model.TalkRecordsItem, error)
type TalkRecordsVoteDao ¶
type TalkRecordsVoteDao struct { *MongoDB[entity.TalkRecordsVote] // contains filtered or unexported fields }
func NewTalkRecordsVoteDao ¶
func NewTalkRecordsVoteDao(database ...string) *TalkRecordsVoteDao
func (*TalkRecordsVoteDao) GetVoteAnswerUser ¶
func (*TalkRecordsVoteDao) GetVoteStatistics ¶
func (d *TalkRecordsVoteDao) GetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)
func (*TalkRecordsVoteDao) SetVoteAnswerUser ¶
func (*TalkRecordsVoteDao) SetVoteStatistics ¶
func (d *TalkRecordsVoteDao) SetVoteStatistics(ctx context.Context, vid string) (*model.VoteStatistics, error)
Click to show internal directories.
Click to hide internal directories.