// Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // protoc-gen-go-http v2.0.0 package statistics import ( 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.EncodeURL var _ = ioutil.Discard var _ = new(time.Time) var _ = new(reply.SuccessReply) var _ = new(base.Html) const _ = http.SupportPackageIsVersion1 type StatisticsHTTPServer interface { StatisticsAISubscribeMessage(context.Context, *StatisticsAISubscribeMessageRequest) (*emptypb.Empty, error) StatisticsSubscribeMessage(context.Context, *StatisticsSubscribeMessageRequest) (*emptypb.Empty, error) } func RegisterStatisticsHTTPServer(s *http.Server, srv StatisticsHTTPServer) { r := s.Route("/") r.POST("/api/common/subscribe/statistic", _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv)) r.POST("/api/common/ai/subscribe/statistic", _Statistics_StatisticsAISubscribeMessage0_HTTP_Handler(srv)) } func _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv StatisticsHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in StatisticsSubscribeMessageRequest if err := ctx.Bind(&in); err != nil { return err } if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/api.statistics.Statistics/StatisticsSubscribeMessage") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.StatisticsSubscribeMessage(ctx, req.(*StatisticsSubscribeMessageRequest)) }) 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 _Statistics_StatisticsAISubscribeMessage0_HTTP_Handler(srv StatisticsHTTPServer) func(ctx http.Context) error { return func(ctx http.Context) error { var in StatisticsAISubscribeMessageRequest if err := ctx.Bind(&in); err != nil { return err } if err := ctx.BindQuery(&in); err != nil { return err } http.SetOperation(ctx, "/api.statistics.Statistics/StatisticsAISubscribeMessage") h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.StatisticsAISubscribeMessage(ctx, req.(*StatisticsAISubscribeMessageRequest)) }) 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 StatisticsHTTPClient interface { StatisticsAISubscribeMessage(ctx context.Context, req *StatisticsAISubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) StatisticsSubscribeMessage(ctx context.Context, req *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error) } type StatisticsHTTPClientImpl struct { cc *http.Client } func NewStatisticsHTTPClient(client *http.Client) StatisticsHTTPClient { return &StatisticsHTTPClientImpl{client} } func (c *StatisticsHTTPClientImpl) StatisticsAISubscribeMessage(ctx context.Context, in *StatisticsAISubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) { var out emptypb.Empty pattern := "/api/common/ai/subscribe/statistic" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/api.statistics.Statistics/StatisticsAISubscribeMessage")) 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 *StatisticsHTTPClientImpl) StatisticsSubscribeMessage(ctx context.Context, in *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) { var out emptypb.Empty pattern := "/api/common/subscribe/statistic" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation("/api.statistics.Statistics/StatisticsSubscribeMessage")) 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 }