statistics_http.pb.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Code generated by protoc-gen-go-http. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go-http v2.0.0
  4. package statistics
  5. import (
  6. context "context"
  7. base "git.ikuban.com/server/base-protobuf/kuban/api/base"
  8. reply "git.ikuban.com/server/kratos-utils/http/reply"
  9. http "github.com/go-kratos/kratos/v2/transport/http"
  10. binding "github.com/go-kratos/kratos/v2/transport/http/binding"
  11. emptypb "google.golang.org/protobuf/types/known/emptypb"
  12. ioutil "io/ioutil"
  13. time "time"
  14. )
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the kratos package it is being compiled against.
  17. var _ = new(context.Context)
  18. var _ = binding.EncodeURL
  19. var _ = ioutil.Discard
  20. var _ = new(time.Time)
  21. var _ = new(reply.SuccessReply)
  22. var _ = new(base.Html)
  23. const _ = http.SupportPackageIsVersion1
  24. type StatisticsHTTPServer interface {
  25. StatisticsSubscribeMessage(context.Context, *StatisticsSubscribeMessageRequest) (*emptypb.Empty, error)
  26. }
  27. func RegisterStatisticsHTTPServer(s *http.Server, srv StatisticsHTTPServer) {
  28. r := s.Route("/")
  29. r.POST("/api/common/subscribe/statistic", _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv))
  30. }
  31. func _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv StatisticsHTTPServer) func(ctx http.Context) error {
  32. return func(ctx http.Context) error {
  33. var in StatisticsSubscribeMessageRequest
  34. if err := ctx.Bind(&in); err != nil {
  35. return err
  36. }
  37. if err := ctx.BindQuery(&in); err != nil {
  38. return err
  39. }
  40. http.SetOperation(ctx, "/api.statistics.Statistics/StatisticsSubscribeMessage")
  41. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  42. return srv.StatisticsSubscribeMessage(ctx, req.(*StatisticsSubscribeMessageRequest))
  43. })
  44. out, err := h(ctx, &in)
  45. if err != nil {
  46. return err
  47. }
  48. success := &reply.SuccessReply{
  49. Code: 0,
  50. }
  51. if out != nil {
  52. success.Data = out
  53. }
  54. return ctx.Result(200, success)
  55. }
  56. }
  57. type StatisticsHTTPClient interface {
  58. StatisticsSubscribeMessage(ctx context.Context, req *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
  59. }
  60. type StatisticsHTTPClientImpl struct {
  61. cc *http.Client
  62. }
  63. func NewStatisticsHTTPClient(client *http.Client) StatisticsHTTPClient {
  64. return &StatisticsHTTPClientImpl{client}
  65. }
  66. func (c *StatisticsHTTPClientImpl) StatisticsSubscribeMessage(ctx context.Context, in *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
  67. var out emptypb.Empty
  68. pattern := "/api/common/subscribe/statistic"
  69. path := binding.EncodeURL(pattern, in, false)
  70. opts = append(opts, http.Operation("/api.statistics.Statistics/StatisticsSubscribeMessage"))
  71. opts = append(opts, http.PathTemplate(pattern))
  72. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. return &out, err
  77. }