service

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAdminReseller added in v1.5.0

func RegisterAdminReseller(i IAdminReseller)

func RegisterAdminUser

func RegisterAdminUser(i IAdminUser)

func RegisterApp

func RegisterApp(i IApp)

func RegisterAudio added in v0.5.0

func RegisterAudio(i IAudio)

func RegisterAuth

func RegisterAuth(i IAuth)

func RegisterChat

func RegisterChat(i IChat)

func RegisterCommon

func RegisterCommon(i ICommon)

func RegisterCorp added in v0.3.0

func RegisterCorp(i ICorp)

func RegisterDashboard

func RegisterDashboard(i IDashboard)

func RegisterFinance added in v0.4.0

func RegisterFinance(i IFinance)

func RegisterGroup added in v1.5.0

func RegisterGroup(i IGroup)

func RegisterImage added in v0.4.0

func RegisterImage(i IImage)

func RegisterKey

func RegisterKey(i IKey)

func RegisterLog added in v1.3.0

func RegisterLog(i ILog)

func RegisterMidjourney added in v0.4.0

func RegisterMidjourney(i IMidjourney)

func RegisterModel

func RegisterModel(i IModel)

func RegisterModelAgent

func RegisterModelAgent(i IModelAgent)

func RegisterNotice added in v1.4.0

func RegisterNotice(i INotice)

func RegisterNoticeTemplate added in v1.7.0

func RegisterNoticeTemplate(i INoticeTemplate)

func RegisterReseller added in v1.5.0

func RegisterReseller(i IReseller)

func RegisterSession

func RegisterSession(i ISession)

func RegisterSiteConfig added in v1.0.0

func RegisterSiteConfig(i ISiteConfig)

func RegisterStatistics added in v0.5.0

func RegisterStatistics(i IStatistics)

func RegisterSysAdmin

func RegisterSysAdmin(i ISysAdmin)

func RegisterSysConfig added in v1.3.0

func RegisterSysConfig(i ISysConfig)

func RegisterUser

func RegisterUser(i IUser)

Types

type IAdminReseller added in v1.5.0

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, params model.ResellerPermissionsReq) error
	// 代理商批量操作
	BatchOperate(ctx context.Context, params model.ResellerBatchOperateReq) error
}

func AdminReseller added in v1.5.0

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, params model.UserPermissionsReq) 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)
	// 新建应用密钥
	CreateKey(ctx context.Context, params model.AppCreateKeyReq) (string, error)
	// 应用密钥配置
	KeyConfig(ctx context.Context, params model.AppKeyConfigReq) (k string, err 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
	// 应用密钥批量操作
	KeyBatchOperate(ctx context.Context, params model.AppKeyBatchOperateReq) (keys string, err error)
	// 应用密钥导出
	KeyExport(ctx context.Context, params model.AppKeyExportReq) (string, error)
}

func App

func App() IApp

type IAudio added in v0.5.0

type IAudio interface {
	// 音频日志详情
	Detail(ctx context.Context, id string) (*model.Audio, error)
	// 音频日志分页列表
	Page(ctx context.Context, params model.AudioPageReq) (*model.AudioPageRes, error)
	// 音频日志详情复制字段值
	CopyField(ctx context.Context, params model.AudioCopyFieldReq) (string, error)
}

func Audio added in v0.5.0

func Audio() IAudio

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 IChat

type IChat interface {
	// 聊天日志详情
	Detail(ctx context.Context, id string) (*model.Chat, error)
	// 聊天日志分页列表
	Page(ctx context.Context, params model.ChatPageReq) (*model.ChatPageRes, error)
	// 聊天导出
	Export(ctx context.Context, params model.ChatExportReq) (string, error)
	// 聊天批量操作
	BatchOperate(ctx context.Context, params model.ChatBatchOperateReq) error
	// 聊天日志详情复制字段值
	CopyField(ctx context.Context, params model.ChatCopyFieldReq) (string, error)
}

