| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 | // Code generated by protoc-gen-go-http. DO NOT EDIT.// versions:// protoc-gen-go-http v2.0.0package accountimport (	context "context"	base "git.ikuban.com/server/base-protobuf/kuban/api/base"	reply "git.ikuban.com/server/kratos-utils/http/reply"	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"	ioutil "io/ioutil"	time "time")// 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.EncodeURLvar _ = ioutil.Discardvar _ = new(time.Time)var _ = new(reply.SuccessReply)var _ = new(base.Html)const _ = http.SupportPackageIsVersion1type AccountHTTPServer interface {	Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)	CheckPhoneCode(context.Context, *CheckPhoneCodeRequest) (*emptypb.Empty, error)	CreateTestUser(context.Context, *emptypb.Empty) (*emptypb.Empty, error)	DebugLogin(context.Context, *DebugLoginRequest) (*TokenReply, error)	SendPhoneCode(context.Context, *SendPhoneCodeRequest) (*emptypb.Empty, error)}func RegisterAccountHTTPServer(s *http.Server, srv AccountHTTPServer) {	r := s.Route("/")	r.POST("/api/login/create", _Account_CreateTestUser0_HTTP_Handler(srv))	r.POST("/api/login/debug", _Account_DebugLogin0_HTTP_Handler(srv))	r.POST("/api/login/authorization", _Account_Authorization0_HTTP_Handler(srv))	r.POST("/api/user/code/send", _Account_SendPhoneCode0_HTTP_Handler(srv))	r.POST("/api/user/code/check", _Account_CheckPhoneCode0_HTTP_Handler(srv))}func _Account_CreateTestUser0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in emptypb.Empty		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.account.Account/CreateTestUser")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.CreateTestUser(ctx, req.(*emptypb.Empty))		})		out, err := h(ctx, &in)		if err != nil {			return err		}		success := &reply.SuccessReply{			Code: 0,		}		if out != nil {			success.Data = out		}		return ctx.Result(200, success)	}}func _Account_DebugLogin0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in DebugLoginRequest		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.account.Account/DebugLogin")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.DebugLogin(ctx, req.(*DebugLoginRequest))		})		out, err := h(ctx, &in)		if err != nil {			return err		}		success := &reply.SuccessReply{			Code: 0,		}		if out != nil {			success.Data = out		}		return ctx.Result(200, success)	}}func _Account_Authorization0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in AuthorizationRequest		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.account.Account/Authorization")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.Authorization(ctx, req.(*AuthorizationRequest))		})		out, err := h(ctx, &in)		if err != nil {			return err		}		success := &reply.SuccessReply{			Code: 0,		}		if out != nil {			success.Data = out		}		return ctx.Result(200, success)	}}func _Account_SendPhoneCode0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in SendPhoneCodeRequest		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.account.Account/SendPhoneCode")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.SendPhoneCode(ctx, req.(*SendPhoneCodeRequest))		})		out, err := h(ctx, &in)		if err != nil {			return err		}		success := &reply.SuccessReply{			Code: 0,		}		if out != nil {			success.Data = out		}		return ctx.Result(200, success)	}}func _Account_CheckPhoneCode0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in CheckPhoneCodeRequest		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.account.Account/CheckPhoneCode")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.CheckPhoneCode(ctx, req.(*CheckPhoneCodeRequest))		})		out, err := h(ctx, &in)		if err != nil {			return err		}		success := &reply.SuccessReply{			Code: 0,		}		if out != nil {			success.Data = out		}		return ctx.Result(200, success)	}}type AccountHTTPClient interface {	Authorization(ctx context.Context, req *AuthorizationRequest, opts ...http.CallOption) (rsp *TokenReply, err error)	CheckPhoneCode(ctx context.Context, req *CheckPhoneCodeRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)	CreateTestUser(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *emptypb.Empty, err error)	DebugLogin(ctx context.Context, req *DebugLoginRequest, opts ...http.CallOption) (rsp *TokenReply, err error)	SendPhoneCode(ctx context.Context, req *SendPhoneCodeRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)}type AccountHTTPClientImpl struct {	cc *http.Client}func NewAccountHTTPClient(client *http.Client) AccountHTTPClient {	return &AccountHTTPClientImpl{client}}func (c *AccountHTTPClientImpl) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...http.CallOption) (*TokenReply, error) {	var out TokenReply	pattern := "/api/login/authorization"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.account.Account/Authorization"))	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 *AccountHTTPClientImpl) CheckPhoneCode(ctx context.Context, in *CheckPhoneCodeRequest, opts ...http.CallOption) (*emptypb.Empty, error) {	var out emptypb.Empty	pattern := "/api/user/code/check"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.account.Account/CheckPhoneCode"))	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 *AccountHTTPClientImpl) CreateTestUser(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*emptypb.Empty, error) {	var out emptypb.Empty	pattern := "/api/login/create"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.account.Account/CreateTestUser"))	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 *AccountHTTPClientImpl) DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...http.CallOption) (*TokenReply, error) {	var out TokenReply	pattern := "/api/login/debug"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.account.Account/DebugLogin"))	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 *AccountHTTPClientImpl) SendPhoneCode(ctx context.Context, in *SendPhoneCodeRequest, opts ...http.CallOption) (*emptypb.Empty, error) {	var out emptypb.Empty	pattern := "/api/user/code/send"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.account.Account/SendPhoneCode"))	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}
 |