refactor: centralize protobuf and remove go-zero

This commit is contained in:
2026-08-09 15:10:19 +08:00
parent 5cc5fd92ed
commit 4bbed3156c
357 changed files with 14208 additions and 19903 deletions

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: category.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/ec/mall/proto/category.proto
package mall
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -31,14 +32,14 @@ const (
//
// Store(店铺)微服务-分类
type CategoryClient interface {
// 获取分类数据
// 获取分类数据
Fetch(ctx context.Context, in *CategoryFetchRequest, opts ...grpc.CallOption) (*CategoryReply, error)
// 添加分类
Create(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*StatusReply, error)
// 删除分类
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 修改分类
Modify(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*StatusReply, error)
// 添加分类
Create(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除分类
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 修改分类
Modify(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type categoryClient struct {
@@ -59,9 +60,9 @@ func (c *categoryClient) Fetch(ctx context.Context, in *CategoryFetchRequest, op
return out, nil
}
func (c *categoryClient) Create(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *categoryClient) Create(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Category_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -69,9 +70,9 @@ func (c *categoryClient) Create(ctx context.Context, in *CategoryItem, opts ...g
return out, nil
}
func (c *categoryClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *categoryClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Category_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -79,9 +80,9 @@ func (c *categoryClient) Delete(ctx context.Context, in *IdentRequest, opts ...g
return out, nil
}
func (c *categoryClient) Modify(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *categoryClient) Modify(ctx context.Context, in *CategoryItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
out := new(protobuf.IdentityStatusReply)
err := c.cc.Invoke(ctx, Category_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -90,23 +91,22 @@ func (c *categoryClient) Modify(ctx context.Context, in *CategoryItem, opts ...g
}
// CategoryServer is the server API for Category service.
// All implementations must embed UnimplementedCategoryServer
// All implementations should embed UnimplementedCategoryServer
// for forward compatibility.
//
// Store(店铺)微服务-分类
type CategoryServer interface {
// 获取分类数据
// 获取分类数据
Fetch(context.Context, *CategoryFetchRequest) (*CategoryReply, error)
// 添加分类
Create(context.Context, *CategoryItem) (*StatusReply, error)
// 删除分类
Delete(context.Context, *IdentRequest) (*StatusReply, error)
// 修改分类
Modify(context.Context, *CategoryItem) (*StatusReply, error)
mustEmbedUnimplementedCategoryServer()
// 添加分类
Create(context.Context, *CategoryItem) (*protobuf.IdentityStatusReply, error)
// 删除分类
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
// 修改分类
Modify(context.Context, *CategoryItem) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedCategoryServer must be embedded to have
// UnimplementedCategoryServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
@@ -114,19 +114,18 @@ type CategoryServer interface {
type UnimplementedCategoryServer struct{}
func (UnimplementedCategoryServer) Fetch(context.Context, *CategoryFetchRequest) (*CategoryReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedCategoryServer) Create(context.Context, *CategoryItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
func (UnimplementedCategoryServer) Create(context.Context, *CategoryItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedCategoryServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
func (UnimplementedCategoryServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedCategoryServer) Modify(context.Context, *CategoryItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
func (UnimplementedCategoryServer) Modify(context.Context, *CategoryItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedCategoryServer) mustEmbedUnimplementedCategoryServer() {}
func (UnimplementedCategoryServer) testEmbeddedByValue() {}
func (UnimplementedCategoryServer) testEmbeddedByValue() {}
// UnsafeCategoryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CategoryServer will
@@ -136,7 +135,7 @@ type UnsafeCategoryServer interface {
}
func RegisterCategoryServer(s grpc.ServiceRegistrar, srv CategoryServer) {
// If the following call pancis, it indicates UnimplementedCategoryServer was
// If the following call panics, it indicates UnimplementedCategoryServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -183,7 +182,7 @@ func _Category_Create_Handler(srv interface{}, ctx context.Context, dec func(int
}
func _Category_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
in := new(protobuf.IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -195,7 +194,7 @@ func _Category_Delete_Handler(srv interface{}, ctx context.Context, dec func(int
FullMethod: Category_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryServer).Delete(ctx, req.(*IdentRequest))
return srv.(CategoryServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -243,5 +242,5 @@ var Category_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "category.proto",
Metadata: "module/ec/mall/proto/category.proto",
}