| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 | // Code generated by protoc-gen-go-http. DO NOT EDIT.// versions:// protoc-gen-go-http v2.0.0package activityimport (	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 ActivityHTTPServer interface {	FindSignInList(context.Context, *emptypb.Empty) (*FindSignInListReply, error)	GetSignDouble(context.Context, *emptypb.Empty) (*emptypb.Empty, error)	Sign(context.Context, *SignRequest) (*emptypb.Empty, error)}func RegisterActivityHTTPServer(s *http.Server, srv ActivityHTTPServer) {	r := s.Route("/")	r.POST("/api/sign/list", _Activity_FindSignInList0_HTTP_Handler(srv))	r.POST("/api/sign", _Activity_Sign0_HTTP_Handler(srv))	r.POST("/api/sign/again", _Activity_GetSignDouble0_HTTP_Handler(srv))}func _Activity_FindSignInList0_HTTP_Handler(srv ActivityHTTPServer) 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.activity.Activity/FindSignInList")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.FindSignInList(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 _Activity_Sign0_HTTP_Handler(srv ActivityHTTPServer) func(ctx http.Context) error {	return func(ctx http.Context) error {		var in SignRequest		if err := ctx.Bind(&in); err != nil {			return err		}		if err := ctx.BindQuery(&in); err != nil {			return err		}		http.SetOperation(ctx, "/api.activity.Activity/Sign")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.Sign(ctx, req.(*SignRequest))		})		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 _Activity_GetSignDouble0_HTTP_Handler(srv ActivityHTTPServer) 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.activity.Activity/GetSignDouble")		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {			return srv.GetSignDouble(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)	}}type ActivityHTTPClient interface {	FindSignInList(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *FindSignInListReply, err error)	GetSignDouble(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *emptypb.Empty, err error)	Sign(ctx context.Context, req *SignRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)}type ActivityHTTPClientImpl struct {	cc *http.Client}func NewActivityHTTPClient(client *http.Client) ActivityHTTPClient {	return &ActivityHTTPClientImpl{client}}func (c *ActivityHTTPClientImpl) FindSignInList(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*FindSignInListReply, error) {	var out FindSignInListReply	pattern := "/api/sign/list"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.activity.Activity/FindSignInList"))	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 *ActivityHTTPClientImpl) GetSignDouble(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*emptypb.Empty, error) {	var out emptypb.Empty	pattern := "/api/sign/again"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.activity.Activity/GetSignDouble"))	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 *ActivityHTTPClientImpl) Sign(ctx context.Context, in *SignRequest, opts ...http.CallOption) (*emptypb.Empty, error) {	var out emptypb.Empty	pattern := "/api/sign"	path := binding.EncodeURL(pattern, in, false)	opts = append(opts, http.Operation("/api.activity.Activity/Sign"))	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}
 |