Documentation
¶
Index ¶
- func RegisterAdminReseller(i IAdminReseller)
- func RegisterAdminUser(i IAdminUser)
- func RegisterApp(i IApp)
- func RegisterAppKey(i IAppKey)
- func RegisterAuth(i IAuth)
- func RegisterCommon(i ICommon)
- func RegisterDashboard(i IDashboard)
- func RegisterFinance(i IFinance)
- func RegisterGroup(i IGroup)
- func RegisterKey(i IKey)
- func RegisterLog(i ILog)
- func RegisterLogAudio(i ILogAudio)
- func RegisterLogBatch(i ILogBatch)
- func RegisterLogFile(i ILogFile)
- func RegisterLogGeneral(i ILogGeneral)
- func RegisterLogImage(i ILogImage)
- func RegisterLogMidjourney(i ILogMidjourney)
- func RegisterLogText(i ILogText)
- func RegisterLogVideo(i ILogVideo)
- func RegisterModel(i IModel)
- func RegisterModelAgent(i IModelAgent)
- func RegisterMonitor(i IMonitor)
- func RegisterNotice(i INotice)
- func RegisterNoticeTemplate(i INoticeTemplate)
- func RegisterOpen(i IOpen)
- func RegisterProvider(i IProvider)
- func RegisterQuota(i IQuota)
- func RegisterReseller(i IReseller)
- func RegisterReset(i IReset)
- func RegisterSession(i ISession)
- func RegisterSiteConfig(i ISiteConfig)
- func RegisterStatistics(i IStatistics)
- func RegisterSysAdmin(i ISysAdmin)
- func RegisterSysConfig(i ISysConfig)
- func RegisterTaskBatch(i ITaskBatch)
- func RegisterTaskFile(i ITaskFile)
- func RegisterTaskReset(i ITaskReset)
- func RegisterTaskVideo(i ITaskVideo)
- func RegisterUser(i IUser)
- type IAdminReseller
- type IAdminUser
- type IApp
- type IAppKey
- type IAuth
- type ICommon
- type IDashboard
- type IFinance
- type IGroup
- type IKey
- type ILog
- type ILogAudio
- type ILogBatch
- type ILogFile
- type ILogGeneral
- type ILogImage
- type ILogMidjourney
- type ILogText
- type ILogVideo
- type IModel
- type IModelAgent
- type IMonitor
- type INotice
- type INoticeTemplate
- type IOpen
- type IProvider
- type IQuota
- type IReseller
- type IReset
- type ISession
- type ISiteConfig
- type IStatistics
- type ISysAdmin
- type ISysConfig
- type ITaskBatch
- type ITaskFile
- type ITaskReset
- type ITaskVideo
- type IUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdminReseller ¶
func RegisterAdminReseller(i IAdminReseller)
func RegisterAdminUser ¶
func RegisterAdminUser(i IAdminUser)
func RegisterApp ¶
func RegisterApp(i IApp)
func RegisterAppKey ¶
func RegisterAppKey(i IAppKey)
func RegisterAuth ¶
func RegisterAuth(i IAuth)
func RegisterCommon ¶
func RegisterCommon(i ICommon)
func RegisterDashboard ¶
func RegisterDashboard(i IDashboard)
func RegisterFinance ¶
func RegisterFinance(i IFinance)
func RegisterGroup ¶
func RegisterGroup(i IGroup)
func RegisterKey ¶
func RegisterKey(i IKey)
func RegisterLog ¶
func RegisterLog(i ILog)
func RegisterLogAudio ¶
func RegisterLogAudio(i ILogAudio)
func RegisterLogBatch ¶
func RegisterLogBatch(i ILogBatch)
func RegisterLogFile ¶
func RegisterLogFile(i ILogFile)
func RegisterLogGeneral ¶
func RegisterLogGeneral(i ILogGeneral)
func RegisterLogImage ¶
func RegisterLogImage(i ILogImage)
func RegisterLogMidjourney ¶
func RegisterLogMidjourney(i ILogMidjourney)
func RegisterLogText ¶
func RegisterLogText(i ILogText)
func RegisterLogVideo ¶
func RegisterLogVideo(i ILogVideo)
func RegisterModel ¶
func RegisterModel(i IModel)
func RegisterModelAgent ¶
func RegisterModelAgent(i IModelAgent)
func RegisterMonitor ¶ added in v2.3.0
func RegisterMonitor(i IMonitor)
func RegisterNotice ¶
func RegisterNotice(i INotice)
func RegisterNoticeTemplate ¶
func RegisterNoticeTemplate(i INoticeTemplate)
func RegisterOpen ¶ added in v2.3.0
func RegisterOpen(i IOpen)
func RegisterProvider ¶
func RegisterProvider(i IProvider)
func RegisterQuota ¶
func RegisterQuota(i IQuota)
func RegisterReseller ¶
func RegisterReseller(i IReseller)
func RegisterReset ¶ added in v2.3.0
func RegisterReset(i IReset)
func RegisterSession ¶
func RegisterSession(i ISession)
func RegisterSiteConfig ¶
func RegisterSiteConfig(i ISiteConfig)
func RegisterStatistics ¶
func RegisterStatistics(i IStatistics)
func RegisterSysAdmin ¶
func RegisterSysAdmin(i ISysAdmin)
func RegisterSysConfig ¶
func RegisterSysConfig(i ISysConfig)
func RegisterTaskBatch ¶
func RegisterTaskBatch(i ITaskBatch)
func RegisterTaskFile ¶
func RegisterTaskFile(i ITaskFile)
func RegisterTaskReset ¶ added in v2.3.0
func RegisterTaskReset(i ITaskReset)
func RegisterTaskVideo ¶
func RegisterTaskVideo(i ITaskVideo)
func RegisterUser ¶
func RegisterUser(i IUser)
Types ¶
type IAdminReseller ¶
type IAdminReseller interface {
// 新建代理商
Create(ctx context.Context, params model.ResellerCreateReq) (err error)
// 更新代理商
Update(ctx context.Context, params model.ResellerUpdateReq) error
// 更改代理商额度过期时间
ChangeQuotaExpire(ctx context.Context, params model.ResellerChangeQuotaExpireReq) error
// 更改代理商状态
ChangeStatus(ctx context.Context, params model.ResellerChangeStatusReq) error
// 删除代理商
Delete(ctx context.Context, params model.ResellerDeleteReq) error
// 代理商详情
Detail(ctx context.Context, id string) (*model.Reseller, error)
// 代理商分页列表
Page(ctx context.Context, params model.ResellerPageReq) (*model.ResellerPageRes, error)
// 代理商列表
List(ctx context.Context, params model.ResellerListReq) ([]*model.Reseller, error)
// 代理商充值
Recharge(ctx context.Context, params model.ResellerRechargeReq) error
// 代理商权限
Permissions(ctx context.Context, userId int, oldGroups []string, newGroups []string) error
// 代理商批量操作
BatchOperate(ctx context.Context, params model.ResellerBatchOperateReq) error
}
func AdminReseller ¶
func AdminReseller() IAdminReseller
type IAdminUser ¶
type IAdminUser interface {
// 新建用户
Create(ctx context.Context, params model.UserCreateReq) (err error)
// 更新用户
Update(ctx context.Context, params model.UserUpdateReq) error
// 更改用户额度过期时间
ChangeQuotaExpire(ctx context.Context, params model.UserChangeQuotaExpireReq) error
// 更改用户状态
ChangeStatus(ctx context.Context, params model.UserChangeStatusReq) error
// 删除用户
Delete(ctx context.Context, params model.UserDeleteReq) error
// 用户详情
Detail(ctx context.Context, id string) (*model.User, error)
// 用户分页列表
Page(ctx context.Context, params model.UserPageReq) (*model.UserPageRes, error)
// 用户列表
List(ctx context.Context, params model.UserListReq) ([]*model.User, error)
// 用户充值
Recharge(ctx context.Context, params model.UserRechargeReq) error
// 用户权限
Permissions(ctx context.Context, userId int, groups []string) error
// 用户批量操作
BatchOperate(ctx context.Context, params model.UserBatchOperateReq) error
}
func AdminUser ¶
func AdminUser() IAdminUser
type IApp ¶
type IApp interface {
// 新建应用
Create(ctx context.Context, params model.AppCreateReq) (string, error)
// 更新应用
Update(ctx context.Context, params model.AppUpdateReq) error
// 更改应用额度过期时间
ChangeQuotaExpire(ctx context.Context, params model.AppChangeQuotaExpireReq) error
// 更改应用状态
ChangeStatus(ctx context.Context, params model.AppChangeStatusReq) error
// 删除应用
Delete(ctx context.Context, id string) error
// 应用详情
Detail(ctx context.Context, id string) (*model.App, error)
// 应用分页列表
Page(ctx context.Context, params model.AppPageReq) (*model.AppPageRes, error)
// 应用列表
List(ctx context.Context, params model.AppListReq) ([]*model.App, error)
// 应用模型权限
Models(ctx context.Context, params model.AppModelsReq) error
// 应用绑定分组
Group(ctx context.Context, params model.AppGroupReq) error
// 应用批量操作
BatchOperate(ctx context.Context, params model.AppBatchOperateReq) error
}
type IAppKey ¶
type IAppKey interface {
// 新建应用密钥
Create(ctx context.Context, params model.AppKeyCreateReq) (string, error)
// 应用密钥配置
Config(ctx context.Context, params model.AppKeyConfigReq) (k string, err error)
// 更改应用密钥状态
ChangeStatus(ctx context.Context, params model.AppKeyChangeStatusReq) error
// 删除应用密钥
Delete(ctx context.Context, id string) error
// 应用密钥详情
Detail(ctx context.Context, id string) (*model.AppKey, error)
// 应用密钥分页列表
Page(ctx context.Context, params model.AppKeyPageReq) (*model.AppKeyPageRes, error)
// 应用密钥模型权限
Models(ctx context.Context, params model.AppKeyModelsReq) error
// 应用密钥绑定分组
Group(ctx context.Context, params model.AppKeyGroupReq) error
// 应用密钥批量操作
BatchOperate(ctx context.Context, params model.AppKeyBatchOperateReq) (keys string, err error)
// 应用密钥导出
Export(ctx context.Context, params model.AppKeyExportReq) (string, error)
}
type IAuth ¶
type IAuth interface {
// 注册
Register(ctx context.Context, params model.RegisterReq, channel ...string) error
// 登录
Login(ctx context.Context, params model.LoginReq) (res *model.LoginRes, err error)
// 退出登录
Logout(ctx context.Context) error
// 找回密码
Forget(ctx context.Context, params model.ForgetReq) error
// 生成用户Token
GenUserToken(ctx context.Context, user *model.User, isSaveSession bool) (token string, err error)
// 根据Token获取用户信息
GetUserByToken(ctx context.Context, token string) (*model.User, error)
// 根据Token更新用户信息
UpdateUserByToken(ctx context.Context, token string, user *model.User) error
// 生成代理商Token
GenResellerToken(ctx context.Context, reseller *model.Reseller, isSaveSession bool) (token string, err error)
// 根据Token获取代理商信息
GetResellerByToken(ctx context.Context, token string) (*model.Reseller, error)
// 根据Token更新代理商信息
UpdateResellerByToken(ctx context.Context, token string, reseller *model.Reseller) error
// 生成管理员Token
GenAdminToken(ctx context.Context, admin *model.SysAdmin, isSaveSession bool) (token string, err error)
// 根据Token获取管理员信息
GetAdminByToken(ctx context.Context, token string) (*model.SysAdmin, error)
// 根据Token更新管理员信息
UpdateAdminByToken(ctx context.Context, token string, admin *model.SysAdmin) error
}
type ICommon ¶
type ICommon interface {
// 发送邮件验证码
EmailCode(ctx context.Context, params model.SendEmailReq) (err error)
// 发送短信验证码
SmsCode(ctx context.Context, params model.SendSmsReq) error
// 缓存验证码
SetCode(ctx context.Context, channel string, account string, code string, exp time.Duration) error
// 获取验证码
GetCode(ctx context.Context, channel string, account string) (string, error)
// 删除验证码
DelCode(ctx context.Context, channel string, account string) error
// 校验验证码
VerifyCode(ctx context.Context, channel string, account string, code string) (pass bool)
}
type IDashboard ¶
type IDashboard interface {
// 基础数据
BaseData(ctx context.Context) (dashboard model.Dashboard, err error)
// 调用数据
CallData(ctx context.Context, params model.DashboardCallDataReq) ([]*model.CallData, error)
// 费用
Expense(ctx context.Context) (*model.Expense, error)
// 数据TOP
DataTop(ctx context.Context, params model.DashboardDataTopReq) ([]*model.DataTop, error)
// 模型占比
ModelPercent(ctx context.Context, params model.DashboardModelPercentReq) ([]string, []*model.ModelPercent, error)
// 每秒钟数据
PerSecond(ctx context.Context, params model.DashboardPerSecondReq) (int, int, error)
// 每分钟数据
PerMinute(ctx context.Context, params model.DashboardPerMinuteReq) (int, int, error)
// 额度预警
QuotaWarning(ctx context.Context, params model.DashboardQuotaWarningReq) error
}
func Dashboard ¶
func Dashboard() IDashboard
type IFinance ¶
type IFinance interface {
// 账单明细详情
BillDetail(ctx context.Context, id string) (*model.StatisticsUser, error)
// 账单明细分页列表
BillPage(ctx context.Context, params model.FinanceBillPageReq) (*model.FinanceBillPageRes, error)
// 账单明细导出
BillExport(ctx context.Context, params model.FinanceBillExportReq) (string, error)
// 交易记录分页列表
DealRecordPage(ctx context.Context, params model.FinanceDealRecordPageReq) (*model.FinanceDealRecordPageRes, error)
}
type IGroup ¶
type IGroup interface {
// 新建分组
Create(ctx context.Context, params model.GroupCreateReq) (id string, err error)
// 更新分组
Update(ctx context.Context, params model.GroupUpdateReq) error
// 更改过期时间
ChangeExpire(ctx context.Context, params model.GroupChangeExpireReq) error
// 更改分组公开状态
ChangePublic(ctx context.Context, params model.GroupChangePublicReq) error
// 更改分组状态
ChangeStatus(ctx context.Context, params model.GroupChangeStatusReq) error
// 删除分组
Delete(ctx context.Context, id string) error
// 分组详情
Detail(ctx context.Context, id string) (*model.Group, error)
// 分组分页列表
Page(ctx context.Context, params model.GroupPageReq) (*model.GroupPageRes, error)
// 分组列表
List(ctx context.Context, params model.GroupListReq) ([]*model.Group, error)
// 分组批量操作
BatchOperate(ctx context.Context, params model.GroupBatchOperateReq) error
// 公开的分组Ids
PublicGroups(ctx context.Context) ([]string, error)
// 根据分组Ids查询分组名称
GroupNames(ctx context.Context, groups []string) ([]string, error)
// 根据分组Ids获取模型Ids
GetModelsByGroups(ctx context.Context, groups ...string) ([]string, error)
// 根据模型Ids获取分组Ids
GetGroupsByModels(ctx context.Context, models ...string) ([]string, error)
}
type IKey ¶
type IKey interface {
// 新建密钥
Create(ctx context.Context, params model.KeyCreateReq, isModelAgent bool) error
// 更新密钥
Update(ctx context.Context, params model.KeyUpdateReq, isModelAgent bool) error
// 更改密钥状态
ChangeStatus(ctx context.Context, params model.KeyChangeStatusReq) error
// 删除密钥
Delete(ctx context.Context, id string) error
// 密钥详情
Detail(ctx context.Context, id string) (*model.Key, error)
// 密钥分页列表
Page(ctx context.Context, params model.KeyPageReq) (*model.KeyPageRes, error)
// 密钥列表
List(ctx context.Context, params model.KeyListReq) ([]*model.Key, error)
// 密钥批量操作
BatchOperate(ctx context.Context, params model.KeyBatchOperateReq) error
// 根据Keys查询密钥详情列表
DetailListByKey(ctx context.Context, keys []string) ([]*entity.Key, error)
// 密钥模型权限
Models(ctx context.Context, params model.KeyModelsReq) error
// 检查任务
CheckTask(ctx context.Context, enableError mcommon.EnableError)
}
type ILogAudio ¶
type ILogBatch ¶
type ILogBatch interface {
// 批处理日志详情
Detail(ctx context.Context, id string) (*model.LogBatch, error)
// 批处理日志分页列表
Page(ctx context.Context, params model.LogBatchPageReq) (*model.LogBatchPageRes, error)
// 批处理日志详情复制字段值
CopyField(ctx context.Context, params model.LogBatchCopyFieldReq) (string, error)
}
type ILogFile ¶
type ILogGeneral ¶
type ILogGeneral interface {
// 通用日志详情
Detail(ctx context.Context, id string) (*model.LogGeneral, error)
// 通用日志分页列表
Page(ctx context.Context, params model.LogGeneralPageReq) (*model.LogGeneralPageRes, error)
// 通用日志详情复制字段值
CopyField(ctx context.Context, params model.LogGeneralCopyFieldReq) (string, error)
}
func LogGeneral ¶
func LogGeneral() ILogGeneral
type ILogImage ¶
type ILogMidjourney ¶
type ILogMidjourney interface {
// Midjourney日志详情
Detail(ctx context.Context, id string) (*model.LogMidjourney, error)
// Midjourney日志分页列表
Page(ctx context.Context, params model.LogMidjourneyPageReq) (*model.LogMidjourneyPageRes, error)
}
func LogMidjourney ¶
func LogMidjourney() ILogMidjourney
type ILogText ¶
type ILogText interface {
// 文本日志详情
Detail(ctx context.Context, id string) (*model.LogText, error)
// 文本日志分页列表
Page(ctx context.Context, params model.LogTextPageReq) (*model.LogTextPageRes, error)
// 文本日志导出
Export(ctx context.Context, params model.LogTextExportReq) (string, error)
// 文本日志批量操作
BatchOperate(ctx context.Context, params model.LogTextBatchOperateReq) error
// 文本日志详情复制字段值
CopyField(ctx context.Context, params model.LogTextCopyFieldReq) (string, error)
}
type ILogVideo ¶
type IModel ¶
type IModel interface {
// 新建模型
Create(ctx context.Context, params model.ModelCreateReq) error
// 更新模型
Update(ctx context.Context, params model.ModelUpdateReq) error
// 更改模型状态
ChangeStatus(ctx context.Context, params model.ModelChangeStatusReq) error
// 删除模型
Delete(ctx context.Context, id string) error
// 模型详情
Detail(ctx context.Context, id string) (*model.Model, error)
// 模型分页列表
Page(ctx context.Context, params model.ModelPageReq) (*model.ModelPageRes, error)
// 模型列表
List(ctx context.Context, params model.ModelListReq) ([]*model.Model, error)
// 模型批量操作
BatchOperate(ctx context.Context, params model.ModelBatchOperateReq) error
// 模型树
Tree(ctx context.Context, params model.ModelTreeReq) ([]*model.Tree, error)
// 模型权限列表
Permissions(ctx context.Context, params model.ModelPermissionsReq) ([]*model.Model, error)
// 模型初始化同步
InitSync(ctx context.Context, params model.ModelInitSyncReq) error
// 公开的模型Ids
PublicModels(ctx context.Context) ([]string, error)
// 根据模型Ids查询模型名称
ModelNames(ctx context.Context, models []string) ([]string, error)
// 模型名称是否存在
IsNameExist(ctx context.Context, name string, id ...string) bool
}
type IModelAgent ¶
type IModelAgent interface {
// 新建模型代理
Create(ctx context.Context, params model.ModelAgentCreateReq) (string, error)
// 更新模型代理
Update(ctx context.Context, params model.ModelAgentUpdateReq) error
// 更改模型代理状态
ChangeStatus(ctx context.Context, params model.ModelAgentChangeStatusReq) error
// 删除模型代理
Delete(ctx context.Context, id string) error
// 模型代理详情
Detail(ctx context.Context, id string) (*model.ModelAgent, error)
// 模型代理分页列表
Page(ctx context.Context, params model.ModelAgentPageReq) (*model.ModelAgentPageRes, error)
// 模型代理列表
List(ctx context.Context, params model.ModelAgentListReq) ([]*model.ModelAgent, error)
// 模型代理批量操作
BatchOperate(ctx context.Context, params model.ModelAgentBatchOperateReq) error
// 模型代理名称是否存在
IsNameExist(ctx context.Context, name string, id ...string) bool
// 快速填入模型
QuickFillModel(ctx context.Context, params model.ModelAgentQuickFillModelReq) ([]string, error)
// 测试模型
TestModel(ctx context.Context, params model.ModelAgentTestModelReq) (*model.ModelAgentTestModelRes, error)
// 会话保持缓存数量
SessionKeepCount(ctx context.Context, id string) (int64, error)
// 会话保持缓存清空
SessionKeepClear(ctx context.Context, id string) (int64, error)
// 会话保持缓存清空全部
SessionKeepClearAll(ctx context.Context) (int64, error)
// 会话保持清理任务
SessionKeepCleanupTask(ctx context.Context)
// 健康检查任务
HealthCheckTask(ctx context.Context)
}
func ModelAgent ¶
func ModelAgent() IModelAgent
type IMonitor ¶ added in v2.3.0
type IMonitor interface {
// 监控中心全局实时指标
Global(ctx context.Context, params model.MonitorGlobalReq) (*model.MonitorGlobalRes, error)
// 监控中心实时性能维度分析
PerfBreakdown(ctx context.Context, params model.MonitorPerfBreakdownReq) (*model.MonitorPerfBreakdownRes, error)
// 监控中心历史性能数据
PerfHistory(ctx context.Context, params model.MonitorPerfHistoryReq) (*model.MonitorPerfHistoryRes, error)
}
type INotice ¶
type INotice interface {
// 新建消息通知
Create(ctx context.Context, params model.NoticeCreateReq) (string, error)
// 更新消息通知
Update(ctx context.Context, params model.NoticeUpdateReq) error
// 删除消息通知
Delete(ctx context.Context, id string) error
// 消息通知详情
Detail(ctx context.Context, id string) (*model.Notice, error)
// 消息通知分页列表
Page(ctx context.Context, params model.NoticePageReq) (*model.NoticePageRes, error)
// 消息通知列表
List(ctx context.Context, params model.NoticeListReq) ([]*model.Notice, error)
// 发送消息通知
Send(ctx context.Context, notice *entity.Notice) (err error)
// 发送消息通知邮件
SendMail(ctx context.Context, dialer *email.Dialer, to string, title string, content string) error
// 消息通知批量操作
BatchOperate(ctx context.Context, params model.NoticeBatchOperateReq) error
}
type INoticeTemplate ¶
type INoticeTemplate interface {
// 初始化通知模板
Init(ctx context.Context)
// 默认通知模板
Default() []*do.NoticeTemplate
// 新建通知模板
Create(ctx context.Context, params model.NoticeTemplateCreateReq) (string, error)
// 更新通知模板
Update(ctx context.Context, params model.NoticeTemplateUpdateReq) error
// 更改通知模板公开状态
ChangePublic(ctx context.Context, params model.NoticeTemplateChangePublicReq) error
// 更改通知模板状态
ChangeStatus(ctx context.Context, params model.NoticeTemplateChangeStatusReq) error
// 删除通知模板
Delete(ctx context.Context, id string) error
// 通知模板详情
Detail(ctx context.Context, id string) (*model.NoticeTemplate, error)
// 通知模板分页列表
Page(ctx context.Context, params model.NoticeTemplatePageReq) (*model.NoticeTemplatePageRes, error)
// 通知模板列表
List(ctx context.Context, params model.NoticeTemplateListReq) ([]*model.NoticeTemplate, error)
// 根据使用场景获取通知模板
GetNoticeTemplateByScene(ctx context.Context, scene string, channels []string) (*model.NoticeTemplate, error)
// 通知模板批量操作
BatchOperate(ctx context.Context, params model.NoticeTemplateBatchOperateReq) error
}
func NoticeTemplate ¶
func NoticeTemplate() INoticeTemplate
type IOpen ¶ added in v2.3.0
type IOpen interface {
// 站点配置
Site(ctx context.Context, params model.SiteConfigDetailReq) *model.SiteConfig
// 系统配置
Config(ctx context.Context, params model.SysConfigReq) (*model.SysConfig, error)
// 视频文件
Video(ctx context.Context, fileName string) (string, error)
// 文件
File(ctx context.Context, fileName string) (string, error)
// 用户协议
UserAgreement(ctx context.Context, params model.SysConfigReq) (string, error)
// 隐私政策
PrivacyPolicy(ctx context.Context, params model.SysConfigReq) (string, error)
}
type IProvider ¶
type IProvider interface {
// 新建提供商
Create(ctx context.Context, params model.ProviderCreateReq) (string, error)
// 更新提供商
Update(ctx context.Context, params model.ProviderUpdateReq) error
// 更改提供商公开状态
ChangePublic(ctx context.Context, params model.ProviderChangePublicReq) error
// 更改提供商状态
ChangeStatus(ctx context.Context, params model.ProviderChangeStatusReq) error
// 删除提供商
Delete(ctx context.Context, id string) error
// 提供商详情
Detail(ctx context.Context, id string) (*model.Provider, error)
// 提供商分页列表
Page(ctx context.Context, params model.ProviderPageReq) (*model.ProviderPageRes, error)
// 提供商列表
List(ctx context.Context, params model.ProviderListReq) ([]*model.Provider, error)
// 提供商批量操作
BatchOperate(ctx context.Context, params model.ProviderBatchOperateReq) error
}
type IQuota ¶
type IReseller ¶
type IReseller interface {
// 代理商更新信息
UpdateInfo(ctx context.Context, params model.UserUpdateInfoReq) error
// 代理商更改密码
ChangePassword(ctx context.Context, params model.UserChangePasswordReq) (err error)
// 代理商更改邮箱
ChangeEmail(ctx context.Context, params model.UserChangeEmailReq) error
// 代理商更改头像
ChangeAvatar(ctx context.Context, file *ghttp.UploadFile) error
// 根据userId获取代理商信息
GetResellerByUserId(ctx context.Context, userId int) (*model.Reseller, error)
}
type ISession ¶
type ISession interface {
// 保存代理商会话信息
SaveReseller(ctx context.Context, token string, reseller *model.Reseller) error
// 保存用户会话信息
SaveUser(ctx context.Context, token string, user *model.User) error
// 保存管理员会话信息
SaveAdmin(ctx context.Context, token string, admin *model.SysAdmin) error
// 获取会话中Token
GetToken(ctx context.Context) string
// 获取会话中用户主键ID
GetUid(ctx context.Context) string
// 获取会话中代理商ID
GetRid(ctx context.Context) int
// 获取会话中UserId
GetUserId(ctx context.Context) int
// 获取会话中角色
GetRole(ctx context.Context) string
// 获取会话中创建人
GetCreator(ctx context.Context) string
// 获取会话中代理商信息
GetReseller(ctx context.Context) *model.Reseller
// 获取会话中用户信息
GetUser(ctx context.Context) *model.User
// 获取会话中管理员信息
GetAdmin(ctx context.Context) *model.SysAdmin
// 判断获取会话中角色是否为代理商
IsResellerRole(ctx context.Context) bool
// 判断获取会话中角色是否为用户
IsUserRole(ctx context.Context) bool
// 判断获取会话中角色是否为管理员
IsAdminRole(ctx context.Context) bool
// 更新代理商会话信息
UpdateResellerSession(ctx context.Context, reseller *model.Reseller) error
// 更新用户会话信息
UpdateUserSession(ctx context.Context, user *model.User) error
// 更新管理员会话信息
UpdateAdminSession(ctx context.Context, admin *model.SysAdmin) error
}
type ISiteConfig ¶
type ISiteConfig interface {
// 新建站点配置
Create(ctx context.Context, params model.SiteConfigCreateReq) error
// 更新站点配置
Update(ctx context.Context, params model.SiteConfigUpdateReq) error
// 更改站点配置状态
ChangeStatus(ctx context.Context, params model.SiteConfigChangeStatusReq) error
// 删除站点配置
Delete(ctx context.Context, id string) error
// 站点配置详情
Detail(ctx context.Context, params model.SiteConfigDetailReq) (*model.SiteConfig, error)
// 站点配置分页列表
Page(ctx context.Context, params model.SiteConfigPageReq) (*model.SiteConfigPageRes, error)
// 站点配置批量操作
BatchOperate(ctx context.Context, params model.SiteConfigBatchOperateReq) error
// 根据域名获取站点配置
GetSiteConfigByDomain(ctx context.Context, domain string) *entity.SiteConfig
// 站点域名是否存在
IsDomainExist(ctx context.Context, domain string, id ...string) bool
// 根据代理商ID获取站点配置列表
GetSiteConfigsByRid(ctx context.Context, rid int) []*entity.SiteConfig
}
func SiteConfig ¶
func SiteConfig() ISiteConfig
type IStatistics ¶
type IStatistics interface {
// 用户数据
DataUser(ctx context.Context, params model.StatisticsDataReq) (*model.StatisticsDataRes, error)
// 应用数据
DataApp(ctx context.Context, params model.StatisticsDataReq) (*model.StatisticsDataRes, error)
// 应用密钥数据
DataAppKey(ctx context.Context, params model.StatisticsDataReq) (*model.StatisticsDataRes, error)
// 数据看板汇总
DataSummary(ctx context.Context, params model.StatisticsSummaryReq) (*model.StatisticsSummaryRes, error)
// 数据看板趋势
DataTrend(ctx context.Context, params model.StatisticsTrendReq) (*model.StatisticsTrendRes, error)
// 数据看板模型分布
DataModelPercent(ctx context.Context, params model.StatisticsModelPercentReq) (*model.StatisticsModelPercentRes, error)
// 数据看板排行
DataTop(ctx context.Context, params model.StatisticsTopReq) (*model.StatisticsTopRes, error)
// 数据看板明细
DataDetail(ctx context.Context, params model.StatisticsDetailReq) (*model.StatisticsDetailRes, error)
// 数据看板全局总览
DataOverview(ctx context.Context, params model.StatisticsOverviewReq) (*model.StatisticsOverviewRes, error)
// 数据看板模型趋势
DataModelTrend(ctx context.Context, params model.StatisticsModelTrendReq) (*model.StatisticsModelTrendRes, error)
// 数据看板响应耗时趋势
DataLatencyTrend(ctx context.Context, params model.StatisticsLatencyTrendReq) (*model.StatisticsLatencyTrendRes, error)
// 数据看板任务状态分布
DataTaskStatus(ctx context.Context, params model.StatisticsTaskStatusReq) (*model.StatisticsTaskStatusRes, error)
// 数据看板代理状态
DataAgentStatus(ctx context.Context, params model.StatisticsAgentStatusReq) (*model.StatisticsAgentStatusRes, error)
// 数据看板密钥状态
DataKeyStatus(ctx context.Context, params model.StatisticsKeyStatusReq) (*model.StatisticsKeyStatusRes, error)
// 统计任务
StatisticsTask(ctx context.Context)
// 统计数据
StatisticsData(ctx context.Context, collection string, index string, lastTimeKey string, lastIdKey string)
}
func Statistics ¶
func Statistics() IStatistics
type ISysAdmin ¶
type ISysAdmin interface {
// 管理员更新信息
UpdateInfo(ctx context.Context, params model.UserUpdateInfoReq) error
// 管理员更改密码
ChangePassword(ctx context.Context, params model.UserChangePasswordReq) (err error)
// 管理员更改邮箱
ChangeEmail(ctx context.Context, params model.UserChangeEmailReq) error
// 管理员更改头像
ChangeAvatar(ctx context.Context, file *ghttp.UploadFile) error
// 新建管理员
Create(ctx context.Context, params model.SysAdminCreateReq) error
// 更新管理员
Update(ctx context.Context, params model.SysAdminUpdateReq) error
// 删除管理员
Delete(ctx context.Context, id string) error
// 管理员详情
Detail(ctx context.Context, id string) (*model.SysAdmin, error)
// 管理员分页列表
Page(ctx context.Context, params model.SysAdminPageReq) (*model.SysAdminPageRes, error)
}
type ISysConfig ¶
type ISysConfig interface {
// 更新配置
Update(ctx context.Context, params model.SysConfigUpdateReq) (newData *entity.SysConfig, err error)
// 更改配置状态
ChangeStatus(ctx context.Context, params model.SysConfigChangeStatusReq) error
// 配置详情
Detail(ctx context.Context) (*model.SysConfig, error)
// 重置配置
Reset(ctx context.Context, params model.SysConfigResetReq) (*entity.SysConfig, error)
// 刷新配置
Refresh(ctx context.Context, params model.SysConfigRefreshReq) error
// 初始化配置
Init(ctx context.Context) (sysConfig *entity.SysConfig, err error)
// 默认配置
Default() *do.SysConfig
}
func SysConfig ¶
func SysConfig() ISysConfig
type ITaskBatch ¶
type ITaskBatch interface {
// 批处理任务详情
Detail(ctx context.Context, id string) (*model.TaskBatch, error)
// 批处理任务分页列表
Page(ctx context.Context, params model.TaskBatchPageReq) (*model.TaskBatchPageRes, error)
// 批处理任务详情复制字段值
CopyField(ctx context.Context, params model.TaskBatchCopyFieldReq) (string, error)
// 批处理任务
Task(ctx context.Context)
}
func TaskBatch ¶
func TaskBatch() ITaskBatch
type ITaskFile ¶
type ITaskFile interface {
// 文件任务详情
Detail(ctx context.Context, id string) (*model.TaskFile, error)
// 文件任务分页列表
Page(ctx context.Context, params model.TaskFilePageReq) (*model.TaskFilePageRes, error)
// 文件任务详情复制字段值
CopyField(ctx context.Context, params model.TaskFileCopyFieldReq) (string, error)
// 文件任务
Task(ctx context.Context)
}
type ITaskReset ¶ added in v2.3.0
func TaskReset ¶ added in v2.3.0
func TaskReset() ITaskReset
type ITaskVideo ¶
type ITaskVideo interface {
// 视频任务详情
Detail(ctx context.Context, id string) (*model.TaskVideo, error)
// 视频任务分页列表
Page(ctx context.Context, params model.TaskVideoPageReq) (*model.TaskVideoPageRes, error)
// 视频任务详情复制字段值
CopyField(ctx context.Context, params model.TaskVideoCopyFieldReq) (string, error)
// 视频任务
Task(ctx context.Context)
}
func TaskVideo ¶
func TaskVideo() ITaskVideo
type IUser ¶
type IUser interface {
// 用户更新信息
UpdateInfo(ctx context.Context, params model.UserUpdateInfoReq) error
// 用户更改密码
ChangePassword(ctx context.Context, params model.UserChangePasswordReq) (err error)
// 用户更改邮箱
ChangeEmail(ctx context.Context, params model.UserChangeEmailReq) error
// 用户更改头像
ChangeAvatar(ctx context.Context, file *ghttp.UploadFile) error
// 根据userId获取用户信息
GetUserByUserId(ctx context.Context, userId int) (*model.User, error)
}
Source Files
¶
- admin_reseller.go
- admin_user.go
- app.go
- app_key.go
- auth.go
- common.go
- dashboard.go
- finance.go
- group.go
- key.go
- log.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
- monitor.go
- notice.go
- notice_template.go
- open.go
- provider.go
- quota.go
- reseller.go
- reset.go
- session.go
- site_config.go
- statistics.go
- sys_admin.go
- sys_config.go
- task_batch.go
- task_file.go
- task_reset.go
- task_video.go
- user.go
Click to show internal directories.
Click to hide internal directories.