52 lines
1.9 KiB
Go
52 lines
1.9 KiB
Go
// ================================================================================
|
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
// You can delete these comments if you wish manually maintain this interface file.
|
|
// ================================================================================
|
|
|
|
package service
|
|
|
|
import (
|
|
"context"
|
|
"easygoadmin/api/v1"
|
|
)
|
|
|
|
// 按模块独立拆分(源:gf gen service 产物手工重组)。
|
|
// logic 方法签名变更时需同步维护本文件(手维护,勿整体运行 gf gen service)。
|
|
|
|
// ICategory 分类服务接口
|
|
type ICategory interface {
|
|
// Page 分类分页
|
|
// 返回平铺的分类列表
|
|
Page(ctx context.Context, req *v1.CategoryPageReq) (res *v1.CategoryPageRes, err error)
|
|
// List 分类平铺列表
|
|
// 树形结构由前端构建
|
|
List(ctx context.Context, req *v1.CategoryListReq) (res v1.CategoryListRes, err error)
|
|
// Detail 分类详情
|
|
Detail(ctx context.Context, req *v1.CategoryDetailReq) (res *v1.CategoryDetailRes, err error)
|
|
// Add 新增分类
|
|
Add(ctx context.Context, req *v1.CategoryAddReq) (res *v1.IdRes, err error)
|
|
// Update 修改分类
|
|
Update(ctx context.Context, req *v1.CategoryUpdateReq) (res *v1.CategoryUpdateRes, err error)
|
|
// Delete 删除分类
|
|
// 存在子分类或文章引用时禁止删除
|
|
Delete(ctx context.Context, req *v1.CategoryDeleteReq) (res *v1.CategoryDeleteRes, err error)
|
|
// BatchDelete 批量删除分类
|
|
BatchDelete(ctx context.Context, req *v1.CategoryBatchDeleteReq) (res *v1.CategoryBatchDeleteRes, err error)
|
|
}
|
|
|
|
// localCategory 分类服务实现实例
|
|
var localCategory ICategory
|
|
|
|
// Category 获取分类服务实例
|
|
func Category() ICategory {
|
|
if localCategory == nil {
|
|
panic("implement not found for interface ICategory, forgot register?")
|
|
}
|
|
return localCategory
|
|
}
|
|
|
|
// RegisterCategory 注册分类服务实现
|
|
func RegisterCategory(i ICategory) {
|
|
localCategory = i
|
|
}
|