liuxiaolong
2020-05-27 9ffdb024c5fcc1dd353d3f37fcfdfa21bedba143
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// 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)
}