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 AppDao
- type AppKeyDao
- 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 ProviderDao
- type ResellerDao
- type SysConfigDao
- type TaskBatchDao
- type TaskFileDao
- type TaskVideoDao
- type UserDao
Constants ¶
View Source
const ( USER = "user" RESELLER = "reseller" APP = "app" APP_KEY = "app_key" PROVIDER = "provider" MODEL = "model" MODEL_AGENT = "model_agent" KEY = "key" GROUP = "group" 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" SYS_CONFIG = "sys_config" )
Variables ¶
View Source
var App = NewAppDao()
View Source
var AppKey = NewAppKeyDao()
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 Provider = NewProviderDao()
View Source
var Reseller = NewResellerDao()
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 AppKeyDao ¶
func NewAppKeyDao ¶
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 ProviderDao ¶
func NewProviderDao ¶
func NewProviderDao(database ...string) *ProviderDao
type ResellerDao ¶
func NewResellerDao ¶
func NewResellerDao(database ...string) *ResellerDao
func (*ResellerDao) FindResellerByUserId ¶
func (d *ResellerDao) FindResellerByUserId(ctx context.Context, userId int) (*entity.Reseller, error)
根据userId查询用户
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
Click to show internal directories.
Click to hide internal directories.