Documentation ¶
Index ¶
- func RegisterArticle(i IArticle)
- func RegisterAttachment(i IAttachment)
- func RegisterBizCtx(i IBizCtx)
- func RegisterCommon(i ICommon)
- func RegisterConfig(i IConfig)
- func RegisterMiddleware(i IMiddleware)
- func RegisterPgCoin(i IPgCoin)
- func RegisterRbac(i IRbac)
- func RegisterSmsTpl(i ISmsTpl)
- func RegisterSysLog(i ISysLog)
- func RegisterSysMap(i ISysMap)
- func RegisterUpload(i IUpload)
- func RegisterUser(i IUser)
- func RegisterVideo(i IVideo)
- func RegisterVideoBuy(i IVideoBuy)
- func RegisterVideoCate(i IVideoCate)
- func RegisterVideoPlay(i IVideoPlay)
- type IArticle
- type IAttachment
- type IBizCtx
- type ICommon
- type IConfig
- type IMiddleware
- type IPgCoin
- type IRbac
- type ISmsTpl
- type ISysLog
- type ISysMap
- type IUpload
- type IUser
- type IVideo
- type IVideoBuy
- type IVideoCate
- type IVideoPlay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterArticle ¶
func RegisterArticle(i IArticle)
func RegisterAttachment ¶
func RegisterAttachment(i IAttachment)
func RegisterBizCtx ¶
func RegisterBizCtx(i IBizCtx)
func RegisterCommon ¶
func RegisterCommon(i ICommon)
func RegisterConfig ¶
func RegisterConfig(i IConfig)
func RegisterMiddleware ¶
func RegisterMiddleware(i IMiddleware)
func RegisterPgCoin ¶ added in v1.0.5
func RegisterPgCoin(i IPgCoin)
func RegisterRbac ¶
func RegisterRbac(i IRbac)
func RegisterSmsTpl ¶
func RegisterSmsTpl(i ISmsTpl)
func RegisterSysLog ¶
func RegisterSysLog(i ISysLog)
func RegisterSysMap ¶
func RegisterSysMap(i ISysMap)
func RegisterUpload ¶
func RegisterUpload(i IUpload)
func RegisterUser ¶
func RegisterUser(i IUser)
func RegisterVideo ¶ added in v1.0.1
func RegisterVideo(i IVideo)
func RegisterVideoBuy ¶ added in v1.0.1
func RegisterVideoBuy(i IVideoBuy)
func RegisterVideoCate ¶ added in v1.0.1
func RegisterVideoCate(i IVideoCate)
func RegisterVideoPlay ¶ added in v1.0.1
func RegisterVideoPlay(i IVideoPlay)
Types ¶
type IArticle ¶
type IArticle interface { // SaveArticle 保存文章数据 SaveArticle(ctx context.Context, item entity.Article) error // GetArticleList 获取文章列表 GetArticleList(ctx context.Context, in model.ArticleGetListInput) (out *model.ArticleGetListOutput, err error) // GetArticleDetail 获取文章详情 GetArticleDetail(ctx context.Context, id uint) (detail *model.ArticleDetailItem, err error) // SaveCategory 保存文章分类数据 SaveCategory(ctx context.Context, item entity.ArticleCategory) error // GetCategoryTreeList 获取文章分类树形列表 GetCategoryTreeList(ctx context.Context, where interface{}) ([]map[string]interface{}, error) // GetCategoryAssocTreeList 获取文章分类关联列表 GetCategoryAssocTreeList(ctx context.Context) ([]map[string]interface{}, error) // ArticleModel 文章Model ArticleModel() *base.TblBaseService // CategoryModel 文章分类Model CategoryModel() *base.TblBaseService // ProcessDetailById 通过文章ID获取文章详情 ProcessDetailById(ctx context.Context, id uint, pointer interface{}) error // CheckExistsById 通过文章ID检测文章是否存在 CheckExistsById(ctx context.Context, id uint) bool // ArticleWhere 处理并获取文章条件 ArticleWhere(in model.ArticleWhereItem) map[string]interface{} // FormatArticle 格式化文章详情状态 FormatArticle(detail *model.ArticleDetailFmtItem) }
type IAttachment ¶
type IAttachment interface { // SaveAttachment 保存文件信息 SaveAttachment(ctx context.Context, attachs ...entity.Attachment) (attachId uint, err error) // AttachmentModel 附件Model AttachmentModel() *base.TblBaseService // ProcessAttachmentListAndTotal 处理并获取附件列表和总数 ProcessAttachmentListAndTotal(ctx context.Context, in model.CommonListAndTotalInput, list interface{}, total *int) error // ProcessAttachmentDetailByHasher 处理并通过Hash值获取附件详情 ProcessAttachmentDetailByHasher(ctx context.Context, hasher string, detail interface{}) error // ProcessAttachmentDetailByAttachId 处理并通过附件ID值获取附件详情 ProcessAttachmentDetailByAttachId(ctx context.Context, attachId string, detail interface{}) error // ProcessAttachmentDetail 处理并通过值获取附件详情 ProcessAttachmentDetail(ctx context.Context, where interface{}, detail interface{}) error // CheckAttachmentExistsByHasher 通过hasher检测附件是否存在 CheckAttachmentExistsByHasher(ctx context.Context, hasher string) bool // CheckAttachmentExistsByAttachId 通过附件ID检测附件是否存在 CheckAttachmentExistsByAttachId(ctx context.Context, attachId string) bool // CheckAttachmentExists 检测附件是否存在 CheckAttachmentExists(ctx context.Context, where interface{}) (bool, error) // ProcessListAndTotal 获取文件列表和数量 ProcessListAndTotal(ctx context.Context, in model.CommonListAndTotalInput, list interface{}, total *int) error // ProcessScan 扫描文件数据 ProcessScan(ctx context.Context, where, scan interface{}, sort ...string) error // ProcessDetailById 通过文件ID获取文件详情 ProcessDetailById(ctx context.Context, id uint, detail interface{}) error // ProcessDetailByAttachId 通过附件ID获取文件详情 ProcessDetailByAttachId(ctx context.Context, attachId string, detail interface{}) error // ProcessTotal 获取附件总数 ProcessTotal(ctx context.Context, where interface{}) (int, error) // CheckExists 检查附件是否存在 CheckExists(ctx context.Context, where interface{}) bool // CheckExistsById 通过文件ID检查附件是否存在 CheckExistsById(ctx context.Context, id uint) bool // CheckExistsByAttachId 通过附件ID检查附件是否存在 CheckExistsByAttachId(ctx context.Context, attachId string) bool // ProcessAttachUrlByAttachId 通过附件ID获取附件地址 ProcessAttachUrlByAttachId(ctx context.Context, attachId string) (string, error) // MustAttachUrlByAttachId 通过附件ID获取附件URL地址 MustAttachUrlByAttachId(ctx context.Context, attachId string) string // AttachUrlAttrMapByAttachId 通过附件ID获取附件属性MAP AttachUrlAttrMapByAttachId(ctx context.Context, attachId ...string) (map[string]*model.AttachmentUrlAttrItem, error) // MustAttachUrlAttrMapByAttachId 通过附件ID获取附件地址属性MAP MustAttachUrlAttrMapByAttachId(ctx context.Context, attachId ...string) map[string]*model.AttachmentUrlAttrItem }
func Attachment ¶
func Attachment() IAttachment
type IBizCtx ¶
type IBizCtx interface { // Init 初始化自定义上下文 Init(r *ghttp.Request, customCtx *model.Context) // Get 获取自定义上下文 Get(ctx context.Context) *model.Context // SetUser 设置登录用户信息 SetUser(ctx context.Context, user *model.UserAccountItem) // SetData 设置其他参数 SetData(ctx context.Context, data map[enums.ContextDataKey]interface{}) // SetDataValue 设置自定义参数值 SetDataValue(ctx context.Context, key enums.ContextDataKey, value interface{}) // GetUser 获取用户信息 GetUser(ctx context.Context) *model.UserAccountItem // GetData 获取自定义数据 GetData(ctx context.Context) map[enums.ContextDataKey]interface{} // GetUid 获取当前用户ID GetUid(ctx context.Context) uint // GetValue 获取自定义参数值 GetValue(ctx context.Context, key enums.ContextDataKey) interface{} }
type ICommon ¶
type ICommon interface { // CommonMaps 公共map列表 CommonMaps(ctx context.Context, mapKey ...string) (map[string]interface{}, error) // GetSign 获取安全规则签名 GetSign(ctx context.Context, tag enums.SafeTags) (*models.SafeSignItem, error) // Verify 验证安全规则签名属性 Verify(ctx context.Context, sign string, tag enums.SafeTags, isRemove ...bool) (*models.SignItem, error) // EncryptExampleValue 安全签名-加密示例值(例如:登录密码、手机号加密等) EncryptExampleValue(ctx context.Context, text, secret string) (string, error) }
type IConfig ¶
type IConfig interface { // SaveConfig 保存配置数据 SaveConfig(ctx context.Context, params ...entity.Config) error // RemoveConfigCache 清除配置缓存 RemoveConfigCache(ctx context.Context, keys ...string) // GetVar 读取业务配置 // 获取后台配置业务配置,例如:系统设置,基础配置,短信配置,第三方授权配置,支付配置等 // Example: // New().GetVar(ctx, `basic`, `keywords`) // 配置名+配置组模式:获取基础配置类型下,关键词配置 // New().GetVar(ctx, `keywords`) // 配置名模式:直接获取关键词配置(注:确保配置名唯一) GetVar(ctx context.Context, names ...string) (*g.Var, error) // GetGroupVar 获取业务配置组 // 获取业务后台配置的配置组,例如:基础配置,短信配置,支付配置等 // Example: // New().GetGroupVar(ctx, `basic`) // 获取所有基础配置 // New().GetGroupVar(ctx, `sms_tencent`) // 腾讯短信配置 // Output:&{`appid`:`xxxx`, `secret`:`xxxx`....} GetGroupVar(ctx context.Context, groupName string) (*g.Var, error) // MustGetGroupVar 获取配置组 MustGetGroupVar(ctx context.Context, groupName string) *g.Var // MustGetVar 获取业务配置Var类型 MustGetVar(ctx context.Context, names ...string) *g.Var // String 获取配置强制转换String类型 String(ctx context.Context, names ...string) string // Uint 获取配置值并强制为Uint类型 Uint(ctx context.Context, names ...string) uint // Int 配置内容强制转换为Int类型 Int(ctx context.Context, names ...string) int // Map 获取配置组并转换为Map类型 Map(ctx context.Context, groupName string) map[string]interface{} // GroupTreeList 获取配置组树形列表 GroupTreeList(ctx context.Context, in model.ConfigGroupTreeListInput) (treeList []model.ConfigGroupTreeItem, err error) // GroupDetail 获取配置详情 GroupDetail(ctx context.Context, id uint) (detail *model.ConfigGroupCategoryItem, err error) // SaveConfigGroup 保存配置组 SaveConfigGroup(ctx context.Context, params ...entity.ConfigGroup) error // ProcessGroupScan 扫描配置组数据 ProcessGroupScan(ctx context.Context, where, scan interface{}) error // ProcessGroupGroupNameById 通过配置组ID获取配置组关联名 ProcessGroupGroupNameById(ctx context.Context, id ...uint) (map[uint]string, error) // ProcessGroupTotal 获取配置组总数 ProcessGroupTotal(ctx context.Context, where interface{}) (int, error) // ProcessGroupDetailById 获取配置组详情 ProcessGroupDetailById(ctx context.Context, id uint, detail interface{}) error // ProcessGroupDetailByGroupName 根据配置组名获取配置详情 ProcessGroupDetailByGroupName(ctx context.Context, groupName string, detail interface{}) error // ProcessGroupExists 验证配置组是否存在 ProcessGroupExists(ctx context.Context, where interface{}) (bool, error) // ProcessGroupExistsById 根据配置组ID验证配置组是否存在 ProcessGroupExistsById(ctx context.Context, id uint) bool // ProcessGroupExistsByGroupName 根据配置组组名验证配置组是否存在 ProcessGroupExistsByGroupName(ctx context.Context, name string) bool // List 获取配置列表 List(ctx context.Context, in model.ConfigListInput) (rows []model.ConfigDetailItem, err error) // ProcessConfigScan 处理并扫描业务配置 ProcessConfigScan(ctx context.Context, where, scan interface{}) error // ProcessConfigByGroup 根据配置组名获取配置组数据 ProcessConfigByGroup(ctx context.Context, name string, group interface{}) error // ProcessConfigMapByGroup 根据配置组获取配置组MAP ProcessConfigMapByGroup(ctx context.Context, name string) (map[string]model.ConfigNameValueItem, error) // ProcessTotal 统计配置总数 ProcessTotal(ctx context.Context, where interface{}) (int, error) // ProcessExists 检测配置是否存在 ProcessExists(ctx context.Context, where interface{}) (bool, error) // ProcessExistsByGroupName 根据配置组名检测配置是否存在 ProcessExistsByGroupName(ctx context.Context, groupName string) bool // ProcessExistsByGroupId 根据配置组ID检测配置是否存在 ProcessExistsByGroupId(ctx context.Context, groupId uint) bool // ProcessConfigValueByNameAndGroup 根据配置名和配置组获取配置值 ProcessConfigValueByNameAndGroup(ctx context.Context, name, groupName string) (*string, error) // ProcessConfigIdByNameAndGroup 通过配置名和配置组ID获取配置ID ProcessConfigIdByNameAndGroupId(ctx context.Context, name []string, groupId []uint) (map[string]uint, error) // ProcessConfigDetailMapByName 通过配置名获取配置详情MAP ProcessConfigDetailMapByName(ctx context.Context, name []string) (map[string]model.ConfigIdByNameAndGroupItem, error) }
type IMiddleware ¶
type IMiddleware interface { // Auth 用户授权认证-第一层 Auth(r *ghttp.Request) // AuthWithe 白名单-用户授权认证(某些特定场景下,允许用户在不登录的情况下访问接口) AuthWithe(r *ghttp.Request) // AdminAuth 管理员认证-必须在Auth中间件之后(第二层) AdminAuth(r *ghttp.Request) // AdminAuthApi 管理员接口鉴权-必须在AdminAuth中间件之后(第三层) AdminAuthApi(r *ghttp.Request) // WriteOperateLog 写入操作日志 WriteOperateLog(r *ghttp.Request) // GetToken 获取Token GetToken(r *ghttp.Request) (string, error) // Ctx 上下文自定义初始化 Ctx(r *ghttp.Request) // ResponseHandler 响应资源处理 ResponseHandler(r *ghttp.Request) // 销毁登录缓存用户信息-用于修改用户资料之后,更新缓存信息 RemoveLoginCache(r *ghttp.Request) // RemoveAdminAuthTokenCache 操作管理员状态,移除管理员缓存Token RemoveAdminAuthTokenCache(r *ghttp.Request) // RefreshSysMap 刷新系统字典值中间件 RefreshSysMap(r *ghttp.Request) }
func Middleware ¶
func Middleware() IMiddleware
type IPgCoin ¶ added in v1.0.5
type IPgCoin interface { // GetBillList 获取账单列表 GetBillList(ctx context.Context, in model.PGCoinBillListInput) (out *model.PGCoinBillListOutput, err error) // GetBillDetail 获取账单详情 GetBillDetail(ctx context.Context, billId uint) (out *model.PGCoinBillDetailOutput, err error) // CorrectionUserAvailablePGCoin 根据盘古币账单为基础校正用户可用盘古币 CorrectionUserAvailablePGCoin(ctx context.Context, uid uint) error // GetUserAvailablePGCoinBillList 获取用户可用盘古币账单列表 GetUserAvailablePGCoinBillList(ctx context.Context, uid uint) (out *model.UserAvailablePGCoinListOutput, err error) // UpdatePGCoinBillComplete 盘古币消费完成-更新状态 UpdatePGCoinBillComplete(ctx context.Context, idSet []uint) error // UpdateDeducePGCoinBill 更新减扣盘古币账单数量 UpdateDeducePGCoinBill(ctx context.Context, id, moreCoin uint) error // UpdateBillExpiredAt 更新盘古币账单效期 UpdateBillExpiredAt(ctx context.Context, in model.UpdateBillExpiredInput) error // QueryBillDetail 查询账单详情 QueryBillDetail(ctx context.Context, id uint) (detail *model.PGCoinBillDetailItem, err error) // GenPGCoinBillItem 生成盘古币账单流水明细 GenPGCoinBillItem(ctx context.Context, en ...entity.PanguCoinBillItem) error // GetBillItemList 获取账单明细列表 GetBillItemList(ctx context.Context, where interface{}) (list []entity.PanguCoinBillItem, err error) // OrderModel 盘古币充值订单Model OrderModel() *base.TblBaseService // BillModel 盘古币账单Model BillModel() *base.TblBaseService // TransactionModel 盘古币流水Model TransactionModel() *base.TblBaseService // BillItemModel 盘古币账单明细Model BillItemModel() *base.TblBaseService // Config 读取盘古币配置 Config(ctx context.Context) (config *model.PGCConfigItem, err error) // GetOrderList 获取盘古币充值订单列表 GetOrderList(ctx context.Context, in model.PGCoinOrderListInput) (out *model.PGCoinOrderListOutput, err error) // GetOrderDetail 获取盘古币充值订单详情 GetOrderDetail(ctx context.Context, id uint, formSide enums.FormSide) (detail *model.PGCoinOrderDetailItem, err error) // CreateRechargePGCoin 创建充值盘古币订单数据 CreateRechargePGCoin(ctx context.Context, in model.PGCoinRechargeInput) (out *model.PGCoinRechargeOutput, err error) // GetPayPGCoinDetail 获取盘古币支付信息 GetPayPGCoinDetail(ctx context.Context, in model.PGCoinPayDetailInput) (out *model.PGCoinPayDetailOutput, err error) // NotifyPGCoin 回调盘古币支付状态 NotifyPGCoin(ctx context.Context, in model.PGCoinPayNotifyInput) error // GiveUserPGCoin 给用户账户赠送盘古币 GiveUserPGCoin(ctx context.Context, uid, coins uint, t enums.PGCoinBillType) error // GenPGCoinBillTX 生成盘古币账单-事务处理 GenPGCoinBillTX(ctx context.Context, in model.PGCoinRechargeBillInput) error // GenPGCoinConsumeBillTX 生成消费盘古币账单-事务处理 GenPGCoinConsumeBillTX(ctx context.Context, in model.PGCoinConsumeInput) error // GenPGCoinBill 生成盘古币账单数据 GenPGCoinBill(ctx context.Context, in model.PGCoinRechargeBillInput) error // GenPGCoinConsumeBill 生成盘古币消费账单 GenPGCoinConsumeBill(ctx context.Context, in model.PGCoinConsumeInput) error // GetUserAvailableFundsAndBill 获取用户可用资金和账单 GetUserAvailableFundsAndBill(ctx context.Context, uid uint) (funds *entity.UserFunds, bill *model.UserAvailablePGCoinListOutput, err error) // GetTransactionList 获取盘古币流水列表 GetTransactionList(ctx context.Context, in model.PGCoinTransactionListInput) (out *model.PGCoinTransactionListOutput, err error) // GenPGCoinTransaction 生成盘古币流水记录 GenPGCoinTransaction(ctx context.Context, uid, coin uint, tranType enums.PGCoinTransactionType) (tno string, err error) // PGCoinBillWhere 盘古币账单条件 PGCoinBillWhere(in model.PGCoinBillWhere) map[string]interface{} // TransactionWhereModel 实例盘古币流水查询条件Model TransactionWhereModel(ctx context.Context, in model.PGCoinTransactionWhere) *gdb.Model // OrderWhereModel 盘古币订单查询Model OrderWhereModel(ctx context.Context, in model.PGCoinOrderWhere) *gdb.Model }
type IRbac ¶
type IRbac interface { // AuthAdminMenu 获取管理员授权权限菜单列表 AuthAdminMenu(ctx context.Context) (treeList []map[string]interface{}, err error) // AuthAdminMenuActionCode 获取管理员授权菜单权限码 AuthAdminMenuActionCode(ctx context.Context) (out *model.PermCodeActionItem, err error) // AuthAdminGetDetail 获取鉴权管理员详情 AuthAdminGetDetail(ctx context.Context) (out *model.UserAdminAuthDetailOutput) // AuthAdminPermId 获取管理员授权权限ID集合 AuthAdminPermId(ctx context.Context) ([]uint, error) // SaveAdminDepartment 保存管理员关联部门数据 SaveAdminDepartment(ctx context.Context, adminId uint, departId ...uint) error // GetDepartPeopleNumByDepartId 通过部门ID-获取部门人数MAP GetDepartPeopleNumByDepartId(ctx context.Context, departId ...uint) (map[uint]uint, error) // RemoveAdminDepartByAid 通过管理员ID解除关联部门-适用于,后台编辑管理员,移除部门之后,未添加新部门,后置清理掉部门 RemoveAdminDepartByAid(ctx context.Context, adminId uint) error // GetDepartmentIdByAid 通过管理员ID获取部门ID GetDepartmentIdByAid(ctx context.Context, aid ...uint) ([]uint, error) // CheckAdminDepartByAid 通过管理员ID检测管理员是否关联部门 CheckAdminDepartByAid(ctx context.Context, adminId uint) bool // CheckAdminDepartByDepartId 通过部门ID检测部门是否关联管理员 CheckAdminDepartByDepartId(ctx context.Context, departId uint) bool // ProcessAdminIdAndDepartIdList 获取管理员ID关联部门ID列表 ProcessAdminIdAndDepartIdList(ctx context.Context, where interface{}) (rows []model.AdminIdAndDepartIdItem, err error) // AddAdminInvite 添加管理员邀请记录 AddAdminInvite(ctx context.Context, in model.AdminInviteAddInput) (out *model.AdminInviteAddOutput, err error) // GetInviteList 获取管理员邀请列表 GetInviteList(ctx context.Context, in model.AdminInviteGetListInput) (out *model.AdminInviteGetListOutput, err error) // GetInviteDetail 获取管理员邀请记录详情 GetInviteDetail(ctx context.Context, id uint) (detail *model.AdminInviteDetailItem, err error) // RefreshInviteExpired 刷新邀请效期时间 RefreshInviteExpired(ctx context.Context, id uint) error // GetInviteExpired 获取邀请过期时间 GetInviteExpired(ctx context.Context) string // CheckInviteExistsByToken 通过Token检测邀请信息是否存在 CheckInviteExistsByToken(ctx context.Context, token string) bool // CheckInviteValidByToken 通过邀请Token检测邀请信息是否有效 CheckInviteValidByToken(ctx context.Context, token string) error // GetInviteValidDetailById 通过邀请ID获取邀请有效详情数据 GetInviteValidDetailById(ctx context.Context, id uint) (detail *model.AdminInviteValidItem, err error) // GetInviteUserByToken 通过邀请ID获取用户权限信息 GetInviteUserByToken(ctx context.Context, token string) (detail *model.AdminInviteUserValidItem, err error) // SaveAdminUser 保存管理员信息 SaveAdminUser(ctx context.Context, user model.UserAdminSaveItem) error // GetAdminUserList 获取管理员列表 GetAdminUserList(ctx context.Context, in model.UserAdminGetListInput) (out *model.UserAdminGetListOutput, err error) // GetUserAdminDetail 获取管理员详情 GetUserAdminDetail(ctx context.Context, id uint) (detail *model.UserAdminGetDetailOutput, err error) // RemoveUserAdmin 移除管理员信息 RemoveUserAdmin(ctx context.Context, id uint) error // AuthInviteAdminUser 登录用户直接授权绑定用户 AuthInviteAdminUser(ctx context.Context, token string) error // AddInviteAdminUser 添加管理员邀请注册用户 AddInviteAdminUser(ctx context.Context, invite model.UserAdminInviteAddItem) (err error) // ProcessAdminDetail 获取管理员详情 ProcessAdminDetail(ctx context.Context, where, pointer interface{}) error // ProcessAdminDetailByAid 通过管理员ID获取管理员信息 ProcessAdminDetailByAid(ctx context.Context, aid uint, pointer interface{}) error // CheckAdminExistsId 检测管理员是否存在 CheckAdminExistsId(ctx context.Context, aid uint) bool // GetUidByAid 通过管理员ID获取用户ID GetUidByAid(ctx context.Context, id ...uint) ([]uint, error) // CheckAdminExistsByUid 通过用户ID检测是否注册管理员 CheckAdminExistsByUid(ctx context.Context, uid uint) bool // SaveDepartment 保存部门数据 SaveDepartment(ctx context.Context, depart model.DepartmentSaveInput) error // GetDepartmentTreeList 获取部门列表-并构建成树形结构 GetDepartmentTreeList(ctx context.Context) ([]map[string]interface{}, error) // GetDepartmentFindTreeList 获取部门树形列表并查找部门ID GetDepartmentFindTreeList(ctx context.Context, status enums.DepartStatus, departId ...uint) ([]map[string]interface{}, error) // GetDepartmentDetail 获取部门详情 GetDepartmentDetail(ctx context.Context, departId uint) (detail *model.DepartmentDetailItem, err error) // RemoveDepartment 删除部门 RemoveDepartment(ctx context.Context, departId uint) error // GetDepartNameByDepartId 通过部门ID获取部门名称 GetDepartNameByDepartId(ctx context.Context, departId ...uint) (rows []model.DepartmentNameItem, err error) // ProcessDepartmentList 处理并获取部门列表 ProcessDepartmentList(ctx context.Context, where interface{}) ([]model.DepartmentTreeItem, error) // CheckChildDepartByDepartId 通过部门ID检查子级部门是否存在 CheckChildDepartByDepartId(ctx context.Context, departId uint) bool // CheckDepartmentById 通过部门ID检测部门是否存在 CheckDepartmentById(ctx context.Context, id uint) bool // DepartmentTotalById 通过部门ID获取部门数量 DepartmentTotalById(ctx context.Context, id ...uint) int // CheckDepartmentIsDisableById 通过部门ID检测部门是否被禁用:true正常,false禁用 CheckDepartmentIsDisableById(ctx context.Context, id uint) bool // SaveDepartmentRoles 保存部门绑定角色数据 SaveDepartmentRoles(ctx context.Context, departId uint, roleId ...uint) error // GetDepartRoleIdByDepartId 通过部门ID获取关联的角色ID GetDepartRoleIdByDepartId(ctx context.Context, departId ...uint) ([]uint, error) // GetPermissionsIdByDepartId 通过部门ID获取权限ID集合 GetPermissionsIdByDepartId(ctx context.Context, departId ...uint) ([]uint, error) // RemoveDepartmentRolesByRoleId 通过角色ID删除部门绑定 RemoveDepartmentRolesByRoleId(ctx context.Context, roleId uint) error // RemoveDepartmentRoleByDepartId 通过部门ID解除角色关联 RemoveDepartmentRoleByDepartId(ctx context.Context, departId uint) error // PermissionsModel 权限模型 PermissionsModel() *base.TblBaseService // AssocModel 权限关联角色模型 AssocModel() *base.TblBaseService // RolesModel 角色模型 RolesModel() *base.TblBaseService // DepartmentRoleModel 部门关联角色Model DepartmentRoleModel() *base.TblBaseService // DepartmentModel 部门Model DepartmentModel() *base.TblBaseService // AdminDepartmentModel 管理员部门关联Model AdminDepartmentModel() *base.TblBaseService // UserAdminModel 管理员用户Model UserAdminModel() *base.TblBaseService // InviteModel 管理员邀请Model InviteModel() *base.TblBaseService // SavePermissions 保存权限 SavePermissions(ctx context.Context, pm entity.Permissions) error // GetPermTreeList 获取权限树形列表 GetPermTreeList(ctx context.Context) ([]map[string]interface{}, error) // GetPermDetail 获取权限详情 GetPermDetail(ctx context.Context, permId uint) (*entity.Permissions, error) // GetPermMenuTreeList 菜单列表-获取权限菜单树形列表 GetPermMenuTreeList(ctx context.Context, id ...uint) ([]map[string]interface{}, error) // GetPermAssocTreeListByAssocId 通过关联ID-获取关联权限树形列表(角色关联、管理员关联) GetPermAssocTreeListByAssocId(ctx context.Context, assocType enums.PermAssocType, assocId uint) ([]map[string]interface{}, error) // GetPermAssocTreeList 获取权限关联树形列表-true关联子级菜单类型,false权限关联角色 GetPermAssocTreeList(ctx context.Context, assocTreeType bool, findId ...uint) ([]map[string]interface{}, error) // GetMenuActionCode 通过权限ID获取权限码 GetMenuActionCode(ctx context.Context, id ...uint) (out *model.PermCodeActionItem, err error) // PermCustomUpdateColumns 自定义字段更新权限字段 PermCustomUpdateColumns(ctx context.Context, in model.PermCustomUpdateColumnInput) error // RemovePermissions 删除权限数据 RemovePermissions(ctx context.Context, id uint) error // SavePermAssoc 保存关联权限数据 SavePermAssoc(ctx context.Context, assocId uint, assocType enums.PermAssocType, permId ...uint) error // RemovePermAssocByPmId 权限删除或禁用移除关联 RemovePermAssocByPmId(ctx context.Context, pmId uint) error // RemovePermAssocByAssocId 通过关联ID解除权限关联 RemovePermAssocByAssocId(ctx context.Context, assocType enums.PermAssocType, assocId ...uint) error // GetPermissionsIdByRoleId 通过角色ID-获取权限ID集合 GetPermissionsIdByRoleId(ctx context.Context, roleId ...uint) ([]uint, error) // GetPermissionsIdByAdminId 通过管理员ID-获取权限ID集合 GetPermissionsIdByAdminId(ctx context.Context, adminId uint) ([]uint, error) // GetPermissionsIdByAssocId 通过关联ID和类型获取权限ID集合 GetPermissionsIdByAssocId(ctx context.Context, assocType enums.PermAssocType, assocId ...uint) ([]uint, error) // CheckPermissionsExistsById 通过权限ID检测权限是否存在 CheckPermissionsExistsById(ctx context.Context, id uint) bool // CheckPermissionsExistsByPid 通过父级ID检测子级权限是否存在 CheckPermissionsExistsByPid(ctx context.Context, pid uint) bool // GetPermissionsTotalByPid 通过父级ID获取子权限数量 GetPermissionsTotalByPid(ctx context.Context, pid uint) int // SaveRoles 保存角色信息 SaveRoles(ctx context.Context, role model.RolesDetailItem) error // GetRolesList 获取角色列表 GetRolesList(ctx context.Context, in model.RolesListInput) (out *model.RolesListOutput, err error) // GetAssocRolesList 获取关联角色列表 GetAssocRolesList(ctx context.Context) (rows []model.RoleIdAndNameItem, err error) // GetRolesDetail 获取角色详情 GetRolesDetail(ctx context.Context, roleId uint) (detail *model.RolesDetailItem, err error) // RemoveRoles 删除角色信息 RemoveRoles(ctx context.Context, roleId uint) error // GetRolesNameListByRoleId 通过角色ID获取角色名列表 GetRolesNameListByRoleId(ctx context.Context, roleId ...uint) (rows []model.RoleIdAndNameItem, err error) // CheckRolesExistsById 通过角色ID检测角色是否存在 CheckRolesExistsById(ctx context.Context, id uint) bool // RolesTotalById 通过角色ID获取角色总数 RolesTotalById(ctx context.Context, id ...uint) int // RolesWhere 角色条件 RolesWhere(in model.RolesListInput) map[string]interface{} // UserAdminWhere 用户管理员搜索条件 UserAdminWhere(in model.UserAdminWhereItem) map[string]interface{} // FormatUserAdmin 格式化用户管理员 FormatUserAdmin(detail *model.UserAdminGetDetailItem) }
type ISmsTpl ¶
type ISmsTpl interface { // CurrSyncOutFromTemplateStatus 同步当前SMS平台模板状态 CurrSyncOutFromTemplateStatus(ctx context.Context) error // CurrApplyOutFromTemplate 同步当前SMS服务模板到外部平台 CurrApplyOutFromTemplate(ctx context.Context, tid uint) error // CurrTemplateByAlias 通过模板变量获取当前模板信息-模板ID和模板内容(发送短信) CurrTemplateByAlias(ctx context.Context, varAlias enums.SmsAlias) (*model.CurrTemplateItem, error) // CurrTemplateIdByAlias 通过模板变量获取当前配置SMS服务模板ID CurrTemplateIdByAlias(ctx context.Context, varAlias enums.SmsAlias) (*string, error) // CurrTemplateOutMapByAlias 通过模板变量获取当前SMS平台模板MAP CurrTemplateOutMapByAlias(ctx context.Context, varAlias ...string) (map[string]*entity.SmsTemplateOut, error) // CurrFromSmsDriver 获取短信平台SMS驱动 CurrFromSmsDriver(ctx context.Context) (*string, error) // SaveRecord 保存短信记录 SaveRecord(ctx context.Context, records ...entity.SmsRecord) error // GetRecordList 获取短信发送记录 GetRecordList(ctx context.Context, in model.SmsRecordListInput) (out *model.SmsRecordListOutput, err error) // ProcessRecordScanByMobiles 通过手机号获取短信记录 ProcessRecordScanByMobiles(ctx context.Context, mobile []string, scan interface{}) error // ProcessRecordNewByMobile 通过手机号获取最新发送记录 ProcessRecordNewByMobile(ctx context.Context, mobile string) (*model.SmsSendRecordNewItem, error) // SendCaptcha 发送短信验证码 SendCaptcha(ctx context.Context, mobile string, varAlias enums.SmsAlias) error // ValidateCode 短信验证码检验 ValidateCode(ctx context.Context, mobile, code string) error // SendSmsMessage 短信发送-消息通知 SendSmsMessage(ctx context.Context, item model.SendSmsTemplateItem, mobile ...string) error // SendSmsMarket 短信发送-营销短信 SendSmsMarket(ctx context.Context, item model.SendSmsTemplateItem, mobile ...string) error // GetTemplateList 获取SMS模板列表 GetTemplateList(ctx context.Context, in model.SmsTemplateListInput) (out *model.SmsTemplateListOutput, err error) // GetTemplateDetail 获取SMS短信模板详情 GetTemplateDetail(ctx context.Context, id uint) (out *model.SmsTemplateDetailOutput, err error) // SaveTemplate 保存短信模板数据 SaveTemplate(ctx context.Context, tmpl entity.SmsTemplate) error // DeleteTemplate 通过模板ID删除短信模板数据 DeleteTemplate(ctx context.Context, tid uint) error // GetTemplateOutList 获取外部SMS平台模板列表 GetTemplateOutList(ctx context.Context, in model.SmsTemplateOutListInput) (out *model.SmsTemplateOutListOutput, err error) // SaveTemplateOut 保存平台SMS短信模板数据 SaveTemplateOut(ctx context.Context, out entity.SmsTemplateOut) error // DeleteTemplateOutByVarAlias 根据短信模板变量上传外部平台模板数据 DeleteTemplateOutByVarAlias(ctx context.Context, varAlias enums.SmsAlias) error // ApplyOutFromTemplate 同步模板到外部平台 ApplyOutFromTemplate(ctx context.Context, tid uint, fromType string) error // SyncOutFromTemplateStatus 同步更新外部平台模板状态 SyncOutFromTemplateStatus(ctx context.Context, fromType string) error // SendSmsOutFrom 发送短信-提交短信到第三方平台 SendSmsOutFrom(ctx context.Context, in model.SendOutFromSmsItem) error // ProcessTemplateIdByAliasAndFrom 通过变量别名和平台类型获取模板ID ProcessTemplateIdByAliasAndFrom(ctx context.Context, varAlias, fromType string) (*string, error) // ProcessTemplateOutMapByAlias 通过模板变量获取外部模板数据MAP ProcessTemplateOutMapByAlias(ctx context.Context, fromType string, varAlias ...string) (map[string]*entity.SmsTemplateOut, error) // ProcessTemplateDetailById 通过模板ID获取SMS模板详情 ProcessTemplateDetailById(ctx context.Context, id uint) (*entity.SmsTemplate, error) // CheckTemplateExistsById 通过模板ID检测模板是否存在 CheckTemplateExistsById(ctx context.Context, tid uint) (bool, error) // GetTemplateByAlias 根据模板变量获取短信模板-发送短信模板内容 GetTemplateByAlias(ctx context.Context, varAlias enums.SmsAlias) (*model.CurrTemplateItem, error) // RemoveVarAlias 根据SMS变量删除SMS模板数据 RemoveVarAlias(ctx context.Context) // RecordModel 短信记录model查询 RecordModel() *base.TblBaseService // TemplateModel 短信模板model查询 TemplateModel() *base.TblBaseService // OutModel 外部短信模板Model查询 OutModel() *base.TblBaseService // TemplateWhere 短信模板查询条件 TemplateWhere(in model.SmsTemplateWhereItem) map[string]interface{} // RecordWhere 短信记录查询条件 RecordWhere(in model.SmsRecordWhereItem) map[string]interface{} // FormatTemplate 格式化短信模板 FormatTemplate(detail *model.SmsTemplateItem) // FormatRecord 格式化短信记录 FormatRecord(detail *model.SmsRecordDetailItem) }
type ISysLog ¶
type ISysLog interface { // LogModel 系统日志Model LogModel() *base.TblBaseService // SaveSystemLog 保存系统日志 SaveSystemLog(ctx context.Context, log entity.SystemLog) error // RecordLog 记录系统日志数据 RecordLog(ctx context.Context, op enums.LogOperateType, item model.RecordLogItem) error // GetSystemLogList 获取系统日志列表 GetSystemLogList(ctx context.Context, in model.SystemLogGetListInput) (out *model.SystemLogGetListOutput, err error) // GetSystemLogDetail 获取系统日志详情 GetSystemLogDetail(ctx context.Context, id uint) (out *model.SystemLogGetDetailOutput, err error) // SystemLogWhere 系统日志条件 SystemLogWhere(in model.SystemLogWhereItem) map[string]interface{} // FormatSystemLog 格式化系统日志 FormatSystemLog(detail *model.SystemLogDetailItem) }
type ISysMap ¶
type ISysMap interface { // GetList 获取字典列表数据 GetList(ctx context.Context, in model.SysMapGetListInput) (out *model.SysMapGetListOutput, err error) // GetDetail 获取字典详情 GetDetail(ctx context.Context, id uint) (detail *model.SysMapDetailItem, err error) // DeleteSysMap 删除系统字典 DeleteSysMap(ctx context.Context, id uint) error // Map 通过字典名获取字典值 Map(ctx context.Context, name string) (map[string]string, error) // MustMap 通过字典名获取字典 MustMap(ctx context.Context, name string) map[string]string // Exists 检测字典是否存在 Exists(ctx context.Context, name string) bool // ValExists 字典值检测是否存在 ValExists(ctx context.Context, name string, value g.Var) (bool, error) // GetDetailById 通过字典ID获取字典详情 GetDetailById(ctx context.Context, id uint, pointer interface{}) error // GetValueList 获取字典值列表 GetValueList(ctx context.Context, name string) (rows []model.SysMapValueListItem, err error) // GetValueDetail 获取字典值详情 GetValueDetail(ctx context.Context, id uint) (detail *model.SysMapValueDetailItem, err error) // GetMapAll 获取所有字典组值 GetMapAll(ctx context.Context, isRefresh ...bool) (map[string]map[string]string, error) // GetValueDetailById 通过字典值ID获取字典值详情 GetValueDetailById(ctx context.Context, id uint, pointer interface{}) error // MapModel 字典Model MapModel() *base.TblBaseService // ValueModel 字典值Model ValueModel() *base.TblBaseService }
type IUpload ¶
type IUpload interface { // ProcessLocalUpload 处理本地上传文件 ProcessLocalUpload(ctx context.Context, in model.UploadFileInput, item *model.UploadAttachmentItem) (err error) // FileUpload 文件上传 FileUpload(ctx context.Context, in model.UploadFileInput) (out *model.UploadFileOutput, err error) // GetConfig 读取文件上传配置 GetConfig(ctx context.Context) (rawConfig *config.UploadConfigItem, err error) }
type IUser ¶
type IUser interface { // SaveUser 保存用户详情-添加或编辑 SaveUser(ctx context.Context, item model.UserSaveUserDetailItem) (uint, error) // UpdateUserNickname 更新用户昵称 UpdateUserNickname(ctx context.Context, uid uint, nickname string) error // GetUserDetail 获取用户详情 GetUserDetail(ctx context.Context) *model.UserDetailItem // AuthLoginAdminUser 登录用户认证管理员信息 AuthLoginAdminUser(ctx context.Context) error // GetAdminUser 获取管理员登录详情 GetAdminUser(ctx context.Context) *model.UserAdminDetailItem // ProcessAdminDetail 获取管理员详情 ProcessAdminDetail(ctx context.Context, where interface{}, detail *model.UserAdminDetailItem) error // ProcessAdminDetailByUid 通过用户ID获取管理员信息 ProcessAdminDetailByUid(ctx context.Context, uid uint) (detail *model.UserAdminDetailItem, err error) // ProcessAdminDetailById 通过管理员ID获取管理员信息 ProcessAdminDetailById(ctx context.Context, adminId uint) (detail *model.UserAdminDetailItem, err error) // SendUpdatePwdCaptcha 用户修改密码-发送验证码-第一步 SendUpdatePwdCaptcha(ctx context.Context) error // ValidateUpdatePwdCaptcha 修改密码-校验验证码-第二步 ValidateUpdatePwdCaptcha(ctx context.Context, code string) error // UpdatePwd 修改密码-修改密码-第三步 UpdatePwd(ctx context.Context, in model.UserUpdatePwdInput) error // SendForgotPwdCaptcha 找回密码-发送短信验证码-第一步 SendForgotPwdCaptcha(ctx context.Context, in model.UserForgotPwdSendCaptchaInput) error // ValidateForgotPwdCaptcha 找回密码-检验验证码-第二步 ValidateForgotPwdCaptcha(ctx context.Context, in model.UserForgotPwdValidateCaptchaInput) error // UpdateForgotPwd 找回密码-修改密码-第三步 UpdateForgotPwd(ctx context.Context, in model.UserForgotPwdUpdatePwdInput) error // UpdateUserDetail 修改用户详情 UpdateUserDetail(ctx context.Context, in model.UserUpdateDetailItem) error // UpdateUserDetailByUid 更加用户ID修改用户信息 UpdateUserDetailByUid(ctx context.Context, uid uint, data interface{}) error // GetUserAuthDetail 获取授权登录用户详情 GetUserAuthDetail(ctx context.Context) *model.UserBasicDetailItem // ProcessUserDetailByUid 通过用户ID获取用户详情 ProcessUserDetailByUid(ctx context.Context, uid uint, pointer interface{}) error // SaveUserDevice 添加或编辑医生设备信息 SaveUserDevice(ctx context.Context, device entity.UserDevice) error // ProcessLoginUserDevice 通过用户ID并处理用户设备信息 ProcessLoginUserDevice(ctx context.Context, uid uint) (afterDevice *model.UserDeviceLoginAfterItem, err error) // DeviceUserAgent 通过UserAgent获取设备消息 DeviceUserAgent(ctx context.Context) (item *model.UserDeviceUserAgentItem, err error) // DeviceHashId 用户ID生成并获取设备HashID DeviceHashId(uid uint, item *model.UserDeviceUserAgentItem) string // GenUserDeviceParam 生成用户设备参数 GenUserDeviceParam(ctx context.Context, uid uint) (*entity.UserDevice, error) // ProcessDeviceDetailByHash 通过HashId获取登录设备详情 ProcessDeviceDetailByHash(ctx context.Context, hashId string, pointer interface{}) error // ProcessDeviceIdByHash 通过HashID获取设备ID ProcessDeviceIdByHash(ctx context.Context, hashId string) (uint, error) // GetFundsDetailByUid 通过用户id获取用户资金信息 GetFundsDetailByUid(ctx context.Context, uid uint) (detail *entity.UserFunds, err error) // UpdateFundsCoinByUid 通过用户ID更新用户盘古币 UpdateFundsCoinByUid(ctx context.Context, uid, coin uint, up bool) error // UpdateFundsByUid 通过用户ID更新用户资金 UpdateFundsByUid(ctx context.Context, uid uint, data interface{}) error // GetAndValidateFundsCoinsByUid 获取并验证用户资金盘古币可用金额 GetAndValidateFundsCoinsByUid(ctx context.Context, uid, coins uint) (detail *entity.UserFunds, err error) // LoginAuthParseToken 通过Token授权认证登录信息是否有效 LoginAuthParseToken(ctx context.Context, token string) error // Logout 退出登录 Logout(ctx context.Context) error // ForceUserDeviceOffline 当前用户或管理员强制下线登录后的设备 ForceUserDeviceOffline(ctx context.Context, deviceId uint) error // CurrUserLoginDeviceList 获取当前用户登陆设备列表 CurrUserLoginDeviceList(ctx context.Context) (out *model.CurrUserLoginDeviceListOutput, err error) // SaveUserLogin 保存用户登录日志 SaveUserLogin(ctx context.Context, login entity.UserLogin) error // ProcessUserLoginAfter 用户登录日志-后置处理 ProcessUserLoginAfter(ctx context.Context, item model.UserLoginAfterItem) error // ParseToken 解析授权登录Token ParseToken(ctx context.Context, token string) (*model.UserAccountItem, error) // AuthLoginDevice 验证登录信息【后台或用户可强制下线】 AuthLoginDevice(ctx context.Context, accountToken string) error // OfflineLoginDevice 下线用户登录设备 OfflineLoginDevice(ctx context.Context, accountToken string, status enums.LoginOauthStatus) error // AfterLogout 用户退出登录-后置处理 AfterLogout(ctx context.Context, after *model.LoginAfterLogoutItem) error // RemoveLoginCache 移除登录缓存信息(用户详情、管理员详情)-适用于(退出登录、强制退出、修改用户信息等) RemoveLoginCache(ctx context.Context, uid uint, accountToken string) error // ProcessLoginDetailByToken 通过Token获取当前登录详情 ProcessLoginDetailByToken(ctx context.Context, token string, detail interface{}) error // GetLoginUserTokenByUid 通过用户ID获取用户登陆列表 GetLoginUserTokenByUid(ctx context.Context, uid ...uint) ([]model.LoginUserIdAndTokenItem, error) // UserModel 实例用户基础Model UserModel() *base.TblBaseService // DetailModel 实例用户详情Model DetailModel() *base.TblBaseService // CredentialModel 实例用户证件Model CredentialModel() *base.TblBaseService // DeviceModel 实例用户设备Model DeviceModel() *base.TblBaseService // FundsModel 实例拥护资金Model FundsModel() *base.TblBaseService // LoginModel 实例用户登录Model LoginModel() *base.TblBaseService // AdminModel 实例用户管理员Model AdminModel() *base.TblBaseService // ValidateAccountLogin 用户认证并验证账户密码登录 ValidateAccountLogin(ctx context.Context, in model.UserOauthAccountLoginItem) (*model.UserOauthLoginDetailItem, error) // Login 账户密码或手机号快速认证登录 Login(ctx context.Context, in model.UserOauthLoginInput) (*model.UserOauthLoginOutput, error) // AfterUserOauth 后置操作-登录认证处理 AfterUserOauth(ctx context.Context, afterDetail *model.UserOauthAfterValidateItem) (*model.UserOauthLoginItem, error) // UserOauthValidateAfter 用户登录认证后置规则验证 UserOauthValidateAfter(ctx context.Context, after model.UserOauthAfterItem) (*model.UserOauthAfterValidateItem, error) // ValidateSmsCaptchaLogin 用户授权短信验证码登录并校验验证码 ValidateSmsCaptchaLogin(ctx context.Context, in model.UserOauthSmsLoginItem) (*model.UserOauthLoginDetailItem, error) // UserLoginSendSmsCaptcha 用户认证登录发送短信验证码 UserLoginSendSmsCaptcha(ctx context.Context, in model.UserLoginSendSmsCaptchaInput) error // DecryptMobile 解密手机号 DecryptMobile(mobileCipher, secret string) (string, error) // ProcessDetailByMobile 通过手机号获取用户详情 ProcessDetailByMobile(ctx context.Context, mobile string, pointer interface{}) error // ProcessDetailByUid 通过用户ID获取用户详情 ProcessDetailByUid(ctx context.Context, uid uint, pointer interface{}) error // ProcessDetailByAccount 通过用户账户获取用户详情 ProcessDetailByAccount(ctx context.Context, account string, pointer interface{}) error // CheckUserExistsByMobile 通过手机号-检测用户是否存在 CheckUserExistsByMobile(ctx context.Context, mobile string) bool // CheckUserExistsByAccount 通过账号-检查用户是否存在 CheckUserExistsByAccount(ctx context.Context, account string) bool // CheckUserExistsByUid 通过用户ID检测用户是否存在 CheckUserExistsByUid(ctx context.Context, uid uint) bool // ProcessAccountNameByUid 通过用户ID获取账户名 ProcessAccountNameByUid(ctx context.Context, uid uint) (*model.UserAccountNameItem, error) // ProcessUserByUid 通过用户ID获取用户信息 ProcessUserByUid(ctx context.Context, uid uint) (*entity.User, error) }
type IVideo ¶ added in v1.0.1
type IVideo interface { // SaveVideo 保存视频信息 SaveVideo(ctx context.Context, item model.VideoSaveItem) error // GetVideoList 获取视频列表 GetVideoList(ctx context.Context, in model.VideoListInput) (out *model.VideoListOutput, err error) // GetVideoDetail 获取视频基础详情 GetVideoDetail(ctx context.Context, in model.VideoDetailInput) (detail *model.VideoDetailItem, err error) // GetVideoPlayEpisodes 获取视频播放续集列表-并验证用户授权 GetVideoPlayEpisodes(ctx context.Context, videoId uint) (out *model.VideoPlayEpisodesOutput, err error) // GetVideoPlayUrl 获取视频播放地址 GetVideoPlayUrl(ctx context.Context, in model.VideoPlayUrlInput) (out *model.VideoPlayUrlOutput, err error) // GetVideoAuthDetail 获取用户前台授权视频详情 GetVideoAuthDetail(ctx context.Context, videoId uint) (detail *model.VideoDetailAuthItem, err error) // GetVideoAuthDetailByNo 获取用户前台授权视频详情-视频编号 GetVideoAuthDetailByNo(ctx context.Context, videoNo string) (detail *model.VideoDetailAuthItem, err error) // DeleteVideo 删除视频数据 DeleteVideo(ctx context.Context, videoId uint) error // CheckVideoOperatorValid 检测视频操作业务是否有效,例如(是否发布):当前已发布,需要更改为未发布 CheckVideoOperatorValid(ctx context.Context, videoId uint, operator enums.VideoOperator) bool // PrepareUserVideoPlayUrl 整理用户视频播放地址 PrepareUserVideoPlayUrl(ctx context.Context, in model.VideoPlayUrlInput, uid uint) (detail *model.VideoDetailAuthItem, err error) // SaveAttribute 添加|编辑视频属性 SaveAttribute(ctx context.Context, item entity.VideoAttribute) error // SaveVideoEpisodes 保存视频续集数据 SaveVideoEpisodes(ctx context.Context, item model.VideoEpisodesSaveItem) error // GetEpisodesList 获取视频续集列表数据 GetEpisodesList(ctx context.Context, in model.VideoEpisodesListInput) (out *model.VideoEpisodesListOutput, err error) // GetEpisodesDetail 获取视频续集详情 GetEpisodesDetail(ctx context.Context, episodesId uint) (detail *model.VideoEpisodesDetailItem, err error) // GetEpisodesIdSetByVideoId 通过视频ID获取视频续集ID集合 GetEpisodesIdSetByVideoId(ctx context.Context, videoId uint) ([]uint, error) // MustGetEpisodesIdSetByVideoId 通过视频ID获取视频续集ID集合 MustGetEpisodesIdSetByVideoId(ctx context.Context, videoId uint) []uint // GetEpisodesBuyList 获取待购买的剧集列表 GetEpisodesBuyList(ctx context.Context, videoId uint, idSet []uint) (list []model.VideoEpisodesBuyItem, err error) // GetRemainderNotBuyList 获取剩余未购买的剧集列表 GetRemainderNotBuyList(ctx context.Context, episodesIdSet []uint) (list []model.VideoEpisodesBuyItem, err error) // GetVideoEpisodesIds 获取视频剧集ID,适用于(获取免费剧集ID) GetVideoEpisodesIds(ctx context.Context, videoId uint, size int) (map[uint]bool, error) // SaveLabels 保存视频标签值 SaveLabels(ctx context.Context, videoId uint, values ...string) error // GetVideoIdByValue 通过标签值获取视频ID GetVideoIdByValue(ctx context.Context, values ...string) ([]uint, error) // GetLabelValueList 通过视频ID获取视频标签值列表 GetLabelValueList(ctx context.Context, videoId uint) ([]model.VideoLabelItem, error) // VideoModel 视频Model VideoModel() *base.TblBaseService // AttributeModel 视频属性Model AttributeModel() *base.TblBaseService // EpisodesModel 视频续集Model EpisodesModel() *base.TblBaseService // LabelModel 视频标签Model LabelModel() *base.TblBaseService // LogModel 视频操作日志Model LogModel() *base.TblBaseService // PersonalModel 视频相关人员Model PersonalModel() *base.TblBaseService // ResolutionModel 视频续集清晰度Model ResolutionModel() *base.TblBaseService // UserActionsModel 视频用户操作Model UserActionsModel() *base.TblBaseService // SaveVideoPersonal 保存视频相关人员资料 SaveVideoPersonal(ctx context.Context, en entity.VideoPersonal) error // SaveVideoResolution 保存视频清晰度数据 SaveVideoResolution(ctx context.Context, episodesId uint, params ...*model.VideoResolutionSaveItem) error // GetResolutionMapByEpisodesId 通过视频续集ID获取续集清晰度列表 GetResolutionMapByEpisodesId(ctx context.Context, episodesId ...uint) (map[uint][]model.VideoResolutionListItem, error) // GetEpisodesResolutionDetail 获取视频续集详情及视频清晰度 GetEpisodesResolutionDetail(ctx context.Context, episodesId uint, resolution string) (detail *model.EpisodesResolutionDetailItem, err error) // 用户视频关联操作(收藏、点赞、踩一下) VideoAssocAction(ctx context.Context, videoId uint, t enums.VideoUserActionType) error // GetUserVideoActions 获取用户视频操作属性(收藏、点赞、踩) GetUserVideoActions(ctx context.Context, videoId uint) (attr model.VideoUserActionsAttrItem) // GetUserActionVideoList 获取用户视频操作列表数据 GetUserActionVideoList(ctx context.Context, t enums.VideoUserActionType, page, size int) (out *model.VideoUserListOutput, err error) // GetUserVideoIdByType 通过收点踩类型获取视频ID GetUserVideoIdByType(ctx context.Context, t enums.VideoUserActionType) []uint // VideoWhere 视频搜索条件 VideoWhere(ctx context.Context, item model.VideoWhereItem) map[string]interface{} // VideoSort 视频列表排序 VideoSort(by uint16) string }
type IVideoBuy ¶ added in v1.0.1
type IVideoBuy interface { // GetBuyList 获取视频购买列表 GetBuyList(ctx context.Context, in model.VideoBuyListInput) (out *model.VideoBuyListOutput, err error) // GetVideoBuyAuthDetail 获取用户购买视频授权信息 GetVideoBuyAuthDetail(ctx context.Context, videoId uint) (detail *model.VideoBuyAuthItem, err error) // GetBuyDetail 获取视频购买详情 GetBuyDetail(ctx context.Context, buyId uint) (out *model.VideoBuyDetailOutput, err error) // GetBillList 获取视频购买账单列表 GetBillList(ctx context.Context, where model.VideoBuyBillListWhere) (rows []model.VideoBuyBillListItem, err error) // GetBillDetail 获取视频购买账单详情 GetBillDetail(ctx context.Context, billId uint) (out *model.VideoBillDetailOutput, err error) // GenBuyBillAndGetId 生成视频购买账单并获取账单ID GenBuyBillAndGetId(ctx context.Context, item entity.VideoBuyBill) (uint, error) // RefundVideoBill 视频账单退款 RefundVideoBill(ctx context.Context, in model.RefundVideoBillInput) error // BillRefundWithTX 视频账单退款-事物处理 BillRefundWithTX(ctx context.Context, item model.PrepareRefundBillItem) error // CreateVideoPurchase 创建用户购买视频数据 CreateVideoPurchase(ctx context.Context, in model.CreateVideoPurchaseInput) error // GenVideoSaleBillWithTX 生成视频购买销售账单-事务处理 GenVideoSaleBillWithTX(ctx context.Context, in model.GenVideoSaleBillItem) error // GenVideoSaleBill 生成视频购买销售账单 GenVideoSaleBill(ctx context.Context, in model.GenVideoSaleBillItem) error // GetEpisodesBuyList 获取剧集购买列表 GetEpisodesBuyList(ctx context.Context, uid uint, in model.CreateVideoPurchaseInput) (episodes []model.VideoEpisodesBuyItem, err error) // GenAndGetBuyId 生成并获取购买ID GenAndGetBuyId(ctx context.Context, data entity.VideoBuy) (uint, error) // UpdateVideoBuyById 通过购买ID更新视频购买信息 UpdateVideoBuyById(ctx context.Context, buyId uint, data interface{}) error // PrepareVideoSaleBill 准备销售账单的数据 PrepareVideoSaleBill(ctx context.Context, in *model.CreateVideoPurchaseInput) (item *model.GenVideoSaleBillItem, err error) // FmtBuyEpisodeContent 格式化购买剧集内容 FmtBuyEpisodeContent(episode []model.VideoBuyEpisodesItem) string // BuyEpisodesAuthResult 授权用户购买视频续集结果 BuyEpisodesAuthResult(ctx context.Context, videoId uint) map[uint]bool // GetBuyEpisodesList 获取购买剧集列表 GetBuyEpisodesList(ctx context.Context, where model.VideoBuyEpisodesWhereItem) (rows []model.VideoBuyEpisodesItem, err error) // GetBuyEpisodes 生成视频购买剧集数据 GenBuyEpisodes(ctx context.Context, in model.GenBuyEpisodesInput) error // GetBuyEpisodesIdSet 获取已购买的剧集ID集合 GetBuyEpisodesIdSet(ctx context.Context, videoId, uid uint) ([]uint, error) // IsPurchased 检验用户是否已购买过视频剧集 IsPurchased(ctx context.Context, uid, videoId uint) bool // DeletePurchasedEpisodes 删除购买过的视频剧集(购买视频退款) DeletePurchasedEpisodes(ctx context.Context, billId uint, episodesId []uint) error // BuyModel 视频购买Model BuyModel() *base.TblBaseService // BillModel 视频购买账单明细Model BillModel() *base.TblBaseService // EpisodesModel 视频购买续集Model EpisodesModel() *base.TblBaseService // VideoBuyWhere 视频购买查询条件 VideoBuyWhere(ctx context.Context, item model.VideoBuyWhereItem) map[string]interface{} }
type IVideoCate ¶ added in v1.0.1
type IVideoCate interface { // SaveCategory 保存视频分类 SaveCategory(ctx context.Context, data entity.VideoCategory) error // GetCategoryLabelList 获取视频分类标签列表(大类、子类) GetCategoryLabelList(ctx context.Context, pid uint) (list model.VideoCategoryLabelList, err error) // GetCategoryTreeList 获取视频分类树形结构 GetCategoryTreeList(ctx context.Context) (treeList []map[string]interface{}, err error) // GetCategoryDetail 获取视频分类详情 GetCategoryDetail(ctx context.Context, id uint) (detail *model.VideoCategoryDetail, err error) // CheckCategoryChildExistsById 检测子级类目是否存在 CheckCategoryChildExistsById(ctx context.Context, pid uint) bool // CategoryModel 视频分类Model CategoryModel() *base.TblBaseService }
func VideoCate ¶ added in v1.0.1
func VideoCate() IVideoCate
type IVideoPlay ¶ added in v1.0.1
type IVideoPlay interface { SavePlayHistory(ctx context.Context, in model.VideoPlayHistorySaveInput) error // GetPlayAuthDetail 获取用户播放视频信息 GetPlayAuthDetail(ctx context.Context, videoId uint) (detail *model.VideoPlayAuthItem, err error) // GetPlayHistoryList 获取用户播放历史列表 GetPlayHistoryList(ctx context.Context, in model.CommonPaginationItem) (out *model.VideoPlayHistoryListOutput, err error) // DeleteVideoPlay 用户删除播放记录 DeleteVideoPlay(ctx context.Context, playId ...uint) error // PlayModel 视频播放Model PlayModel() *base.TblBaseService // SequelModel 视频播放续集Model SequelModel() *base.TblBaseService // SavePlaySequel 保存播放续集数据 SavePlaySequel(ctx context.Context, en entity.VideoPlaySequel) error // GetPlayResultsMapByPlayId 通过播放ID获取用户播放视频结果集 GetPlayResultsMapByPlayId(ctx context.Context, playId uint) (res map[uint]*model.VideoPlaySequelResultItem, err error) // MustPlayResultsMap 通过播放ID获取用户播放结果集 MustPlayResultsMap(ctx context.Context, playId uint) map[uint]bool }
func VideoPlay ¶ added in v1.0.1
func VideoPlay() IVideoPlay
Click to show internal directories.
Click to hide internal directories.