Documentation
¶
Index ¶
- Constants
- Variables
- func Aggregate(ctx context.Context, database, collection string, pipeline []bson.M, ...) error
- func AggregateByPage(ctx context.Context, database, collection, countField string, ...) error
- type AccountDao
- type AppDao
- type AppKeyDao
- type DealRecordDao
- type FindOptions
- type GroupDao
- type IMongoDB
- type KeyDao
- type LogAudioDao
- type LogBatchDao
- type LogFileDao
- type LogGeneralDao
- type LogImageDao
- type LogMidjourneyDao
- type LogTextDao
- type LogVideoDao
- type ModelAgentDao
- type ModelDao
- type MongoDB
- func (m *MongoDB[T]) Aggregate(ctx context.Context, pipeline []bson.M, result any) 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]any) (int64, error)
- func (m *MongoDB[T]) DeleteById(ctx context.Context, id any) (int64, error)
- func (m *MongoDB[T]) DeleteMany(ctx context.Context, filter map[string]any) (int64, error)
- func (m *MongoDB[T]) DeleteOne(ctx context.Context, filter map[string]any) (int64, error)
- func (m *MongoDB[T]) EstimatedDocumentCount(ctx context.Context) (int64, error)
- func (m *MongoDB[T]) Find(ctx context.Context, filter map[string]any, findOptions ...*FindOptions) ([]*T, error)
- func (m *MongoDB[T]) FindById(ctx context.Context, id any, findOptions ...*FindOptions) (*T, error)
- func (m *MongoDB[T]) FindByIds(ctx context.Context, ids any, findOptions ...*FindOptions) ([]*T, error)
- func (m *MongoDB[T]) FindByPage(ctx context.Context, paging *db.Paging, filter map[string]any, ...) ([]*T, error)
- func (m *MongoDB[T]) FindOne(ctx context.Context, filter map[string]any, findOptions ...*FindOptions) (*T, error)
- func (m *MongoDB[T]) FindOneAndDelete(ctx context.Context, filter map[string]any) (*T, error)
- func (m *MongoDB[T]) FindOneAndDeleteById(ctx context.Context, id any) (*T, error)
- func (m *MongoDB[T]) FindOneAndUpdate(ctx context.Context, filter map[string]any, update any, isUpsert ...bool) (*T, error)
- func (m *MongoDB[T]) FindOneAndUpdateById(ctx context.Context, id any, update any, isUpsert ...bool) (*T, error)
- func (m *MongoDB[T]) Insert(ctx context.Context, document any) (string, error)
- func (m *MongoDB[T]) Inserts(ctx context.Context, documents []any) ([]string, error)
- func (m *MongoDB[T]) UpdateById(ctx context.Context, id, update any, isUpsert ...bool) error
- func (m *MongoDB[T]) UpdateMany(ctx context.Context, filter map[string]any, update any, isUpsert ...bool) error
- func (m *MongoDB[T]) UpdateOne(ctx context.Context, filter map[string]any, update any, isUpsert ...bool) error
- type NoticeDao
- type NoticeTemplateDao
- type ProviderDao
- type ResellerAccountDao
- type ResellerDao
- func (d *ResellerDao) ChangeAccountById(ctx context.Context, id, account string) error
- func (d *ResellerDao) ChangePasswordByUserId(ctx context.Context, userId int, password string) error
- func (d *ResellerDao) CreateAccount(ctx context.Context, account *do.ResellerAccount) (string, error)
- func (d *ResellerDao) FindAccount(ctx context.Context, account string) (*entity.ResellerAccount, error)
- func (d *ResellerDao) FindAccountByUserId(ctx context.Context, userId int) (*entity.ResellerAccount, error)
- func (d *ResellerDao) FindAccountsByUserId(ctx context.Context, userId int) ([]*entity.ResellerAccount, error)
- func (d *ResellerDao) FindResellerByAccount(ctx context.Context, account string) (*entity.Reseller, error)
- func (d *ResellerDao) FindResellerByUserId(ctx context.Context, userId int) (*entity.Reseller, error)
- func (d *ResellerDao) FindResellerListByUserIds(ctx context.Context, userIds []int) ([]*entity.Reseller, error)
- func (d *ResellerDao) IsAccountExist(ctx context.Context, account string) bool
- func (d *ResellerDao) IsEmailExist(ctx context.Context, email string) bool
- func (d *ResellerDao) IsPhoneExist(ctx context.Context, phone string) bool
- type SiteConfigDao
- type StatisticsAppDao
- type StatisticsAppKeyDao
- type StatisticsUserDao
- type SysAdminDao
- type SysConfigDao
- type TaskBatchDao
- type TaskFileDao
- type TaskVideoDao
- type UserDao
- func (d *UserDao) ChangeAccountById(ctx context.Context, id, account string) error
- func (d *UserDao) ChangePasswordByUserId(ctx context.Context, userId int, password string) error
- func (d *UserDao) CreateAccount(ctx context.Context, account *do.Account) (string, error)
- func (d *UserDao) FindAccount(ctx context.Context, account string) (*entity.Account, error)
- func (d *UserDao) FindAccountByUserId(ctx context.Context, userId int) (*entity.Account, error)
- func (d *UserDao) FindAccountsByUserId(ctx context.Context, userId int) ([]*entity.Account, error)
- func (d *UserDao) FindUserByAccount(ctx context.Context, account string) (*entity.User, error)
- func (d *UserDao) FindUserByUserId(ctx context.Context, userId int) (*entity.User, error)
- func (d *UserDao) FindUserListByUserIds(ctx context.Context, userIds []int) ([]*entity.User, error)
- func (d *UserDao) IsAccountExist(ctx context.Context, account string) bool
- func (d *UserDao) IsEmailExist(ctx context.Context, email string) bool
- func (d *UserDao) IsPhoneExist(ctx context.Context, phone string) bool
Constants ¶
View Source
const ( USER = "user" ACCOUNT = "account" RESELLER = "reseller" RESELLER_ACCOUNT = "reseller_account" APP = "app" APP_KEY = "app_key" PROVIDER = "provider" MODEL = "model" MODEL_AGENT = "model_agent" KEY = "key" GROUP = "group" NOTICE = "notice" NOTICE_TEMPLATE = "notice_template" DEAL_RECORD = "deal_record" TASK_VIDEO = "task_video" TASK_FILE = "task_file" TASK_BATCH = "task_batch" LOG_TEXT = "log_text" LOG_IMAGE = "log_image" LOG_AUDIO = "log_audio" LOG_VIDEO = "log_video" LOG_FILE = "log_file" LOG_BATCH = "log_batch" LOG_MIDJOURNEY = "log_midjourney" LOG_GENERAL = "log_general" SITE_CONFIG = "site_config" SYS_ADMIN = "sys_admin" SYS_CONFIG = "sys_config" STATISTICS_USER = "statistics_user" STATISTICS_APP = "statistics_app" STATISTICS_APP_KEY = "statistics_app_key" )
Variables ¶
View Source
var Account = NewAccountDao()
View Source
var App = NewAppDao()
View Source
var AppKey = NewAppKeyDao()
View Source
var DealRecord = NewDealRecordDao()
View Source
var Group = NewGroupDao()
View Source
var Key = NewKeyDao()
View Source
var LogAudio = NewLogAudioDao()
View Source
var LogBatch = NewLogBatchDao()
View Source
var LogFile = NewLogFileDao()
View Source
var LogGeneral = NewLogGeneralDao()
View Source
var LogImage = NewLogImageDao()
View Source
var LogMidjourney = NewLogMidjourneyDao()
View Source
var LogText = NewLogTextDao()
View Source
var LogVideo = NewLogVideoDao()
View Source
var Model = NewModelDao()
View Source
var ModelAgent = NewModelAgentDao()
View Source
var Notice = NewNoticeDao()
View Source
var NoticeTemplate = NewNoticeTemplateDao()
View Source
var Provider = NewProviderDao()
View Source
var Reseller = NewResellerDao()
View Source
var ResellerAccount = NewResellerAccountDao()
View Source
var SiteConfig = NewSiteConfigDao()
View Source
var StatisticsApp = NewStatisticsAppDao()
View Source
var StatisticsAppKey = NewStatisticsAppKeyDao()
View Source
var StatisticsUser = NewStatisticsUserDao()
View Source
var SysAdmin = NewSysAdminDao()
View Source
var SysConfig = NewSysConfigDao()
View Source
var TaskBatch = NewTaskBatchDao()
View Source
var TaskFile = NewTaskFileDao()
View Source
var TaskVideo = NewTaskVideoDao()
View Source
var User = NewUserDao()
Functions ¶
Types ¶
type AccountDao ¶
func NewAccountDao ¶
func NewAccountDao(database ...string) *AccountDao
type AppKeyDao ¶
func NewAppKeyDao ¶
type DealRecordDao ¶
type DealRecordDao struct {
*MongoDB[entity.DealRecord]
}
func NewDealRecordDao ¶
func NewDealRecordDao(database ...string) *DealRecordDao
type FindOptions ¶
type GroupDao ¶
func NewGroupDao ¶
type LogAudioDao ¶
func NewLogAudioDao ¶
func NewLogAudioDao(database ...string) *LogAudioDao
type LogBatchDao ¶
func NewLogBatchDao ¶
func NewLogBatchDao(database ...string) *LogBatchDao
type LogFileDao ¶
func NewLogFileDao ¶
func NewLogFileDao(database ...string) *LogFileDao
type LogGeneralDao ¶
type LogGeneralDao struct {
*MongoDB[entity.LogGeneral]
}
func NewLogGeneralDao ¶
func NewLogGeneralDao(database ...string) *LogGeneralDao
type LogImageDao ¶
func NewLogImageDao ¶
func NewLogImageDao(database ...string) *LogImageDao
type LogMidjourneyDao ¶
type LogMidjourneyDao struct {
*MongoDB[entity.LogMidjourney]
}
func NewLogMidjourneyDao ¶
func NewLogMidjourneyDao(database ...string) *LogMidjourneyDao
type LogTextDao ¶
func NewLogTextDao ¶
func NewLogTextDao(database ...string) *LogTextDao
type LogVideoDao ¶
func NewLogVideoDao ¶
func NewLogVideoDao(database ...string) *LogVideoDao
type ModelAgentDao ¶
type ModelAgentDao struct {
*MongoDB[entity.ModelAgent]
}
func NewModelAgentDao ¶
func NewModelAgentDao(database ...string) *ModelAgentDao
type ModelDao ¶
func NewModelDao ¶
type MongoDB ¶
func NewMongoDB ¶
func (*MongoDB[T]) AggregateByPage ¶
func (*MongoDB[T]) CountDocuments ¶
func (*MongoDB[T]) DeleteById ¶
func (*MongoDB[T]) DeleteMany ¶
func (*MongoDB[T]) EstimatedDocumentCount ¶
func (*MongoDB[T]) FindByPage ¶
func (*MongoDB[T]) FindOneAndDelete ¶
func (*MongoDB[T]) FindOneAndDeleteById ¶
func (*MongoDB[T]) FindOneAndUpdate ¶
func (*MongoDB[T]) FindOneAndUpdateById ¶
func (*MongoDB[T]) UpdateById ¶
func (*MongoDB[T]) UpdateMany ¶
type NoticeDao ¶
func NewNoticeDao ¶
type NoticeTemplateDao ¶
type NoticeTemplateDao struct {
*MongoDB[entity.NoticeTemplate]
}
func NewNoticeTemplateDao ¶
func NewNoticeTemplateDao(database ...string) *NoticeTemplateDao
type ProviderDao ¶
func NewProviderDao ¶
func NewProviderDao(database ...string) *ProviderDao
type ResellerAccountDao ¶
type ResellerAccountDao struct {
*MongoDB[entity.ResellerAccount]
}
func NewResellerAccountDao ¶
func NewResellerAccountDao(database ...string) *ResellerAccountDao
type ResellerDao ¶
func NewResellerDao ¶
func NewResellerDao(database ...string) *ResellerDao
func (*ResellerDao) ChangeAccountById ¶
func (d *ResellerDao) ChangeAccountById(ctx context.Context, id, account string) error
func (*ResellerDao) ChangePasswordByUserId ¶
func (*ResellerDao) CreateAccount ¶
func (d *ResellerDao) CreateAccount(ctx context.Context, account *do.ResellerAccount) (string, error)
func (*ResellerDao) FindAccount ¶
func (d *ResellerDao) FindAccount(ctx context.Context, account string) (*entity.ResellerAccount, error)
func (*ResellerDao) FindAccountByUserId ¶
func (d *ResellerDao) FindAccountByUserId(ctx context.Context, userId int) (*entity.ResellerAccount, error)
func (*ResellerDao) FindAccountsByUserId ¶
func (d *ResellerDao) FindAccountsByUserId(ctx context.Context, userId int) ([]*entity.ResellerAccount, error)
func (*ResellerDao) FindResellerByAccount ¶
func (d *ResellerDao) FindResellerByAccount(ctx context.Context, account string) (*entity.Reseller, error)
根据账号查询代理商
func (*ResellerDao) FindResellerByUserId ¶
func (d *ResellerDao) FindResellerByUserId(ctx context.Context, userId int) (*entity.Reseller, error)
根据userId查询代理商
func (*ResellerDao) FindResellerListByUserIds ¶
func (d *ResellerDao) FindResellerListByUserIds(ctx context.Context, userIds []int) ([]*entity.Reseller, error)
根据userIds查询代理商列表
func (*ResellerDao) IsAccountExist ¶
func (d *ResellerDao) IsAccountExist(ctx context.Context, account string) bool
判断账号是否存在
func (*ResellerDao) IsEmailExist ¶
func (d *ResellerDao) IsEmailExist(ctx context.Context, email string) bool
判断邮箱是否存在
func (*ResellerDao) IsPhoneExist ¶
func (d *ResellerDao) IsPhoneExist(ctx context.Context, phone string) bool
判断手机号是否存在
type SiteConfigDao ¶
type SiteConfigDao struct {
*MongoDB[entity.SiteConfig]
}
func NewSiteConfigDao ¶
func NewSiteConfigDao(database ...string) *SiteConfigDao
type StatisticsAppDao ¶
type StatisticsAppDao struct {
*MongoDB[entity.StatisticsApp]
}
func NewStatisticsAppDao ¶
func NewStatisticsAppDao(database ...string) *StatisticsAppDao
type StatisticsAppKeyDao ¶
type StatisticsAppKeyDao struct {
*MongoDB[entity.StatisticsAppKey]
}
func NewStatisticsAppKeyDao ¶
func NewStatisticsAppKeyDao(database ...string) *StatisticsAppKeyDao
type StatisticsUserDao ¶
type StatisticsUserDao struct {
*MongoDB[entity.StatisticsUser]
}
func NewStatisticsUserDao ¶
func NewStatisticsUserDao(database ...string) *StatisticsUserDao
type SysAdminDao ¶
func NewSysAdminDao ¶
func NewSysAdminDao(database ...string) *SysAdminDao
func (*SysAdminDao) ChangePassword ¶
type SysConfigDao ¶
func NewSysConfigDao ¶
func NewSysConfigDao(database ...string) *SysConfigDao
type TaskBatchDao ¶
func NewTaskBatchDao ¶
func NewTaskBatchDao(database ...string) *TaskBatchDao
type TaskFileDao ¶
func NewTaskFileDao ¶
func NewTaskFileDao(database ...string) *TaskFileDao
type TaskVideoDao ¶
func NewTaskVideoDao ¶
func NewTaskVideoDao(database ...string) *TaskVideoDao
type UserDao ¶
func NewUserDao ¶
func (*UserDao) ChangeAccountById ¶
func (*UserDao) ChangePasswordByUserId ¶
func (*UserDao) CreateAccount ¶
func (*UserDao) FindAccount ¶
func (*UserDao) FindAccountByUserId ¶
func (*UserDao) FindAccountsByUserId ¶
func (*UserDao) FindUserByAccount ¶
根据账号查询用户
func (*UserDao) FindUserByUserId ¶
根据userId查询用户
func (*UserDao) FindUserListByUserIds ¶
根据userIds查询用户列表
func (*UserDao) IsAccountExist ¶
判断账号是否存在
func (*UserDao) IsEmailExist ¶
判断邮箱是否存在
Source Files
¶
- account.go
- app.go
- app_key.go
- collection.go
- deal_record.go
- group.go
- key.go
- log_audio.go
- log_batch.go
- log_file.go
- log_general.go
- log_image.go
- log_midjourney.go
- log_text.go
- log_video.go
- model.go
- model_agent.go
- mongodb.go
- notice.go
- notice_template.go
- provider.go
- reseller.go
- site_config.go
- statistics_app.go
- statistics_app_key.go
- statistics_user.go
- sys_admin.go
- sys_config.go
- task_batch.go
- task_file.go
- task_video.go
- user.go
Click to show internal directories.
Click to hide internal directories.