-
Notifications
You must be signed in to change notification settings - Fork 2
/
manager_dictionary_service_http.pb.go
405 lines (376 loc) · 15.5 KB
/
manager_dictionary_service_http.pb.go
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// - protoc-gen-go-http v2.7.0
// - protoc v4.24.4
// source: manager_dictionary_service.proto
package v1
import (
context "context"
http "github.com/go-kratos/kratos/v2/transport/http"
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
var _ = new(context.Context)
var _ = binding.EncodeURL
const _ = http.SupportPackageIsVersion1
const OperationServiceAddDictionary = "/manager_dictionary.Service/AddDictionary"
const OperationServiceAddDictionaryValue = "/manager_dictionary.Service/AddDictionaryValue"
const OperationServiceDeleteDictionary = "/manager_dictionary.Service/DeleteDictionary"
const OperationServiceDeleteDictionaryValue = "/manager_dictionary.Service/DeleteDictionaryValue"
const OperationServiceGetDictionaryValue = "/manager_dictionary.Service/GetDictionaryValue"
const OperationServicePageDictionary = "/manager_dictionary.Service/PageDictionary"
const OperationServicePageDictionaryValue = "/manager_dictionary.Service/PageDictionaryValue"
const OperationServiceUpdateDictionary = "/manager_dictionary.Service/UpdateDictionary"
const OperationServiceUpdateDictionaryValue = "/manager_dictionary.Service/UpdateDictionaryValue"
type ServiceHTTPServer interface {
// AddDictionary AddDictionary 添加字典信息
AddDictionary(context.Context, *AddDictionaryRequest) (*AddDictionaryReply, error)
// AddDictionaryValue AddDictionaryValue 删除字典值
AddDictionaryValue(context.Context, *AddDictionaryValueRequest) (*AddDictionaryValueReply, error)
// DeleteDictionary DeleteDictionary 删除字典信息
DeleteDictionary(context.Context, *DeleteDictionaryRequest) (*emptypb.Empty, error)
// DeleteDictionaryValue DeleteDictionaryValue 删除字典值
DeleteDictionaryValue(context.Context, *DeleteDictionaryValueRequest) (*emptypb.Empty, error)
// GetDictionaryValue GetDictionaryValue 获取指定字典值
GetDictionaryValue(context.Context, *GetDictionaryValueRequest) (*GetDictionaryValueReply, error)
// PageDictionary PageDictionary 获取分页字典信息
PageDictionary(context.Context, *PageDictionaryRequest) (*PageDictionaryReply, error)
// PageDictionaryValue PageDictionaryValue 获取分页字典值
PageDictionaryValue(context.Context, *PageDictionaryValueRequest) (*PageDictionaryValueReply, error)
// UpdateDictionary UpdateDictionary 更新字典信息
UpdateDictionary(context.Context, *UpdateDictionaryRequest) (*emptypb.Empty, error)
// UpdateDictionaryValue UpdateDictionaryValue 更新字典值
UpdateDictionaryValue(context.Context, *UpdateDictionaryValueRequest) (*emptypb.Empty, error)
}
func RegisterServiceHTTPServer(s *http.Server, srv ServiceHTTPServer) {
r := s.Route("/")
r.GET("/manager/v1/dictionaries", _Service_PageDictionary0_HTTP_Handler(srv))
r.POST("/manager/v1/dictionary", _Service_AddDictionary0_HTTP_Handler(srv))
r.PUT("/manager/v1/dictionary", _Service_UpdateDictionary0_HTTP_Handler(srv))
r.DELETE("/manager/v1/dictionary", _Service_DeleteDictionary0_HTTP_Handler(srv))
r.GET("/manager/v1/dictionary/values", _Service_PageDictionaryValue0_HTTP_Handler(srv))
r.GET("/manager/client/v1/dictionary/value", _Service_GetDictionaryValue0_HTTP_Handler(srv))
r.GET("/manager/v1/dictionary/value", _Service_GetDictionaryValue1_HTTP_Handler(srv))
r.POST("/manager/v1/dictionary/value", _Service_AddDictionaryValue0_HTTP_Handler(srv))
r.PUT("/manager/v1/dictionary/value", _Service_UpdateDictionaryValue0_HTTP_Handler(srv))
r.DELETE("/manager/v1/dictionary/value", _Service_DeleteDictionaryValue0_HTTP_Handler(srv))
}
func _Service_PageDictionary0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in PageDictionaryRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServicePageDictionary)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.PageDictionary(ctx, req.(*PageDictionaryRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*PageDictionaryReply)
return ctx.Result(200, reply)
}
}
func _Service_AddDictionary0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in AddDictionaryRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceAddDictionary)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.AddDictionary(ctx, req.(*AddDictionaryRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*AddDictionaryReply)
return ctx.Result(200, reply)
}
}
func _Service_UpdateDictionary0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in UpdateDictionaryRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceUpdateDictionary)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.UpdateDictionary(ctx, req.(*UpdateDictionaryRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*emptypb.Empty)
return ctx.Result(200, reply)
}
}
func _Service_DeleteDictionary0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in DeleteDictionaryRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceDeleteDictionary)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.DeleteDictionary(ctx, req.(*DeleteDictionaryRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*emptypb.Empty)
return ctx.Result(200, reply)
}
}
func _Service_PageDictionaryValue0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in PageDictionaryValueRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServicePageDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.PageDictionaryValue(ctx, req.(*PageDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*PageDictionaryValueReply)
return ctx.Result(200, reply)
}
}
func _Service_GetDictionaryValue0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetDictionaryValueRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceGetDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.GetDictionaryValue(ctx, req.(*GetDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetDictionaryValueReply)
return ctx.Result(200, reply)
}
}
func _Service_GetDictionaryValue1_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetDictionaryValueRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceGetDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.GetDictionaryValue(ctx, req.(*GetDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetDictionaryValueReply)
return ctx.Result(200, reply)
}
}
func _Service_AddDictionaryValue0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in AddDictionaryValueRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceAddDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.AddDictionaryValue(ctx, req.(*AddDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*AddDictionaryValueReply)
return ctx.Result(200, reply)
}
}
func _Service_UpdateDictionaryValue0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in UpdateDictionaryValueRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceUpdateDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.UpdateDictionaryValue(ctx, req.(*UpdateDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*emptypb.Empty)
return ctx.Result(200, reply)
}
}
func _Service_DeleteDictionaryValue0_HTTP_Handler(srv ServiceHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in DeleteDictionaryValueRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationServiceDeleteDictionaryValue)
h := ctx.Middleware(func(ctx context.Context, req any) (any, error) {
return srv.DeleteDictionaryValue(ctx, req.(*DeleteDictionaryValueRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*emptypb.Empty)
return ctx.Result(200, reply)
}
}
type ServiceHTTPClient interface {
AddDictionary(ctx context.Context, req *AddDictionaryRequest, opts ...http.CallOption) (rsp *AddDictionaryReply, err error)
AddDictionaryValue(ctx context.Context, req *AddDictionaryValueRequest, opts ...http.CallOption) (rsp *AddDictionaryValueReply, err error)
DeleteDictionary(ctx context.Context, req *DeleteDictionaryRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
DeleteDictionaryValue(ctx context.Context, req *DeleteDictionaryValueRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
GetDictionaryValue(ctx context.Context, req *GetDictionaryValueRequest, opts ...http.CallOption) (rsp *GetDictionaryValueReply, err error)
PageDictionary(ctx context.Context, req *PageDictionaryRequest, opts ...http.CallOption) (rsp *PageDictionaryReply, err error)
PageDictionaryValue(ctx context.Context, req *PageDictionaryValueRequest, opts ...http.CallOption) (rsp *PageDictionaryValueReply, err error)
UpdateDictionary(ctx context.Context, req *UpdateDictionaryRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
UpdateDictionaryValue(ctx context.Context, req *UpdateDictionaryValueRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
}
type ServiceHTTPClientImpl struct {
cc *http.Client
}
func NewServiceHTTPClient(client *http.Client) ServiceHTTPClient {
return &ServiceHTTPClientImpl{client}
}
func (c *ServiceHTTPClientImpl) AddDictionary(ctx context.Context, in *AddDictionaryRequest, opts ...http.CallOption) (*AddDictionaryReply, error) {
var out AddDictionaryReply
pattern := "/manager/v1/dictionary"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationServiceAddDictionary))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) AddDictionaryValue(ctx context.Context, in *AddDictionaryValueRequest, opts ...http.CallOption) (*AddDictionaryValueReply, error) {
var out AddDictionaryValueReply
pattern := "/manager/v1/dictionary/value"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationServiceAddDictionaryValue))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) DeleteDictionary(ctx context.Context, in *DeleteDictionaryRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
var out emptypb.Empty
pattern := "/manager/v1/dictionary"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationServiceDeleteDictionary))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) DeleteDictionaryValue(ctx context.Context, in *DeleteDictionaryValueRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
var out emptypb.Empty
pattern := "/manager/v1/dictionary/value"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationServiceDeleteDictionaryValue))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) GetDictionaryValue(ctx context.Context, in *GetDictionaryValueRequest, opts ...http.CallOption) (*GetDictionaryValueReply, error) {
var out GetDictionaryValueReply
pattern := "/manager/v1/dictionary/value"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationServiceGetDictionaryValue))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) PageDictionary(ctx context.Context, in *PageDictionaryRequest, opts ...http.CallOption) (*PageDictionaryReply, error) {
var out PageDictionaryReply
pattern := "/manager/v1/dictionaries"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationServicePageDictionary))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) PageDictionaryValue(ctx context.Context, in *PageDictionaryValueRequest, opts ...http.CallOption) (*PageDictionaryValueReply, error) {
var out PageDictionaryValueReply
pattern := "/manager/v1/dictionary/values"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationServicePageDictionaryValue))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) UpdateDictionary(ctx context.Context, in *UpdateDictionaryRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
var out emptypb.Empty
pattern := "/manager/v1/dictionary"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationServiceUpdateDictionary))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *ServiceHTTPClientImpl) UpdateDictionaryValue(ctx context.Context, in *UpdateDictionaryValueRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
var out emptypb.Empty
pattern := "/manager/v1/dictionary/value"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationServiceUpdateDictionaryValue))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "PUT", path, in, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}