fix and regen

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-02-22 00:12:01 +03:00
parent f72a39965a
commit 09f5a71e0b
32 changed files with 296 additions and 371 deletions

View File

@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// versions:
// - protoc-gen-go-micro v3.5.3
// - protoc-gen-go-micro v3.10.1
// - protoc v3.21.12
// source: test.proto
@@ -9,58 +9,60 @@ package pb
import (
context "context"
codec "go.unistack.org/micro-proto/v3/codec"
api "go.unistack.org/micro/v3/api"
v3 "go.unistack.org/micro-server-http/v3"
client "go.unistack.org/micro/v3/client"
)
var (
TestServiceName = "TestService"
TestServiceEndpoints = []api.Endpoint{
)
var (
TestServiceServerEndpoints = []v3.EndpointMetadata{
{
Name: "TestService.TestMultipart",
Path: []string{"/users/multipart"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
Name: "TestService.TestMultipart",
Path: "/users/multipart",
Method: "POST",
Body: "*",
Stream: false,
},
{
Name: "TestService.TestEndpoint",
Path: []string{"/users/test"},
Method: []string{"GET"},
Handler: "rpc",
Name: "TestService.TestEndpoint",
Path: "/users/test",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "TestService.UserByID",
Path: []string{"/users/{id}"},
Method: []string{"GET"},
Handler: "rpc",
Name: "TestService.UserByID",
Path: "/users/{id}",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "TestService.UserImageByID",
Path: []string{"/users/{id}/image"},
Method: []string{"GET"},
Handler: "rpc",
Name: "TestService.UserImageByID",
Path: "/users/{id}/image",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "TestService.UploadFile",
Path: []string{"/users/image/upload"},
Method: []string{"POST"},
Handler: "rpc",
Name: "TestService.UploadFile",
Path: "/users/image/upload",
Method: "POST",
Body: "",
Stream: false,
},
{
Name: "TestService.KzAmlRs",
Path: []string{"/aml"},
Method: []string{"POST"},
Handler: "rpc",
Name: "TestService.KzAmlRs",
Path: "/aml",
Method: "POST",
Body: "",
Stream: false,
},
}
)
func NewTestServiceEndpoints() []api.Endpoint {
return TestServiceEndpoints
}
type TestServiceClient interface {
TestMultipart(ctx context.Context, req *MultipartReq, opts ...client.CallOption) (*MultipartRsp, error)
TestEndpoint(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error)

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// protoc-gen-go-micro version: v3.5.3
// protoc-gen-go-micro version: v3.10.1
// source: test.proto
package pb
@@ -9,7 +9,6 @@ import (
v3 "go.unistack.org/micro-client-http/v3"
codec "go.unistack.org/micro-proto/v3/codec"
v31 "go.unistack.org/micro-server-http/v3"
api "go.unistack.org/micro/v3/api"
client "go.unistack.org/micro/v3/client"
server "go.unistack.org/micro/v3/server"
http "net/http"
@@ -117,8 +116,8 @@ 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.Cookie("csrftoken", "true"),
v31.Header("client_uid", "true"),
v31.Cookie("csrftoken", "true"),
)
return h.TestServiceServer.TestEndpoint(ctx, req, rsp)
}
@@ -153,8 +152,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
}
h := &testServiceServer{sh}
var nopts []server.HandlerOption
for _, endpoint := range TestServiceEndpoints {
nopts = append(nopts, api.WithEndpoint(&endpoint))
}
nopts = append(nopts, v31.HandlerEndpoints(TestServiceServerEndpoints))
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
}