statistics_http.pb.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. StatisticsAISubscribeMessage(context.Context, *StatisticsAISubscribeMessageRequest) (*emptypb.Empty, error)
  26. StatisticsSubscribeMessage(context.Context, *StatisticsSubscribeMessageRequest) (*emptypb.Empty, error)
  27. }
  28. func RegisterStatisticsHTTPServer(s *http.Server, srv StatisticsHTTPServer) {
  29. r := s.Route("/")
  30. r.POST("/api/common/subscribe/statistic", _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv))
  31. r.POST("/api/common/ai/subscribe/statistic", _Statistics_StatisticsAISubscribeMessage0_HTTP_Handler(srv))
  32. }
  33. func _Statistics_StatisticsSubscribeMessage0_HTTP_Handler(srv StatisticsHTTPServer) func(ctx http.Context) error {
  34. return func(ctx http.Context) error {
  35. var in StatisticsSubscribeMessageRequest
  36. if err := ctx.Bind(&in); err != nil {
  37. return err
  38. }
  39. if err := ctx.BindQuery(&in); err != nil {
  40. return err
  41. }
  42. http.SetOperation(ctx, "/api.statistics.Statistics/StatisticsSubscribeMessage")
  43. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  44. return srv.StatisticsSubscribeMessage(ctx, req.(*StatisticsSubscribeMessageRequest))
  45. })
  46. out, err := h(ctx, &in)
  47. if err != nil {
  48. return err
  49. }
  50. success := &reply.SuccessReply{
  51. Code: 0,
  52. }
  53. if out != nil {
  54. success.Data = out
  55. }
  56. return ctx.Result(200, success)
  57. }
  58. }
  59. func _Statistics_StatisticsAISubscribeMessage0_HTTP_Handler(srv StatisticsHTTPServer) func(ctx http.Context) error {
  60. return func(ctx http.Context) error {
  61. var in StatisticsAISubscribeMessageRequest
  62. if err := ctx.Bind(&in); err != nil {
  63. return err
  64. }
  65. if err := ctx.BindQuery(&in); err != nil {
  66. return err
  67. }
  68. http.SetOperation(ctx, "/api.statistics.Statistics/StatisticsAISubscribeMessage")
  69. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  70. return srv.StatisticsAISubscribeMessage(ctx, req.(*StatisticsAISubscribeMessageRequest))
  71. })
  72. out, err := h(ctx, &in)
  73. if err != nil {
  74. return err
  75. }
  76. success := &reply.SuccessReply{
  77. Code: 0,
  78. }
  79. if out != nil {
  80. success.Data = out
  81. }
  82. return ctx.Result(200, success)
  83. }
  84. }
  85. type StatisticsHTTPClient interface {
  86. StatisticsAISubscribeMessage(ctx context.Context, req *StatisticsAISubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
  87. StatisticsSubscribeMessage(ctx context.Context, req *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
  88. }
  89. type StatisticsHTTPClientImpl struct {
  90. cc *http.Client
  91. }
  92. func NewStatisticsHTTPClient(client *http.Client) StatisticsHTTPClient {
  93. return &StatisticsHTTPClientImpl{client}
  94. }
  95. func (c *StatisticsHTTPClientImpl) StatisticsAISubscribeMessage(ctx context.Context, in *StatisticsAISubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
  96. var out emptypb.Empty
  97. pattern := "/api/common/ai/subscribe/statistic"
  98. path := binding.EncodeURL(pattern, in, false)
  99. opts = append(opts, http.Operation("/api.statistics.Statistics/StatisticsAISubscribeMessage"))
  100. opts = append(opts, http.PathTemplate(pattern))
  101. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. return &out, err
  106. }
  107. func (c *StatisticsHTTPClientImpl) StatisticsSubscribeMessage(ctx context.Context, in *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
  108. var out emptypb.Empty
  109. pattern := "/api/common/subscribe/statistic"
  110. path := binding.EncodeURL(pattern, in, false)
  111. opts = append(opts, http.Operation("/api.statistics.Statistics/StatisticsSubscribeMessage"))
  112. opts = append(opts, http.PathTemplate(pattern))
  113. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  114. if err != nil {
  115. return nil, err
  116. }
  117. return &out, err
  118. }