@@ -1,19 +1,66 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// protoc-gen-go-micro version: v3.10.4
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
v31 "go.unistack.org/micro-client-http/v3"
|
||||
codec "go.unistack.org/micro-proto/v3/codec"
|
||||
v31 "go.unistack.org/micro-server-http/v3"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
http "net/http"
|
||||
)
|
||||
|
||||
var (
|
||||
TestServiceServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "TestService.TestMultipart",
|
||||
Path: "/users/multipart",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.TestEndpoint",
|
||||
Path: "/users/test",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UserByID",
|
||||
Path: "/users/{id}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UserImageByID",
|
||||
Path: "/users/{id}/image",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UploadFile",
|
||||
Path: "/users/image/upload",
|
||||
Method: "POST",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.KzAmlRs",
|
||||
Path: "/aml",
|
||||
Method: "POST",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
type testServiceClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
@@ -25,9 +72,9 @@ func NewTestServiceClient(name string, c client.Client) TestServiceClient {
|
||||
|
||||
func (c *testServiceClient) TestMultipart(ctx context.Context, req *MultipartReq, opts ...client.CallOption) (*MultipartRsp, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/users/multipart"),
|
||||
v3.Body("*"),
|
||||
v31.Method(http.MethodPost),
|
||||
v31.Path("/users/multipart"),
|
||||
v31.Body("*"),
|
||||
)
|
||||
rsp := &MultipartRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.TestMultipart", req), rsp, opts...)
|
||||
@@ -39,12 +86,12 @@ func (c *testServiceClient) TestMultipart(ctx context.Context, req *MultipartReq
|
||||
|
||||
func (c *testServiceClient) TestEndpoint(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/users/test"),
|
||||
v31.Method(http.MethodGet),
|
||||
v31.Path("/users/test"),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Header("client_uid", "true"),
|
||||
v3.Cookie("csrftoken", "true"),
|
||||
v31.Header("client_uid", "true"),
|
||||
v31.Cookie("csrftoken", "true"),
|
||||
)
|
||||
rsp := &Response{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.TestEndpoint", req), rsp, opts...)
|
||||
@@ -56,8 +103,8 @@ func (c *testServiceClient) TestEndpoint(ctx context.Context, req *Request, opts
|
||||
|
||||
func (c *testServiceClient) UserByID(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/users/{id}"),
|
||||
v31.Method(http.MethodGet),
|
||||
v31.Path("/users/{id}"),
|
||||
)
|
||||
rsp := &Response{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UserByID", req), rsp, opts...)
|
||||
@@ -69,8 +116,8 @@ func (c *testServiceClient) UserByID(ctx context.Context, req *Request, opts ...
|
||||
|
||||
func (c *testServiceClient) UserImageByID(ctx context.Context, req *Request, opts ...client.CallOption) (*codec.Frame, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/users/{id}/image"),
|
||||
v31.Method(http.MethodGet),
|
||||
v31.Path("/users/{id}/image"),
|
||||
)
|
||||
rsp := &codec.Frame{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UserImageByID", req), rsp, opts...)
|
||||
@@ -82,8 +129,8 @@ func (c *testServiceClient) UserImageByID(ctx context.Context, req *Request, opt
|
||||
|
||||
func (c *testServiceClient) UploadFile(ctx context.Context, req *RequestImage, opts ...client.CallOption) (*ResponseImage, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/users/image/upload"),
|
||||
v31.Method(http.MethodPost),
|
||||
v31.Path("/users/image/upload"),
|
||||
)
|
||||
rsp := &ResponseImage{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UploadFile", req), rsp, opts...)
|
||||
@@ -95,8 +142,8 @@ func (c *testServiceClient) UploadFile(ctx context.Context, req *RequestImage, o
|
||||
|
||||
func (c *testServiceClient) KzAmlRs(ctx context.Context, req *RequestAml, opts ...client.CallOption) (*ResponseAml, error) {
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/aml"),
|
||||
v31.Method(http.MethodPost),
|
||||
v31.Path("/aml"),
|
||||
)
|
||||
rsp := &ResponseAml{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.KzAmlRs", req), rsp, opts...)
|
||||
@@ -115,9 +162,9 @@ func (h *testServiceServer) TestMultipart(ctx context.Context, req *MultipartReq
|
||||
}
|
||||
|
||||
func (h *testServiceServer) TestEndpoint(ctx context.Context, req *Request, rsp *Response) error {
|
||||
v31.FillRequest(ctx, req,
|
||||
v31.Header("client_uid", "true"),
|
||||
v31.Cookie("csrftoken", "true"),
|
||||
v3.FillRequest(ctx, req,
|
||||
v3.Header("client_uid", "true"),
|
||||
v3.Cookie("csrftoken", "true"),
|
||||
)
|
||||
return h.TestServiceServer.TestEndpoint(ctx, req, rsp)
|
||||
}
|
||||
@@ -152,6 +199,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
||||
}
|
||||
h := &testServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
nopts = append(nopts, v31.HandlerEndpoints(TestServiceServerEndpoints))
|
||||
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user