Files
full/module/ec/mall/pb/freight_grpc.pb.go

448 lines
16 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: freight.proto
package mall
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Freight_Fetch_FullMethodName = "/mall.Freight/Fetch"
Freight_Modify_FullMethodName = "/mall.Freight/Modify"
Freight_Delete_FullMethodName = "/mall.Freight/Delete"
Freight_Create_FullMethodName = "/mall.Freight/Create"
Freight_Detail_FullMethodName = "/mall.Freight/Detail"
Freight_DenyRegionFetch_FullMethodName = "/mall.Freight/DenyRegionFetch"
Freight_DenyRegionCreate_FullMethodName = "/mall.Freight/DenyRegionCreate"
Freight_DenyRegionDelete_FullMethodName = "/mall.Freight/DenyRegionDelete"
Freight_DenyRegionModify_FullMethodName = "/mall.Freight/DenyRegionModify"
)
// FreightClient is the client API for Freight service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// 运费设置相关
type FreightClient interface {
// 运费模板列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FreightReply, error)
// 运费模板修改
Modify(ctx context.Context, in *FreightItem, opts ...grpc.CallOption) (*StatusReply, error)
// 运费模板删除
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 运费模板创建
Create(ctx context.Context, in *FreightItem, opts ...grpc.CallOption) (*StatusReply, error)
// 运费模板详情
Detail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*FreightItem, error)
// 限制区域列表
DenyRegionFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DenyRegionReply, error)
// 新建限制区域
DenyRegionCreate(ctx context.Context, in *DenyRegionItem, opts ...grpc.CallOption) (*StatusReply, error)
// 移除限制区域
DenyRegionDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 编辑限制区域
DenyRegionModify(ctx context.Context, in *DenyRegionItem, opts ...grpc.CallOption) (*StatusReply, error)
}
type freightClient struct {
cc grpc.ClientConnInterface
}
func NewFreightClient(cc grpc.ClientConnInterface) FreightClient {
return &freightClient{cc}
}
func (c *freightClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FreightReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FreightReply)
err := c.cc.Invoke(ctx, Freight_Fetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) Modify(ctx context.Context, in *FreightItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) Create(ctx context.Context, in *FreightItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) Detail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*FreightItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FreightItem)
err := c.cc.Invoke(ctx, Freight_Detail_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) DenyRegionFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DenyRegionReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DenyRegionReply)
err := c.cc.Invoke(ctx, Freight_DenyRegionFetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) DenyRegionCreate(ctx context.Context, in *DenyRegionItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_DenyRegionCreate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) DenyRegionDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_DenyRegionDelete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *freightClient) DenyRegionModify(ctx context.Context, in *DenyRegionItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Freight_DenyRegionModify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// FreightServer is the server API for Freight service.
// All implementations must embed UnimplementedFreightServer
// for forward compatibility.
//
// 运费设置相关
type FreightServer interface {
// 运费模板列表
Fetch(context.Context, *FetchRequest) (*FreightReply, error)
// 运费模板修改
Modify(context.Context, *FreightItem) (*StatusReply, error)
// 运费模板删除
Delete(context.Context, *IdentRequest) (*StatusReply, error)
// 运费模板创建
Create(context.Context, *FreightItem) (*StatusReply, error)
// 运费模板详情
Detail(context.Context, *IdentRequest) (*FreightItem, error)
// 限制区域列表
DenyRegionFetch(context.Context, *FetchRequest) (*DenyRegionReply, error)
// 新建限制区域
DenyRegionCreate(context.Context, *DenyRegionItem) (*StatusReply, error)
// 移除限制区域
DenyRegionDelete(context.Context, *IdentRequest) (*StatusReply, error)
// 编辑限制区域
DenyRegionModify(context.Context, *DenyRegionItem) (*StatusReply, error)
mustEmbedUnimplementedFreightServer()
}
// UnimplementedFreightServer must 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 UnimplementedFreightServer struct{}
func (UnimplementedFreightServer) Fetch(context.Context, *FetchRequest) (*FreightReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedFreightServer) Modify(context.Context, *FreightItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedFreightServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedFreightServer) Create(context.Context, *FreightItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedFreightServer) Detail(context.Context, *IdentRequest) (*FreightItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Detail not implemented")
}
func (UnimplementedFreightServer) DenyRegionFetch(context.Context, *FetchRequest) (*DenyRegionReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DenyRegionFetch not implemented")
}
func (UnimplementedFreightServer) DenyRegionCreate(context.Context, *DenyRegionItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DenyRegionCreate not implemented")
}
func (UnimplementedFreightServer) DenyRegionDelete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DenyRegionDelete not implemented")
}
func (UnimplementedFreightServer) DenyRegionModify(context.Context, *DenyRegionItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DenyRegionModify not implemented")
}
func (UnimplementedFreightServer) mustEmbedUnimplementedFreightServer() {}
func (UnimplementedFreightServer) testEmbeddedByValue() {}
// UnsafeFreightServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FreightServer will
// result in compilation errors.
type UnsafeFreightServer interface {
mustEmbedUnimplementedFreightServer()
}
func RegisterFreightServer(s grpc.ServiceRegistrar, srv FreightServer) {
// If the following call pancis, it indicates UnimplementedFreightServer 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.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Freight_ServiceDesc, srv)
}
func _Freight_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).Fetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).Fetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FreightItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).Modify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_Modify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).Modify(ctx, req.(*FreightItem))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FreightItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_Create_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).Create(ctx, req.(*FreightItem))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_Detail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).Detail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_Detail_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).Detail(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_DenyRegionFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).DenyRegionFetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_DenyRegionFetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).DenyRegionFetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_DenyRegionCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DenyRegionItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).DenyRegionCreate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_DenyRegionCreate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).DenyRegionCreate(ctx, req.(*DenyRegionItem))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_DenyRegionDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).DenyRegionDelete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_DenyRegionDelete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).DenyRegionDelete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Freight_DenyRegionModify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DenyRegionItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FreightServer).DenyRegionModify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Freight_DenyRegionModify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FreightServer).DenyRegionModify(ctx, req.(*DenyRegionItem))
}
return interceptor(ctx, in, info, handler)
}
// Freight_ServiceDesc is the grpc.ServiceDesc for Freight service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Freight_ServiceDesc = grpc.ServiceDesc{
ServiceName: "mall.Freight",
HandlerType: (*FreightServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Fetch",
Handler: _Freight_Fetch_Handler,
},
{
MethodName: "Modify",
Handler: _Freight_Modify_Handler,
},
{
MethodName: "Delete",
Handler: _Freight_Delete_Handler,
},
{
MethodName: "Create",
Handler: _Freight_Create_Handler,
},
{
MethodName: "Detail",
Handler: _Freight_Detail_Handler,
},
{
MethodName: "DenyRegionFetch",
Handler: _Freight_DenyRegionFetch_Handler,
},
{
MethodName: "DenyRegionCreate",
Handler: _Freight_DenyRegionCreate_Handler,
},
{
MethodName: "DenyRegionDelete",
Handler: _Freight_DenyRegionDelete_Handler,
},
{
MethodName: "DenyRegionModify",
Handler: _Freight_DenyRegionModify_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "freight.proto",
}