service

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 RegisterNotice

func RegisterNotice(i INotice)

func RegisterNoticeTemplate

func RegisterNoticeTemplate(i INoticeTemplate)

func RegisterProvider

func RegisterProvider(i IProvider)

func RegisterQuota

func RegisterQuota(i IQuota)

func RegisterReseller

func RegisterReseller(i IReseller)

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 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
	// 更改应用状态
	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
}

func App

func App() IApp

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)
}

func AppKey

func AppKey() IAppKey

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
}

func Auth

func Auth() IAuth

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)
}

func Common

func Common() ICommon

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)
}

func Finance

func Finance() IFinance

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)
}

func Group

func Group() IGroup

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)
}

func Key

func Key() IKey

type ILog

type ILog interface {
	// 删除任务
	DelTask(ctx context.Context)
}

func Log

func Log() ILog

type ILogAudio

type ILogAudio interface {
	// 音频日志详情
	Detail(ctx context.Context, id string) (*model.LogAudio, error)
	// 音频日志分页列表
	Page(ctx context.Context, params model.LogAudioPageReq) (*model.LogAudioPageRes, error)
	// 音频日志详情复制字段值
	CopyField(ctx context.Context, params model.LogAudioCopyFieldReq) (string, error)
}

func LogAudio

func LogAudio() 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)
}

func LogBatch

func LogBatch() ILogBatch

type ILogFile

type ILogFile interface {
	// 文件日志详情
	Detail(ctx context.Context, id string) (*model.LogFile, error)
	// 文件日志分页列表
	Page(ctx context.Context, params model.LogFilePageReq) (*model.LogFilePageRes, error)
	// 文件日志详情复制字段值
	CopyField(ctx context.Context, params model.LogFileCopyFieldReq) (string, error)
}

func LogFile

func LogFile() 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 ILogImage interface {
	// 绘图日志详情
	Detail(ctx context.Context, id string) (*model.LogImage, error)
	// 绘图日志分页列表
	Page(ctx context.Context, params model.LogImagePageReq) (*model.LogImagePageRes, error)
	// 绘图日志详情复制字段值
	CopyField(ctx context.Context, params model.LogImageCopyFieldReq) (string, error)
}

func LogImage

func LogImage() 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)
}

func LogText

func LogText() ILogText

type ILogVideo

type ILogVideo interface {
	// 视频日志详情
	Detail(ctx context.Context, id string) (*model.LogVideo, error)
	// 视频日志分页列表
	Page(ctx context.Context, params model.LogVideoPageReq) (*model.LogVideoPageRes, error)
	// 视频日志详情复制字段值
	CopyField(ctx context.Context, params model.LogVideoCopyFieldReq) (string, error)
}

func LogVideo

func LogVideo() 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
}

func Model

func Model() IModel

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)
}

func ModelAgent

func ModelAgent() IModelAgent

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
}

func Notice

func Notice() INotice

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 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
}

func Provider

func Provider() IProvider

type IQuota

type IQuota interface {
	// 额度通知任务
	NoticeTask(ctx context.Context)
	// 额度清零任务
	ClearTask(ctx context.Context)
}

func Quota

func Quota() 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)
}

func Reseller

func Reseller() IReseller

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
}

func Session

func Session() ISession

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
	// 站点配置
	Site(ctx context.Context, params model.SiteConfigDetailReq) *model.SiteConfig
	// 根据域名获取站点配置
	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 {
	// 统计任务
	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)
}

func SysAdmin

func SysAdmin() ISysAdmin

type ISysConfig

type ISysConfig interface {
	// 更新配置
	Update(ctx context.Context, params model.SysConfigUpdateReq) (*entity.SysConfig, 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
	// 系统配置
	Config(ctx context.Context, params model.SysConfigReq) (*model.SysConfig, 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)
	// 文件
	File(ctx context.Context, fileName string) (string, error)
	// 文件任务
	Task(ctx context.Context)
}

func TaskFile

func TaskFile() ITaskFile

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)
	// 视频文件
	Video(ctx context.Context, fileName string) (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)
}

func User

func User() IUser

Jump to

Keyboard shortcuts

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