initial commit
This commit is contained in:
94
category/internal/server/categoryserver.go
Normal file
94
category/internal/server/categoryserver.go
Normal file
@ -0,0 +1,94 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.8.3
|
||||
// Source: category.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"godemo/category/category"
|
||||
"godemo/category/internal/logic"
|
||||
"godemo/category/internal/svc"
|
||||
)
|
||||
|
||||
type CategoryServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
category.UnimplementedCategoryServer
|
||||
}
|
||||
|
||||
func NewCategoryServer(svcCtx *svc.ServiceContext) *CategoryServer {
|
||||
return &CategoryServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 健康检查
|
||||
func (s *CategoryServer) Ping(ctx context.Context, in *category.PingRequest) (*category.PingResponse, error) {
|
||||
l := logic.NewPingLogic(ctx, s.svcCtx)
|
||||
return l.Ping(in)
|
||||
}
|
||||
|
||||
// 分类基础操作
|
||||
func (s *CategoryServer) CreateCategory(ctx context.Context, in *category.CreateCategoryRequest) (*category.CategoryInfoResponse, error) {
|
||||
l := logic.NewCreateCategoryLogic(ctx, s.svcCtx)
|
||||
return l.CreateCategory(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) UpdateCategory(ctx context.Context, in *category.UpdateCategoryRequest) (*category.CategoryInfoResponse, error) {
|
||||
l := logic.NewUpdateCategoryLogic(ctx, s.svcCtx)
|
||||
return l.UpdateCategory(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) DeleteCategory(ctx context.Context, in *category.DeleteCategoryRequest) (*category.DeleteResponse, error) {
|
||||
l := logic.NewDeleteCategoryLogic(ctx, s.svcCtx)
|
||||
return l.DeleteCategory(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) GetCategory(ctx context.Context, in *category.GetCategoryRequest) (*category.CategoryInfoResponse, error) {
|
||||
l := logic.NewGetCategoryLogic(ctx, s.svcCtx)
|
||||
return l.GetCategory(in)
|
||||
}
|
||||
|
||||
// 层级结构操作
|
||||
func (s *CategoryServer) GetChildren(ctx context.Context, in *category.GetChildrenRequest) (*category.CategoryListResponse, error) {
|
||||
l := logic.NewGetChildrenLogic(ctx, s.svcCtx)
|
||||
return l.GetChildren(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) GetTree(ctx context.Context, in *category.GetTreeRequest) (*category.CategoryTreeResponse, error) {
|
||||
l := logic.NewGetTreeLogic(ctx, s.svcCtx)
|
||||
return l.GetTree(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) MoveCategory(ctx context.Context, in *category.MoveCategoryRequest) (*category.CategoryInfoResponse, error) {
|
||||
l := logic.NewMoveCategoryLogic(ctx, s.svcCtx)
|
||||
return l.MoveCategory(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) GetAncestorPath(ctx context.Context, in *category.GetAncestorPathRequest) (*category.CategoryPathResponse, error) {
|
||||
l := logic.NewGetAncestorPathLogic(ctx, s.svcCtx)
|
||||
return l.GetAncestorPath(in)
|
||||
}
|
||||
|
||||
// 批量操作
|
||||
func (s *CategoryServer) BatchCreateCategories(ctx context.Context, in *category.BatchCreateRequest) (*category.BatchCreateResponse, error) {
|
||||
l := logic.NewBatchCreateCategoriesLogic(ctx, s.svcCtx)
|
||||
return l.BatchCreateCategories(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) BatchUpdateCategories(ctx context.Context, in *category.BatchUpdateRequest) (*category.BatchUpdateResponse, error) {
|
||||
l := logic.NewBatchUpdateCategoriesLogic(ctx, s.svcCtx)
|
||||
return l.BatchUpdateCategories(in)
|
||||
}
|
||||
|
||||
// 查询过滤
|
||||
func (s *CategoryServer) ListCategories(ctx context.Context, in *category.ListCategoryRequest) (*category.CategoryListResponse, error) {
|
||||
l := logic.NewListCategoriesLogic(ctx, s.svcCtx)
|
||||
return l.ListCategories(in)
|
||||
}
|
||||
|
||||
func (s *CategoryServer) CheckAlias(ctx context.Context, in *category.CheckAliasRequest) (*category.CheckAliasResponse, error) {
|
||||
l := logic.NewCheckAliasLogic(ctx, s.svcCtx)
|
||||
return l.CheckAlias(in)
|
||||
}
|
||||
Reference in New Issue
Block a user