// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.1
// source: module/ec/order/proto/mgt.proto

package order

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 (
	Mgt_OrderCreate_FullMethodName      = "/order.Mgt/OrderCreate"
	Mgt_OrderModify_FullMethodName      = "/order.Mgt/OrderModify"
	Mgt_OrderGet_FullMethodName         = "/order.Mgt/OrderGet"
	Mgt_OrderListByStore_FullMethodName = "/order.Mgt/OrderListByStore"
	Mgt_OrderCancel_FullMethodName      = "/order.Mgt/OrderCancel"
	Mgt_OrderReturnable_FullMethodName  = "/order.Mgt/OrderReturnable"
	Mgt_OrderApprove_FullMethodName     = "/order.Mgt/OrderApprove"
)

// MgtClient is the client API for Mgt 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.
//
// Order(订单)微服务-订单模块
// 订单管理类模块
type MgtClient interface {
	// 创建订单
	OrderCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*OrderStatusReply, error)
	// 修改订单
	OrderModify(ctx context.Context, in *OrderSummaryItem, opts ...grpc.CallOption) (*OrderStatusReply, error)
	// 获取一个订单的详情数据
	OrderGet(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderGetReply, error)
	// 根据不同的类型获取店铺的订单列表
	OrderListByStore(ctx context.Context, in *OrderListByStoreRequest, opts ...grpc.CallOption) (*OrderListByStoreReply, error)
	// 取消订单
	OrderCancel(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error)
	// 退货
	OrderReturnable(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error)
	// 订单审批
	OrderApprove(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error)
}

type mgtClient struct {
	cc grpc.ClientConnInterface
}

func NewMgtClient(cc grpc.ClientConnInterface) MgtClient {
	return &mgtClient{cc}
}

func (c *mgtClient) OrderCreate(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*OrderStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderStatusReply)
	err := c.cc.Invoke(ctx, Mgt_OrderCreate_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderModify(ctx context.Context, in *OrderSummaryItem, opts ...grpc.CallOption) (*OrderStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderStatusReply)
	err := c.cc.Invoke(ctx, Mgt_OrderModify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderGet(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderGetReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderGetReply)
	err := c.cc.Invoke(ctx, Mgt_OrderGet_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderListByStore(ctx context.Context, in *OrderListByStoreRequest, opts ...grpc.CallOption) (*OrderListByStoreReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderListByStoreReply)
	err := c.cc.Invoke(ctx, Mgt_OrderListByStore_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderCancel(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderStatusReply)
	err := c.cc.Invoke(ctx, Mgt_OrderCancel_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderReturnable(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderStatusReply)
	err := c.cc.Invoke(ctx, Mgt_OrderReturnable_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mgtClient) OrderApprove(ctx context.Context, in *OrderIdentRequest, opts ...grpc.CallOption) (*OrderStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(OrderStatusReply)
	err := c.cc.Invoke(ctx, Mgt_OrderApprove_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// MgtServer is the server API for Mgt service.
// All implementations should embed UnimplementedMgtServer
// for forward compatibility.
//
// Order(订单)微服务-订单模块
// 订单管理类模块
type MgtServer interface {
	// 创建订单
	OrderCreate(context.Context, *CreateOrderRequest) (*OrderStatusReply, error)
	// 修改订单
	OrderModify(context.Context, *OrderSummaryItem) (*OrderStatusReply, error)
	// 获取一个订单的详情数据
	OrderGet(context.Context, *OrderIdentRequest) (*OrderGetReply, error)
	// 根据不同的类型获取店铺的订单列表
	OrderListByStore(context.Context, *OrderListByStoreRequest) (*OrderListByStoreReply, error)
	// 取消订单
	OrderCancel(context.Context, *OrderIdentRequest) (*OrderStatusReply, error)
	// 退货
	OrderReturnable(context.Context, *OrderIdentRequest) (*OrderStatusReply, error)
	// 订单审批
	OrderApprove(context.Context, *OrderIdentRequest) (*OrderStatusReply, error)
}

// UnimplementedMgtServer 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 UnimplementedMgtServer struct{}

func (UnimplementedMgtServer) OrderCreate(context.Context, *CreateOrderRequest) (*OrderStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderCreate not implemented")
}
func (UnimplementedMgtServer) OrderModify(context.Context, *OrderSummaryItem) (*OrderStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderModify not implemented")
}
func (UnimplementedMgtServer) OrderGet(context.Context, *OrderIdentRequest) (*OrderGetReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderGet not implemented")
}
func (UnimplementedMgtServer) OrderListByStore(context.Context, *OrderListByStoreRequest) (*OrderListByStoreReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderListByStore not implemented")
}
func (UnimplementedMgtServer) OrderCancel(context.Context, *OrderIdentRequest) (*OrderStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderCancel not implemented")
}
func (UnimplementedMgtServer) OrderReturnable(context.Context, *OrderIdentRequest) (*OrderStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderReturnable not implemented")
}
func (UnimplementedMgtServer) OrderApprove(context.Context, *OrderIdentRequest) (*OrderStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method OrderApprove not implemented")
}
func (UnimplementedMgtServer) testEmbeddedByValue() {}

// UnsafeMgtServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MgtServer will
// result in compilation errors.
type UnsafeMgtServer interface {
	mustEmbedUnimplementedMgtServer()
}

func RegisterMgtServer(s grpc.ServiceRegistrar, srv MgtServer) {
	// If the following call panics, it indicates UnimplementedMgtServer 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(&Mgt_ServiceDesc, srv)
}

func _Mgt_OrderCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateOrderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderCreate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderCreate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderCreate(ctx, req.(*CreateOrderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderModify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderSummaryItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderModify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderModify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderModify(ctx, req.(*OrderSummaryItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderIdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderGet(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderGet_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderGet(ctx, req.(*OrderIdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderListByStore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderListByStoreRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderListByStore(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderListByStore_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderListByStore(ctx, req.(*OrderListByStoreRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderIdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderCancel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderCancel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderCancel(ctx, req.(*OrderIdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderReturnable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderIdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderReturnable(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderReturnable_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderReturnable(ctx, req.(*OrderIdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mgt_OrderApprove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OrderIdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MgtServer).OrderApprove(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Mgt_OrderApprove_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MgtServer).OrderApprove(ctx, req.(*OrderIdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Mgt_ServiceDesc is the grpc.ServiceDesc for Mgt service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Mgt_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "order.Mgt",
	HandlerType: (*MgtServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OrderCreate",
			Handler:    _Mgt_OrderCreate_Handler,
		},
		{
			MethodName: "OrderModify",
			Handler:    _Mgt_OrderModify_Handler,
		},
		{
			MethodName: "OrderGet",
			Handler:    _Mgt_OrderGet_Handler,
		},
		{
			MethodName: "OrderListByStore",
			Handler:    _Mgt_OrderListByStore_Handler,
		},
		{
			MethodName: "OrderCancel",
			Handler:    _Mgt_OrderCancel_Handler,
		},
		{
			MethodName: "OrderReturnable",
			Handler:    _Mgt_OrderReturnable_Handler,
		},
		{
			MethodName: "OrderApprove",
			Handler:    _Mgt_OrderApprove_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/ec/order/proto/mgt.proto",
}
