-
Notifications
You must be signed in to change notification settings - Fork 0
/
account_http.pb.go
91 lines (79 loc) · 2.78 KB
/
account_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
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// protoc-gen-go-http v2.1.5
package v1
import (
context "context"
http "github.com/go-kratos/kratos/v2/transport/http"
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
)
// 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
type AccountHTTPServer interface {
GetUserInfo(context.Context, *GetUserInfoParams) (*GetUserInfoReply, error)
}
func RegisterAccountHTTPServer(s *http.Server, srv AccountHTTPServer) {
r := s.Route("/")
r.GET("/admin/api/account/v1/getUser", _Account_GetUserInfo0_HTTP_Handler(srv))
r.GET("/api/account/v1/getUser", _Account_GetUserInfo1_HTTP_Handler(srv))
}
func _Account_GetUserInfo0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetUserInfoParams
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, "/api.account.service.v1.Account/GetUserInfo")
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetUserInfo(ctx, req.(*GetUserInfoParams))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetUserInfoReply)
return ctx.Result(200, reply)
}
}
func _Account_GetUserInfo1_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetUserInfoParams
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, "/api.account.service.v1.Account/GetUserInfo")
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetUserInfo(ctx, req.(*GetUserInfoParams))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetUserInfoReply)
return ctx.Result(200, reply)
}
}
type AccountHTTPClient interface {
GetUserInfo(ctx context.Context, req *GetUserInfoParams, opts ...http.CallOption) (rsp *GetUserInfoReply, err error)
}
type AccountHTTPClientImpl struct {
cc *http.Client
}
func NewAccountHTTPClient(client *http.Client) AccountHTTPClient {
return &AccountHTTPClientImpl{client}
}
func (c *AccountHTTPClientImpl) GetUserInfo(ctx context.Context, in *GetUserInfoParams, opts ...http.CallOption) (*GetUserInfoReply, error) {
var out GetUserInfoReply
pattern := "/api/account/v1/getUser"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation("/api.account.service.v1.Account/GetUserInfo"))
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
}