// Code generated by protoc-gen-micro. DO NOT EDIT.
|
// source: order.proto
|
|
package shop
|
|
import (
|
fmt "fmt"
|
proto "github.com/golang/protobuf/proto"
|
math "math"
|
)
|
|
import (
|
context "context"
|
client "github.com/micro/go-micro/client"
|
server "github.com/micro/go-micro/server"
|
)
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
var _ = proto.Marshal
|
var _ = fmt.Errorf
|
var _ = math.Inf
|
|
// This is a compile-time assertion to ensure that this generated file
|
// is compatible with the proto package it is being compiled against.
|
// A compilation error at this line likely means your copy of the
|
// proto package needs to be updated.
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
var _ context.Context
|
var _ client.Option
|
var _ server.Option
|
|
// Client API for OrderService service
|
|
type OrderService interface {
|
AddOrder(ctx context.Context, in *AddOrderReq, opts ...client.CallOption) (*CommonBoolReply, error)
|
GetOrderList(ctx context.Context, in *GetOrderListReq, opts ...client.CallOption) (*GetOrderListResp, error)
|
ShowOrderDetail(ctx context.Context, in *CommonIdReq, opts ...client.CallOption) (*ShowOrderDetailReply, error)
|
SaveProductDevice(ctx context.Context, in *SaveProductDeviceReq, opts ...client.CallOption) (*SaveProductDeviceReply, error)
|
CancelOrder(ctx context.Context, in *CommonIdReq, opts ...client.CallOption) (*CommonBoolReply, error)
|
Download(ctx context.Context, in *DownloadReq, opts ...client.CallOption) (*DownloadReply, error)
|
}
|
|
type orderService struct {
|
c client.Client
|
name string
|
}
|
|
func NewOrderService(name string, c client.Client) OrderService {
|
if c == nil {
|
c = client.NewClient()
|
}
|
if len(name) == 0 {
|
name = "shop"
|
}
|
return &orderService{
|
c: c,
|
name: name,
|
}
|
}
|
|
func (c *orderService) AddOrder(ctx context.Context, in *AddOrderReq, opts ...client.CallOption) (*CommonBoolReply, error) {
|
req := c.c.NewRequest(c.name, "OrderService.AddOrder", in)
|
out := new(CommonBoolReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *orderService) GetOrderList(ctx context.Context, in *GetOrderListReq, opts ...client.CallOption) (*GetOrderListResp, error) {
|
req := c.c.NewRequest(c.name, "OrderService.GetOrderList", in)
|
out := new(GetOrderListResp)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *orderService) ShowOrderDetail(ctx context.Context, in *CommonIdReq, opts ...client.CallOption) (*ShowOrderDetailReply, error) {
|
req := c.c.NewRequest(c.name, "OrderService.ShowOrderDetail", in)
|
out := new(ShowOrderDetailReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *orderService) SaveProductDevice(ctx context.Context, in *SaveProductDeviceReq, opts ...client.CallOption) (*SaveProductDeviceReply, error) {
|
req := c.c.NewRequest(c.name, "OrderService.SaveProductDevice", in)
|
out := new(SaveProductDeviceReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *orderService) CancelOrder(ctx context.Context, in *CommonIdReq, opts ...client.CallOption) (*CommonBoolReply, error) {
|
req := c.c.NewRequest(c.name, "OrderService.CancelOrder", in)
|
out := new(CommonBoolReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *orderService) Download(ctx context.Context, in *DownloadReq, opts ...client.CallOption) (*DownloadReply, error) {
|
req := c.c.NewRequest(c.name, "OrderService.Download", in)
|
out := new(DownloadReply)
|
err := c.c.Call(ctx, req, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
// Server API for OrderService service
|
|
type OrderServiceHandler interface {
|
AddOrder(context.Context, *AddOrderReq, *CommonBoolReply) error
|
GetOrderList(context.Context, *GetOrderListReq, *GetOrderListResp) error
|
ShowOrderDetail(context.Context, *CommonIdReq, *ShowOrderDetailReply) error
|
SaveProductDevice(context.Context, *SaveProductDeviceReq, *SaveProductDeviceReply) error
|
CancelOrder(context.Context, *CommonIdReq, *CommonBoolReply) error
|
Download(context.Context, *DownloadReq, *DownloadReply) error
|
}
|
|
func RegisterOrderServiceHandler(s server.Server, hdlr OrderServiceHandler, opts ...server.HandlerOption) error {
|
type orderService interface {
|
AddOrder(ctx context.Context, in *AddOrderReq, out *CommonBoolReply) error
|
GetOrderList(ctx context.Context, in *GetOrderListReq, out *GetOrderListResp) error
|
ShowOrderDetail(ctx context.Context, in *CommonIdReq, out *ShowOrderDetailReply) error
|
SaveProductDevice(ctx context.Context, in *SaveProductDeviceReq, out *SaveProductDeviceReply) error
|
CancelOrder(ctx context.Context, in *CommonIdReq, out *CommonBoolReply) error
|
Download(ctx context.Context, in *DownloadReq, out *DownloadReply) error
|
}
|
type OrderService struct {
|
orderService
|
}
|
h := &orderServiceHandler{hdlr}
|
return s.Handle(s.NewHandler(&OrderService{h}, opts...))
|
}
|
|
type orderServiceHandler struct {
|
OrderServiceHandler
|
}
|
|
func (h *orderServiceHandler) AddOrder(ctx context.Context, in *AddOrderReq, out *CommonBoolReply) error {
|
return h.OrderServiceHandler.AddOrder(ctx, in, out)
|
}
|
|
func (h *orderServiceHandler) GetOrderList(ctx context.Context, in *GetOrderListReq, out *GetOrderListResp) error {
|
return h.OrderServiceHandler.GetOrderList(ctx, in, out)
|
}
|
|
func (h *orderServiceHandler) ShowOrderDetail(ctx context.Context, in *CommonIdReq, out *ShowOrderDetailReply) error {
|
return h.OrderServiceHandler.ShowOrderDetail(ctx, in, out)
|
}
|
|
func (h *orderServiceHandler) SaveProductDevice(ctx context.Context, in *SaveProductDeviceReq, out *SaveProductDeviceReply) error {
|
return h.OrderServiceHandler.SaveProductDevice(ctx, in, out)
|
}
|
|
func (h *orderServiceHandler) CancelOrder(ctx context.Context, in *CommonIdReq, out *CommonBoolReply) error {
|
return h.OrderServiceHandler.CancelOrder(ctx, in, out)
|
}
|
|
func (h *orderServiceHandler) Download(ctx context.Context, in *DownloadReq, out *DownloadReply) error {
|
return h.OrderServiceHandler.Download(ctx, in, out)
|
}
|