143 lines
6.6 KiB
Go
143 lines
6.6 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.8.3
|
|
// Source: category.proto
|
|
|
|
package categoryclient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"godemo/category/category"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type (
|
|
BatchCreateRequest = category.BatchCreateRequest
|
|
BatchCreateResponse = category.BatchCreateResponse
|
|
BatchUpdateRequest = category.BatchUpdateRequest
|
|
BatchUpdateResponse = category.BatchUpdateResponse
|
|
CategoryInfo = category.CategoryInfo
|
|
CategoryInfoResponse = category.CategoryInfoResponse
|
|
CategoryListResponse = category.CategoryListResponse
|
|
CategoryPathResponse = category.CategoryPathResponse
|
|
CategoryTreeResponse = category.CategoryTreeResponse
|
|
CategoryTreeResponse_TreeNode = category.CategoryTreeResponse_TreeNode
|
|
CheckAliasRequest = category.CheckAliasRequest
|
|
CheckAliasResponse = category.CheckAliasResponse
|
|
CreateCategoryRequest = category.CreateCategoryRequest
|
|
DeleteCategoryRequest = category.DeleteCategoryRequest
|
|
DeleteResponse = category.DeleteResponse
|
|
GetAncestorPathRequest = category.GetAncestorPathRequest
|
|
GetCategoryRequest = category.GetCategoryRequest
|
|
GetChildrenRequest = category.GetChildrenRequest
|
|
GetTreeRequest = category.GetTreeRequest
|
|
ListCategoryRequest = category.ListCategoryRequest
|
|
MoveCategoryRequest = category.MoveCategoryRequest
|
|
PingRequest = category.PingRequest
|
|
PingResponse = category.PingResponse
|
|
UpdateCategoryRequest = category.UpdateCategoryRequest
|
|
|
|
Category interface {
|
|
// 健康检查
|
|
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
|
|
// 分类基础操作
|
|
CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error)
|
|
UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error)
|
|
DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
|
GetCategory(ctx context.Context, in *GetCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error)
|
|
// 层级结构操作
|
|
GetChildren(ctx context.Context, in *GetChildrenRequest, opts ...grpc.CallOption) (*CategoryListResponse, error)
|
|
GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*CategoryTreeResponse, error)
|
|
MoveCategory(ctx context.Context, in *MoveCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error)
|
|
GetAncestorPath(ctx context.Context, in *GetAncestorPathRequest, opts ...grpc.CallOption) (*CategoryPathResponse, error)
|
|
// 批量操作
|
|
BatchCreateCategories(ctx context.Context, in *BatchCreateRequest, opts ...grpc.CallOption) (*BatchCreateResponse, error)
|
|
BatchUpdateCategories(ctx context.Context, in *BatchUpdateRequest, opts ...grpc.CallOption) (*BatchUpdateResponse, error)
|
|
// 查询过滤
|
|
ListCategories(ctx context.Context, in *ListCategoryRequest, opts ...grpc.CallOption) (*CategoryListResponse, error)
|
|
CheckAlias(ctx context.Context, in *CheckAliasRequest, opts ...grpc.CallOption) (*CheckAliasResponse, error)
|
|
}
|
|
|
|
defaultCategory struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewCategory(cli zrpc.Client) Category {
|
|
return &defaultCategory{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
// 健康检查
|
|
func (m *defaultCategory) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.Ping(ctx, in, opts...)
|
|
}
|
|
|
|
// 分类基础操作
|
|
func (m *defaultCategory) CreateCategory(ctx context.Context, in *CreateCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.CreateCategory(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) UpdateCategory(ctx context.Context, in *UpdateCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.UpdateCategory(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.DeleteCategory(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) GetCategory(ctx context.Context, in *GetCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.GetCategory(ctx, in, opts...)
|
|
}
|
|
|
|
// 层级结构操作
|
|
func (m *defaultCategory) GetChildren(ctx context.Context, in *GetChildrenRequest, opts ...grpc.CallOption) (*CategoryListResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.GetChildren(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*CategoryTreeResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.GetTree(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) MoveCategory(ctx context.Context, in *MoveCategoryRequest, opts ...grpc.CallOption) (*CategoryInfoResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.MoveCategory(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) GetAncestorPath(ctx context.Context, in *GetAncestorPathRequest, opts ...grpc.CallOption) (*CategoryPathResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.GetAncestorPath(ctx, in, opts...)
|
|
}
|
|
|
|
// 批量操作
|
|
func (m *defaultCategory) BatchCreateCategories(ctx context.Context, in *BatchCreateRequest, opts ...grpc.CallOption) (*BatchCreateResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.BatchCreateCategories(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) BatchUpdateCategories(ctx context.Context, in *BatchUpdateRequest, opts ...grpc.CallOption) (*BatchUpdateResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.BatchUpdateCategories(ctx, in, opts...)
|
|
}
|
|
|
|
// 查询过滤
|
|
func (m *defaultCategory) ListCategories(ctx context.Context, in *ListCategoryRequest, opts ...grpc.CallOption) (*CategoryListResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.ListCategories(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultCategory) CheckAlias(ctx context.Context, in *CheckAliasRequest, opts ...grpc.CallOption) (*CheckAliasResponse, error) {
|
|
client := category.NewCategoryClient(m.cli.Conn())
|
|
return client.CheckAlias(ctx, in, opts...)
|
|
}
|