// Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.4.0 // - protoc v3.17.3 // source: card/card.proto package card 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 const OperationCardAddCardByShareToken = "/card.Card/AddCardByShareToken" const OperationCardCreateAccountUser = "/card.Card/CreateAccountUser" const OperationCardCreateCard = "/card.Card/CreateCard" const OperationCardCreateShareToken = "/card.Card/CreateShareToken" const OperationCardDelCard = "/card.Card/DelCard" const OperationCardGetCardInfo = "/card.Card/GetCardInfo" const OperationCardGetMyCards = "/card.Card/GetMyCards" const OperationCardGetTemplates = "/card.Card/GetTemplates" const OperationCardLoginAccount = "/card.Card/LoginAccount" const OperationCardOCRCard = "/card.Card/OCRCard" const OperationCardOssUpload = "/card.Card/OssUpload" const OperationCardSaveCard = "/card.Card/SaveCard" const OperationCardSearchCard = "/card.Card/SearchCard" const OperationCardWxRegisterLogin = "/card.Card/WxRegisterLogin" type CardHTTPServer interface { AddCardByShareToken(context.Context, *AddCardByShareTokenRequest) (*AddCardByShareTokenReply, error) CreateAccountUser(context.Context, *CreateAccountUserRequest) (*CreateAccountUserReply, error) CreateCard(context.Context, *CreateCardRequest) (*CreateCardReply, error) CreateShareToken(context.Context, *CreateShareTokenRequest) (*CreateShareTokenReply, error) DelCard(context.Context, *DelCardInfoRequest) (*DelCardReply, error) GetCardInfo(context.Context, *GetCardInfoRequest) (*GetCardInfoReply, error) GetMyCards(context.Context, *GetMyCardsRequest) (*GetMyCardsReply, error) GetTemplates(context.Context, *GetTemplatesRequest) (*GetTemplatesReply, error) LoginAccount(context.Context, *LoginAccountRequest) (*LoginAccountReply, error) OCRCard(context.Context, *OCRCardRequest) (*OCRCardReply, error) OssUpload(context.Context, *OssUploadRequest) (*OssUploadReplay, error) SaveCard(context.Context, *SaveCardInfoRequest) (*SaveCardReply, error) SearchCard(context.Context, *SearchCardRequest) (*SearchCardReply, error) WxRegisterLogin(context.Context, *WxRegisterLoginRequest) (*WxRegisterLoginReply, error) } func RegisterCardHTTPServer(s *http.Server, srv CardHTTPServer) { r := s.Route("/") r.POST("/v1/account/create", _Card_CreateAccountUser0_HTTP_Handler(srv)) r.POST("/v1/account/login", _Card_LoginAccount0_HTTP_Handler(srv)) r.POST("/v1/account/wx/login", _Card_WxRegisterLogin0_HTTP_Handler(srv)) r.POST("/v1/card/create", _Card_CreateCard0_HTTP_Handler(srv)) r.POST("/v1/card/info", _Card_GetCardInfo0_HTTP_Handler(srv)) r.POST("/v1/cards", _Card_GetMyCards0_HTTP_Handler(srv)) r.POST("/v1/card/del", _Card_DelCard0_HTTP_Handler(srv)) r.POST("/v1/card/save", _Card_SaveCard0_HTTP_Handler(srv)) r.POST("/v1/card/search", _Card_SearchCard0_HTTP_Handler(srv)) r.POST("/v1/card/templates", _Card_GetTemplates0_HTTP_Handler(srv)) r.POST("/v1/card/token/create", _Card_CreateShareToken0_HTTP_Handler(srv)) r.POST("/v1/card/user/bind", _Card_AddCardByShareToken0_HTTP_Handler(srv)) r.POST("/v1/card/ocr", _Card_OCRCard0_HTTP_Handler(srv)) r.POST("/v1/card/ossupload", _Card_OssUpload0_HTTP_Handler(srv)) } func _Card_CreateAccountUser0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in CreateAccountUserRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardCreateAccountUser) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateAccountUser(ctx, req.(*CreateAccountUserRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CreateAccountUserReply) return ctx.Result(200, reply) } } func _Card_LoginAccount0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in LoginAccountRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardLoginAccount) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.LoginAccount(ctx, req.(*LoginAccountRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*LoginAccountReply) return ctx.Result(200, reply) } } func _Card_WxRegisterLogin0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in WxRegisterLoginRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardWxRegisterLogin) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.WxRegisterLogin(ctx, req.(*WxRegisterLoginRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*WxRegisterLoginReply) return ctx.Result(200, reply) } } func _Card_CreateCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in CreateCardRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardCreateCard) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateCard(ctx, req.(*CreateCardRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CreateCardReply) return ctx.Result(200, reply) } } func _Card_GetCardInfo0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in GetCardInfoRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardGetCardInfo) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetCardInfo(ctx, req.(*GetCardInfoRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*GetCardInfoReply) return ctx.Result(200, reply) } } func _Card_GetMyCards0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in GetMyCardsRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardGetMyCards) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetMyCards(ctx, req.(*GetMyCardsRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*GetMyCardsReply) return ctx.Result(200, reply) } } func _Card_DelCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in DelCardInfoRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardDelCard) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DelCard(ctx, req.(*DelCardInfoRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*DelCardReply) return ctx.Result(200, reply) } } func _Card_SaveCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in SaveCardInfoRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardSaveCard) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.SaveCard(ctx, req.(*SaveCardInfoRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*SaveCardReply) return ctx.Result(200, reply) } } func _Card_SearchCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in SearchCardRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardSearchCard) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.SearchCard(ctx, req.(*SearchCardRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*SearchCardReply) return ctx.Result(200, reply) } } func _Card_GetTemplates0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in GetTemplatesRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardGetTemplates) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetTemplates(ctx, req.(*GetTemplatesRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*GetTemplatesReply) return ctx.Result(200, reply) } } func _Card_CreateShareToken0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in CreateShareTokenRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardCreateShareToken) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateShareToken(ctx, req.(*CreateShareTokenRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*CreateShareTokenReply) return ctx.Result(200, reply) } } func _Card_AddCardByShareToken0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in AddCardByShareTokenRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardAddCardByShareToken) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.AddCardByShareToken(ctx, req.(*AddCardByShareTokenRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*AddCardByShareTokenReply) return ctx.Result(200, reply) } } func _Card_OCRCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in OCRCardRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardOCRCard) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.OCRCard(ctx, req.(*OCRCardRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*OCRCardReply) return ctx.Result(200, reply) } } func _Card_OssUpload0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in OssUploadRequest if err := ctx.Bind(&in); err != nil { return err } http.SetOperation(ctx, OperationCardOssUpload) h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.OssUpload(ctx, req.(*OssUploadRequest)) }) out, err := h(ctx, &in) if err != nil { return err } reply := out.(*OssUploadReplay) return ctx.Result(200, reply) } } type CardHTTPClient interface { AddCardByShareToken(ctx context.Context, req *AddCardByShareTokenRequest, opts ...http.CallOption) (rsp *AddCardByShareTokenReply, err error) CreateAccountUser(ctx context.Context, req *CreateAccountUserRequest, opts ...http.CallOption) (rsp *CreateAccountUserReply, err error) CreateCard(ctx context.Context, req *CreateCardRequest, opts ...http.CallOption) (rsp *CreateCardReply, err error) CreateShareToken(ctx context.Context, req *CreateShareTokenRequest, opts ...http.CallOption) (rsp *CreateShareTokenReply, err error) DelCard(ctx context.Context, req *DelCardInfoRequest, opts ...http.CallOption) (rsp *DelCardReply, err error) GetCardInfo(ctx context.Context, req *GetCardInfoRequest, opts ...http.CallOption) (rsp *GetCardInfoReply, err error) GetMyCards(ctx context.Context, req *GetMyCardsRequest, opts ...http.CallOption) (rsp *GetMyCardsReply, err error) GetTemplates(ctx context.Context, req *GetTemplatesRequest, opts ...http.CallOption) (rsp *GetTemplatesReply, err error) LoginAccount(ctx context.Context, req *LoginAccountRequest, opts ...http.CallOption) (rsp *LoginAccountReply, err error) OCRCard(ctx context.Context, req *OCRCardRequest, opts ...http.CallOption) (rsp *OCRCardReply, err error) OssUpload(ctx context.Context, req *OssUploadRequest, opts ...http.CallOption) (rsp *OssUploadReplay, err error) SaveCard(ctx context.Context, req *SaveCardInfoRequest, opts ...http.CallOption) (rsp *SaveCardReply, err error) SearchCard(ctx context.Context, req *SearchCardRequest, opts ...http.CallOption) (rsp *SearchCardReply, err error) WxRegisterLogin(ctx context.Context, req *WxRegisterLoginRequest, opts ...http.CallOption) (rsp *WxRegisterLoginReply, err error) } type CardHTTPClientImpl struct { cc *http.Client } func NewCardHTTPClient(client *http.Client) CardHTTPClient { return &CardHTTPClientImpl{client} } func (c *CardHTTPClientImpl) AddCardByShareToken(ctx context.Context, in *AddCardByShareTokenRequest, opts ...http.CallOption) (*AddCardByShareTokenReply, error) { var out AddCardByShareTokenReply pattern := "/v1/card/user/bind" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardAddCardByShareToken)) 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 *CardHTTPClientImpl) CreateAccountUser(ctx context.Context, in *CreateAccountUserRequest, opts ...http.CallOption) (*CreateAccountUserReply, error) { var out CreateAccountUserReply pattern := "/v1/account/create" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardCreateAccountUser)) 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 *CardHTTPClientImpl) CreateCard(ctx context.Context, in *CreateCardRequest, opts ...http.CallOption) (*CreateCardReply, error) { var out CreateCardReply pattern := "/v1/card/create" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardCreateCard)) 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 *CardHTTPClientImpl) CreateShareToken(ctx context.Context, in *CreateShareTokenRequest, opts ...http.CallOption) (*CreateShareTokenReply, error) { var out CreateShareTokenReply pattern := "/v1/card/token/create" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardCreateShareToken)) 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 *CardHTTPClientImpl) DelCard(ctx context.Context, in *DelCardInfoRequest, opts ...http.CallOption) (*DelCardReply, error) { var out DelCardReply pattern := "/v1/card/del" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardDelCard)) 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 *CardHTTPClientImpl) GetCardInfo(ctx context.Context, in *GetCardInfoRequest, opts ...http.CallOption) (*GetCardInfoReply, error) { var out GetCardInfoReply pattern := "/v1/card/info" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardGetCardInfo)) 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 *CardHTTPClientImpl) GetMyCards(ctx context.Context, in *GetMyCardsRequest, opts ...http.CallOption) (*GetMyCardsReply, error) { var out GetMyCardsReply pattern := "/v1/cards" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardGetMyCards)) 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 *CardHTTPClientImpl) GetTemplates(ctx context.Context, in *GetTemplatesRequest, opts ...http.CallOption) (*GetTemplatesReply, error) { var out GetTemplatesReply pattern := "/v1/card/templates" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardGetTemplates)) 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 *CardHTTPClientImpl) LoginAccount(ctx context.Context, in *LoginAccountRequest, opts ...http.CallOption) (*LoginAccountReply, error) { var out LoginAccountReply pattern := "/v1/account/login" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardLoginAccount)) 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 *CardHTTPClientImpl) OCRCard(ctx context.Context, in *OCRCardRequest, opts ...http.CallOption) (*OCRCardReply, error) { var out OCRCardReply pattern := "/v1/card/ocr" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardOCRCard)) 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 *CardHTTPClientImpl) OssUpload(ctx context.Context, in *OssUploadRequest, opts ...http.CallOption) (*OssUploadReplay, error) { var out OssUploadReplay pattern := "/v1/card/ossupload" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardOssUpload)) 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 *CardHTTPClientImpl) SaveCard(ctx context.Context, in *SaveCardInfoRequest, opts ...http.CallOption) (*SaveCardReply, error) { var out SaveCardReply pattern := "/v1/card/save" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardSaveCard)) 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 *CardHTTPClientImpl) SearchCard(ctx context.Context, in *SearchCardRequest, opts ...http.CallOption) (*SearchCardReply, error) { var out SearchCardReply pattern := "/v1/card/search" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardSearchCard)) 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 *CardHTTPClientImpl) WxRegisterLogin(ctx context.Context, in *WxRegisterLoginRequest, opts ...http.CallOption) (*WxRegisterLoginReply, error) { var out WxRegisterLoginReply pattern := "/v1/account/wx/login" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationCardWxRegisterLogin)) 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 }