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: supply.proto
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.0
// source: module/ec/market/proto/supply.proto
package market
import (
protobuf "bsm/full/protobuf"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -33,15 +34,15 @@ const (
// 营销服务 - 供应商
type SupplyClient interface {
// 新增供应商
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 获取一个供应商
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
// 供应商列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
// 更新供应商数据
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
// 删除一个供应商
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
}
type supplyClient struct {
@@ -52,9 +53,9 @@ func NewSupplyClient(cc grpc.ClientConnInterface) SupplyClient {
return &supplyClient{cc}
}
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, 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, Supply_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -62,7 +63,7 @@ func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
func (c *supplyClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MarketSupplyItem)
err := c.cc.Invoke(ctx, Supply_Get_FullMethodName, in, out, cOpts...)
@@ -72,7 +73,7 @@ func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.C
return out, nil
}
func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
func (c *supplyClient) Fetch(ctx context.Context, in *protobuf.MarketFetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SupplyReply)
err := c.cc.Invoke(ctx, Supply_Fetch_FullMethodName, in, out, cOpts...)
@@ -82,9 +83,9 @@ func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc
return out, nil
}
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, 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, Supply_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -92,9 +93,9 @@ func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ..
return out, nil
}
func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
func (c *supplyClient) 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, Supply_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
@@ -103,48 +104,46 @@ func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grp
}
// SupplyServer is the server API for Supply service.
// All implementations must embed UnimplementedSupplyServer
// All implementations should embed UnimplementedSupplyServer
// for forward compatibility.
//
// 营销服务 - 供应商
type SupplyServer interface {
// 新增供应商
Create(context.Context, *MarketSupplyItem) (*StatusReply, error)
Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
// 获取一个供应商
Get(context.Context, *IdentRequest) (*MarketSupplyItem, error)
Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error)
// 供应商列表
Fetch(context.Context, *FetchRequest) (*SupplyReply, error)
Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error)
// 更新供应商数据
Modify(context.Context, *MarketSupplyItem) (*StatusReply, error)
Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error)
// 删除一个供应商
Delete(context.Context, *IdentRequest) (*StatusReply, error)
mustEmbedUnimplementedSupplyServer()
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
}
// UnimplementedSupplyServer must be embedded to have
// UnimplementedSupplyServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSupplyServer struct{}
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSupplyServer) Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
func (UnimplementedSupplyServer) Get(context.Context, *protobuf.IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedSupplyServer) Fetch(context.Context, *FetchRequest) (*SupplyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
func (UnimplementedSupplyServer) Fetch(context.Context, *protobuf.MarketFetchRequest) (*SupplyReply, error) {
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedSupplyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
func (UnimplementedSupplyServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedSupplyServer) mustEmbedUnimplementedSupplyServer() {}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
// UnsafeSupplyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SupplyServer will
@@ -154,7 +153,7 @@ type UnsafeSupplyServer interface {
}
func RegisterSupplyServer(s grpc.ServiceRegistrar, srv SupplyServer) {
// If the following call pancis, it indicates UnimplementedSupplyServer was
// If the following call panics, it indicates UnimplementedSupplyServer 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 _Supply_Create_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Supply_Get_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,13 +194,13 @@ func _Supply_Get_Handler(srv interface{}, ctx context.Context, dec func(interfac
FullMethod: Supply_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Get(ctx, req.(*IdentRequest))
return srv.(SupplyServer).Get(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
in := new(protobuf.MarketFetchRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -213,7 +212,7 @@ func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Supply_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Fetch(ctx, req.(*FetchRequest))
return srv.(SupplyServer).Fetch(ctx, req.(*protobuf.MarketFetchRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -237,7 +236,7 @@ func _Supply_Modify_Handler(srv interface{}, ctx context.Context, dec func(inter
}
func _Supply_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
}
@@ -249,7 +248,7 @@ func _Supply_Delete_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Supply_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Delete(ctx, req.(*IdentRequest))
return srv.(SupplyServer).Delete(ctx, req.(*protobuf.IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -283,5 +282,5 @@ var Supply_ServiceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "supply.proto",
Metadata: "module/ec/market/proto/supply.proto",
}