refactor: centralize protobuf and remove go-zero
This commit is contained in:
@@ -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: cart.proto
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.35.0
|
||||
// source: module/ec/order/proto/cart.proto
|
||||
|
||||
package order
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -34,11 +35,11 @@ type CartClient interface {
|
||||
// 获取购物车的商品数据
|
||||
Fetch(ctx context.Context, in *CartGetRequest, opts ...grpc.CallOption) (*CartGetReply, error)
|
||||
// 将商品增加至购物车
|
||||
Create(ctx context.Context, in *CartAddRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Create(ctx context.Context, in *CartAddRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error)
|
||||
// 修改购物车中的商品数量
|
||||
Modify(ctx context.Context, in *CartSetRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Modify(ctx context.Context, in *CartSetRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error)
|
||||
// 删除购物车中的商品
|
||||
Delete(ctx context.Context, in *CartDelRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
Delete(ctx context.Context, in *CartDelRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error)
|
||||
}
|
||||
|
||||
type cartClient struct {
|
||||
@@ -59,9 +60,9 @@ func (c *cartClient) Fetch(ctx context.Context, in *CartGetRequest, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cartClient) Create(ctx context.Context, in *CartAddRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *cartClient) Create(ctx context.Context, in *CartAddRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.OrderStatusReply)
|
||||
err := c.cc.Invoke(ctx, Cart_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,9 +70,9 @@ func (c *cartClient) Create(ctx context.Context, in *CartAddRequest, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cartClient) Modify(ctx context.Context, in *CartSetRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *cartClient) Modify(ctx context.Context, in *CartSetRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.OrderStatusReply)
|
||||
err := c.cc.Invoke(ctx, Cart_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,9 +80,9 @@ func (c *cartClient) Modify(ctx context.Context, in *CartSetRequest, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cartClient) Delete(ctx context.Context, in *CartDelRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
func (c *cartClient) Delete(ctx context.Context, in *CartDelRequest, opts ...grpc.CallOption) (*protobuf.OrderStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusReply)
|
||||
out := new(protobuf.OrderStatusReply)
|
||||
err := c.cc.Invoke(ctx, Cart_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -90,7 +91,7 @@ func (c *cartClient) Delete(ctx context.Context, in *CartDelRequest, opts ...grp
|
||||
}
|
||||
|
||||
// CartServer is the server API for Cart service.
|
||||
// All implementations must embed UnimplementedCartServer
|
||||
// All implementations should embed UnimplementedCartServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Order(订单)微服务-购物车
|
||||
@@ -98,15 +99,14 @@ type CartServer interface {
|
||||
// 获取购物车的商品数据
|
||||
Fetch(context.Context, *CartGetRequest) (*CartGetReply, error)
|
||||
// 将商品增加至购物车
|
||||
Create(context.Context, *CartAddRequest) (*StatusReply, error)
|
||||
Create(context.Context, *CartAddRequest) (*protobuf.OrderStatusReply, error)
|
||||
// 修改购物车中的商品数量
|
||||
Modify(context.Context, *CartSetRequest) (*StatusReply, error)
|
||||
Modify(context.Context, *CartSetRequest) (*protobuf.OrderStatusReply, error)
|
||||
// 删除购物车中的商品
|
||||
Delete(context.Context, *CartDelRequest) (*StatusReply, error)
|
||||
mustEmbedUnimplementedCartServer()
|
||||
Delete(context.Context, *CartDelRequest) (*protobuf.OrderStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedCartServer must be embedded to have
|
||||
// UnimplementedCartServer 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 CartServer interface {
|
||||
type UnimplementedCartServer struct{}
|
||||
|
||||
func (UnimplementedCartServer) Fetch(context.Context, *CartGetRequest) (*CartGetReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedCartServer) Create(context.Context, *CartAddRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||
func (UnimplementedCartServer) Create(context.Context, *CartAddRequest) (*protobuf.OrderStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedCartServer) Modify(context.Context, *CartSetRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
|
||||
func (UnimplementedCartServer) Modify(context.Context, *CartSetRequest) (*protobuf.OrderStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedCartServer) Delete(context.Context, *CartDelRequest) (*StatusReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
func (UnimplementedCartServer) Delete(context.Context, *CartDelRequest) (*protobuf.OrderStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedCartServer) mustEmbedUnimplementedCartServer() {}
|
||||
func (UnimplementedCartServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedCartServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCartServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CartServer will
|
||||
@@ -136,7 +135,7 @@ type UnsafeCartServer interface {
|
||||
}
|
||||
|
||||
func RegisterCartServer(s grpc.ServiceRegistrar, srv CartServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCartServer was
|
||||
// If the following call panics, it indicates UnimplementedCartServer 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.
|
||||
@@ -243,5 +242,5 @@ var Cart_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cart.proto",
|
||||
Metadata: "module/ec/order/proto/cart.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user