| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 | // Code generated by protoc-gen-go-http. DO NOT EDIT.// versions:// protoc-gen-go-http v2.0.0package basicsimport (	context "context"	base "git.ikuban.com/server/base-protobuf/kuban/api/base"	reply "git.ikuban.com/server/kratos-utils/http/reply"	common "git.ikuban.com/server/pw-protobuf/api/common"	http "github.com/go-kratos/kratos/v2/transport/http"	binding "github.com/go-kratos/kratos/v2/transport/http/binding"	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 BasicsHTTPServer interface {	RandomAvatar(context.Context, *common.SexReq) (*RandomAvatarReply, error)	RandomIntroduce(context.Context, *common.SexReq) (*common.RandomIntroduceReply, error)	RandomNickname(context.Context, *common.SexReq) (*RandomNicknameReply, error)}func RegisterBasicsHTTPServer(s *http.Server, srv BasicsHTTPServer) {	r := s.Route("/")	r.POST("/api/common/random/nickname", _Basics_RandomNickname0_HTTP_Handler(srv))	r.POST("/api/common/random/avatar", _Basics_RandomAvatar0_HTTP_Handler(srv))	r.POST("/api/common/random/introduce", _Basics_RandomIntroduce0_HTTP_Handler(srv))}func _Basics_RandomNickname0_HTTP_Handler(srv BasicsHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in common.SexReq		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.basics.Basics/RandomNickname")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.RandomNickname(ctx, req.(*common.SexReq))		})		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 _Basics_RandomAvatar0_HTTP_Handler(srv BasicsHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in common.SexReq		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.basics.Basics/RandomAvatar")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.RandomAvatar(ctx, req.(*common.SexReq))		})		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 _Basics_RandomIntroduce0_HTTP_Handler(srv BasicsHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in common.SexReq		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.basics.Basics/RandomIntroduce")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.RandomIntroduce(ctx, req.(*common.SexReq))		})		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 BasicsHTTPClient interface {	RandomAvatar(ctx context.Context, req *common.SexReq, opts ...http.CallOption) (rsp *RandomAvatarReply, err error)	RandomIntroduce(ctx context.Context, req *common.SexReq, opts ...http.CallOption) (rsp *common.RandomIntroduceReply, err error)	RandomNickname(ctx context.Context, req *common.SexReq, opts ...http.CallOption) (rsp *RandomNicknameReply, err error)}type BasicsHTTPClientImpl struct {	cc *http.Client}func NewBasicsHTTPClient(client *http.Client) BasicsHTTPClient {	return &BasicsHTTPClientImpl{client}}func (c *BasicsHTTPClientImpl) RandomAvatar(ctx context.Context, in *common.SexReq, opts ...http.CallOption) (*RandomAvatarReply, error) {	var out RandomAvatarReply	pattern := "/api/common/random/avatar"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.basics.Basics/RandomAvatar"))	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 *BasicsHTTPClientImpl) RandomIntroduce(ctx context.Context, in *common.SexReq, opts ...http.CallOption) (*common.RandomIntroduceReply, error) {	var out common.RandomIntroduceReply	pattern := "/api/common/random/introduce"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.basics.Basics/RandomIntroduce"))	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 *BasicsHTTPClientImpl) RandomNickname(ctx context.Context, in *common.SexReq, opts ...http.CallOption) (*RandomNicknameReply, error) {	var out RandomNicknameReply	pattern := "/api/common/random/nickname"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.basics.Basics/RandomNickname"))	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}
 |