account_http.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. // Code generated by protoc-gen-go-http. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go-http v2.0.0
  4. package account
  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. common "git.ikuban.com/server/pw-protobuf/api/common"
  10. http "github.com/go-kratos/kratos/v2/transport/http"
  11. binding "github.com/go-kratos/kratos/v2/transport/http/binding"
  12. emptypb "google.golang.org/protobuf/types/known/emptypb"
  13. ioutil "io/ioutil"
  14. time "time"
  15. )
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the kratos package it is being compiled against.
  18. var _ = new(context.Context)
  19. var _ = binding.EncodeURL
  20. var _ = ioutil.Discard
  21. var _ = new(time.Time)
  22. var _ = new(reply.SuccessReply)
  23. var _ = new(base.Html)
  24. const _ = http.SupportPackageIsVersion1
  25. type AccountHTTPServer interface {
  26. Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
  27. AuthorizationMiniProgram(context.Context, *AuthorizationMiniProgramRequest) (*MiniProgramTokenReply, error)
  28. DebugLogin(context.Context, *DebugLoginRequest) (*TokenReply, error)
  29. GetGetGzhConfig(context.Context, *emptypb.Empty) (*GetGetGzhConfigReply, error)
  30. GetUserLoginConfig(context.Context, *emptypb.Empty) (*common.GetLoginConfigReply, error)
  31. StatisticsSubscribeMessage(context.Context, *StatisticsSubscribeMessageRequest) (*emptypb.Empty, error)
  32. UploadMaterialVoice(context.Context, *MediaID) (*MaterialLink, error)
  33. }
  34. func RegisterAccountHTTPServer(s *http.Server, srv AccountHTTPServer) {
  35. r := s.Route("/")
  36. r.POST("/api/login/debug", _Account_DebugLogin0_HTTP_Handler(srv))
  37. r.POST("/api/login/authorization", _Account_Authorization0_HTTP_Handler(srv))
  38. r.POST("/api/login/authorization/miniprogram", _Account_AuthorizationMiniProgram0_HTTP_Handler(srv))
  39. r.POST("/api/login/config", _Account_GetUserLoginConfig0_HTTP_Handler(srv))
  40. r.POST("/api/login/gzh/conf", _Account_GetGetGzhConfig0_HTTP_Handler(srv))
  41. r.POST("/api/common/material/upload/voice", _Account_UploadMaterialVoice0_HTTP_Handler(srv))
  42. r.POST("/api/common/subscribe/statistic", _Account_StatisticsSubscribeMessage0_HTTP_Handler(srv))
  43. }
  44. func _Account_DebugLogin0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  45. return func(ctx http.Context) error {
  46. var in DebugLoginRequest
  47. if err := ctx.Bind(&in); err != nil {
  48. return err
  49. }
  50. if err := ctx.BindQuery(&in); err != nil {
  51. return err
  52. }
  53. http.SetOperation(ctx, "/api.account.Account/DebugLogin")
  54. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  55. return srv.DebugLogin(ctx, req.(*DebugLoginRequest))
  56. })
  57. out, err := h(ctx, &in)
  58. if err != nil {
  59. return err
  60. }
  61. success := &reply.SuccessReply{
  62. Code: 0,
  63. }
  64. if out != nil {
  65. success.Data = out
  66. }
  67. return ctx.Result(200, success)
  68. }
  69. }
  70. func _Account_Authorization0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  71. return func(ctx http.Context) error {
  72. var in AuthorizationRequest
  73. if err := ctx.Bind(&in); err != nil {
  74. return err
  75. }
  76. if err := ctx.BindQuery(&in); err != nil {
  77. return err
  78. }
  79. http.SetOperation(ctx, "/api.account.Account/Authorization")
  80. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  81. return srv.Authorization(ctx, req.(*AuthorizationRequest))
  82. })
  83. out, err := h(ctx, &in)
  84. if err != nil {
  85. return err
  86. }
  87. success := &reply.SuccessReply{
  88. Code: 0,
  89. }
  90. if out != nil {
  91. success.Data = out
  92. }
  93. return ctx.Result(200, success)
  94. }
  95. }
  96. func _Account_AuthorizationMiniProgram0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  97. return func(ctx http.Context) error {
  98. var in AuthorizationMiniProgramRequest
  99. if err := ctx.Bind(&in); err != nil {
  100. return err
  101. }
  102. if err := ctx.BindQuery(&in); err != nil {
  103. return err
  104. }
  105. http.SetOperation(ctx, "/api.account.Account/AuthorizationMiniProgram")
  106. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  107. return srv.AuthorizationMiniProgram(ctx, req.(*AuthorizationMiniProgramRequest))
  108. })
  109. out, err := h(ctx, &in)
  110. if err != nil {
  111. return err
  112. }
  113. success := &reply.SuccessReply{
  114. Code: 0,
  115. }
  116. if out != nil {
  117. success.Data = out
  118. }
  119. return ctx.Result(200, success)
  120. }
  121. }
  122. func _Account_GetUserLoginConfig0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  123. return func(ctx http.Context) error {
  124. var in emptypb.Empty
  125. if err := ctx.Bind(&in); err != nil {
  126. return err
  127. }
  128. if err := ctx.BindQuery(&in); err != nil {
  129. return err
  130. }
  131. http.SetOperation(ctx, "/api.account.Account/GetUserLoginConfig")
  132. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  133. return srv.GetUserLoginConfig(ctx, req.(*emptypb.Empty))
  134. })
  135. out, err := h(ctx, &in)
  136. if err != nil {
  137. return err
  138. }
  139. success := &reply.SuccessReply{
  140. Code: 0,
  141. }
  142. if out != nil {
  143. success.Data = out
  144. }
  145. return ctx.Result(200, success)
  146. }
  147. }
  148. func _Account_GetGetGzhConfig0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  149. return func(ctx http.Context) error {
  150. var in emptypb.Empty
  151. if err := ctx.Bind(&in); err != nil {
  152. return err
  153. }
  154. if err := ctx.BindQuery(&in); err != nil {
  155. return err
  156. }
  157. http.SetOperation(ctx, "/api.account.Account/GetGetGzhConfig")
  158. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  159. return srv.GetGetGzhConfig(ctx, req.(*emptypb.Empty))
  160. })
  161. out, err := h(ctx, &in)
  162. if err != nil {
  163. return err
  164. }
  165. success := &reply.SuccessReply{
  166. Code: 0,
  167. }
  168. if out != nil {
  169. success.Data = out
  170. }
  171. return ctx.Result(200, success)
  172. }
  173. }
  174. func _Account_UploadMaterialVoice0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  175. return func(ctx http.Context) error {
  176. var in MediaID
  177. if err := ctx.Bind(&in); err != nil {
  178. return err
  179. }
  180. if err := ctx.BindQuery(&in); err != nil {
  181. return err
  182. }
  183. http.SetOperation(ctx, "/api.account.Account/UploadMaterialVoice")
  184. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  185. return srv.UploadMaterialVoice(ctx, req.(*MediaID))
  186. })
  187. out, err := h(ctx, &in)
  188. if err != nil {
  189. return err
  190. }
  191. success := &reply.SuccessReply{
  192. Code: 0,
  193. }
  194. if out != nil {
  195. success.Data = out
  196. }
  197. return ctx.Result(200, success)
  198. }
  199. }
  200. func _Account_StatisticsSubscribeMessage0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
  201. return func(ctx http.Context) error {
  202. var in StatisticsSubscribeMessageRequest
  203. if err := ctx.Bind(&in); err != nil {
  204. return err
  205. }
  206. if err := ctx.BindQuery(&in); err != nil {
  207. return err
  208. }
  209. http.SetOperation(ctx, "/api.account.Account/StatisticsSubscribeMessage")
  210. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  211. return srv.StatisticsSubscribeMessage(ctx, req.(*StatisticsSubscribeMessageRequest))
  212. })
  213. out, err := h(ctx, &in)
  214. if err != nil {
  215. return err
  216. }
  217. success := &reply.SuccessReply{
  218. Code: 0,
  219. }
  220. if out != nil {
  221. success.Data = out
  222. }
  223. return ctx.Result(200, success)
  224. }
  225. }
  226. type AccountHTTPClient interface {
  227. Authorization(ctx context.Context, req *AuthorizationRequest, opts ...http.CallOption) (rsp *TokenReply, err error)
  228. AuthorizationMiniProgram(ctx context.Context, req *AuthorizationMiniProgramRequest, opts ...http.CallOption) (rsp *MiniProgramTokenReply, err error)
  229. DebugLogin(ctx context.Context, req *DebugLoginRequest, opts ...http.CallOption) (rsp *TokenReply, err error)
  230. GetGetGzhConfig(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *GetGetGzhConfigReply, err error)
  231. GetUserLoginConfig(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *common.GetLoginConfigReply, err error)
  232. StatisticsSubscribeMessage(ctx context.Context, req *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
  233. UploadMaterialVoice(ctx context.Context, req *MediaID, opts ...http.CallOption) (rsp *MaterialLink, err error)
  234. }
  235. type AccountHTTPClientImpl struct {
  236. cc *http.Client
  237. }
  238. func NewAccountHTTPClient(client *http.Client) AccountHTTPClient {
  239. return &AccountHTTPClientImpl{client}
  240. }
  241. func (c *AccountHTTPClientImpl) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...http.CallOption) (*TokenReply, error) {
  242. var out TokenReply
  243. pattern := "/api/login/authorization"
  244. path := binding.EncodeURL(pattern, in, false)
  245. opts = append(opts, http.Operation("/api.account.Account/Authorization"))
  246. opts = append(opts, http.PathTemplate(pattern))
  247. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  248. if err != nil {
  249. return nil, err
  250. }
  251. return &out, err
  252. }
  253. func (c *AccountHTTPClientImpl) AuthorizationMiniProgram(ctx context.Context, in *AuthorizationMiniProgramRequest, opts ...http.CallOption) (*MiniProgramTokenReply, error) {
  254. var out MiniProgramTokenReply
  255. pattern := "/api/login/authorization/miniprogram"
  256. path := binding.EncodeURL(pattern, in, false)
  257. opts = append(opts, http.Operation("/api.account.Account/AuthorizationMiniProgram"))
  258. opts = append(opts, http.PathTemplate(pattern))
  259. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  260. if err != nil {
  261. return nil, err
  262. }
  263. return &out, err
  264. }
  265. func (c *AccountHTTPClientImpl) DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...http.CallOption) (*TokenReply, error) {
  266. var out TokenReply
  267. pattern := "/api/login/debug"
  268. path := binding.EncodeURL(pattern, in, false)
  269. opts = append(opts, http.Operation("/api.account.Account/DebugLogin"))
  270. opts = append(opts, http.PathTemplate(pattern))
  271. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  272. if err != nil {
  273. return nil, err
  274. }
  275. return &out, err
  276. }
  277. func (c *AccountHTTPClientImpl) GetGetGzhConfig(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*GetGetGzhConfigReply, error) {
  278. var out GetGetGzhConfigReply
  279. pattern := "/api/login/gzh/conf"
  280. path := binding.EncodeURL(pattern, in, false)
  281. opts = append(opts, http.Operation("/api.account.Account/GetGetGzhConfig"))
  282. opts = append(opts, http.PathTemplate(pattern))
  283. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  284. if err != nil {
  285. return nil, err
  286. }
  287. return &out, err
  288. }
  289. func (c *AccountHTTPClientImpl) GetUserLoginConfig(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*common.GetLoginConfigReply, error) {
  290. var out common.GetLoginConfigReply
  291. pattern := "/api/login/config"
  292. path := binding.EncodeURL(pattern, in, false)
  293. opts = append(opts, http.Operation("/api.account.Account/GetUserLoginConfig"))
  294. opts = append(opts, http.PathTemplate(pattern))
  295. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  296. if err != nil {
  297. return nil, err
  298. }
  299. return &out, err
  300. }
  301. func (c *AccountHTTPClientImpl) StatisticsSubscribeMessage(ctx context.Context, in *StatisticsSubscribeMessageRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
  302. var out emptypb.Empty
  303. pattern := "/api/common/subscribe/statistic"
  304. path := binding.EncodeURL(pattern, in, false)
  305. opts = append(opts, http.Operation("/api.account.Account/StatisticsSubscribeMessage"))
  306. opts = append(opts, http.PathTemplate(pattern))
  307. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  308. if err != nil {
  309. return nil, err
  310. }
  311. return &out, err
  312. }
  313. func (c *AccountHTTPClientImpl) UploadMaterialVoice(ctx context.Context, in *MediaID, opts ...http.CallOption) (*MaterialLink, error) {
  314. var out MaterialLink
  315. pattern := "/api/common/material/upload/voice"
  316. path := binding.EncodeURL(pattern, in, false)
  317. opts = append(opts, http.Operation("/api.account.Account/UploadMaterialVoice"))
  318. opts = append(opts, http.PathTemplate(pattern))
  319. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  320. if err != nil {
  321. return nil, err
  322. }
  323. return &out, err
  324. }