func Chat

func Chat() IChat

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 ICorp added in v0.3.0

type ICorp interface {
	// 新建公司
	Create(ctx context.Context, params model.CorpCreateReq) (string, error)
	// 更新公司
	Update(ctx context.Context, params model.CorpUpdateReq) error
	// 更改公司公开状态
	ChangePublic(ctx context.Context, params model.CorpChangePublicReq) error
	// 更改公司状态
	ChangeStatus(ctx context.Context, params model.CorpChangeStatusReq) error
	// 删除公司
	Delete(ctx context.Context, id string) error
	// 公司详情
	Detail(ctx context.Context, id string) (*model.Corp, error)
	// 公司分页列表
	Page(ctx context.Context, params model.CorpPageReq) (*model.CorpPageRes, error)
	// 公司列表
	List(ctx context.Context, params model.CorpListReq) ([]*model.Corp, error)
	// 公司批量操作
	BatchOperate(ctx context.Context, params model.CorpBatchOperateReq) error
}

func Corp added in v0.3.0

func Corp() ICorp

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 added in v0.4.0

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 added in v0.4.0

func Finance() IFinance

type IGroup added in v1.5.0

type IGroup interface {
	// 新建分组
	Create(ctx context.Context, params model.GroupCreateReq) (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 added in v1.5.0

func Group() IGroup

type IImage added in v0.4.0

type IImage interface {
	// 绘图日志详情
	Detail(ctx context.Context, id string) (*model.Image, error)
	// 绘图日志分页列表
	Page(ctx context.Context, params model.ImagePageReq) (*model.ImagePageRes, error)
	// 绘图日志详情复制字段值
	CopyField(ctx context.Context, params model.ImageCopyFieldReq) (string, error)
}

func Image added in v0.4.0

func Image() IImage

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
	// 密钥绑定分组
	Group(ctx context.Context, params model.KeyGroupReq) error
	// 检查任务
	CheckTask(ctx context.Context, enableError common.EnableError)
}

func Key

func Key() IKey

type ILog added in v1.3.0

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

func Log added in v1.3.0

func Log() ILog

type IMidjourney added in v0.4.0

type IMidjourney interface {
	// Midjourney详情
	Detail(ctx context.Context, id string) (*model.Midjourney, error)
	// Midjourney分页列表
	Page(ctx context.Context, params model.MidjourneyPageReq) (*model.MidjourneyPageRes, error)
}

func Midjourney added in v0.4.0

func Midjourney() IMidjourney

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
}

func ModelAgent

func ModelAgent() IModelAgent

type INotice added in v1.4.0

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)
	// 发送消息通知邮件
	SendMail(ctx context.Context, notice *entity.Notice) (err error)
	// 消息通知批量操作
	BatchOperate(ctx context.Context, params model.NoticeBatchOperateReq) error
	// 额度预警任务
	QuotaWarningTask(ctx context.Context)
}

func Notice added in v1.4.0

func Notice() INotice

type INoticeTemplate added in v1.7.0

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 added in v1.7.0

func NoticeTemplate() INoticeTemplate

type IReseller added in v1.5.0

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 added in v1.5.0

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 added in v1.0.0

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 added in v1.0.0

func SiteConfig() ISiteConfig

type IStatistics added in v0.5.0

type IStatistics interface {
	// 统计任务
	StatisticsTask(ctx context.Context)
	// 统计数据
	StatisticsData(ctx context.Context, collection string, index string, lastTimeKey string, lastIdKey string)
}

func Statistics added in v0.5.0

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 added in v1.3.0

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) (*model.SysConfig, error)
	// 初始化配置
	Init(ctx context.Context) (sysConfig *entity.SysConfig, err error)
	// 默认配置
	Default() *do.SysConfig
}

func SysConfig added in v1.3.0

func SysConfig() ISysConfig

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