card_http.pb.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. // Code generated by protoc-gen-go-http. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-http v2.4.0
  4. // - protoc v3.17.3
  5. // source: card/card.proto
  6. package card
  7. import (
  8. context "context"
  9. http "github.com/go-kratos/kratos/v2/transport/http"
  10. binding "github.com/go-kratos/kratos/v2/transport/http/binding"
  11. )
  12. // This is a compile-time assertion to ensure that this generated file
  13. // is compatible with the kratos package it is being compiled against.
  14. var _ = new(context.Context)
  15. var _ = binding.EncodeURL
  16. const _ = http.SupportPackageIsVersion1
  17. const OperationCardAddCardByShareToken = "/card.Card/AddCardByShareToken"
  18. const OperationCardCreateAccountUser = "/card.Card/CreateAccountUser"
  19. const OperationCardCreateCard = "/card.Card/CreateCard"
  20. const OperationCardCreateShareToken = "/card.Card/CreateShareToken"
  21. const OperationCardDelCard = "/card.Card/DelCard"
  22. const OperationCardGetCardInfo = "/card.Card/GetCardInfo"
  23. const OperationCardGetMyCards = "/card.Card/GetMyCards"
  24. const OperationCardGetTemplates = "/card.Card/GetTemplates"
  25. const OperationCardLoginAccount = "/card.Card/LoginAccount"
  26. const OperationCardOCRCard = "/card.Card/OCRCard"
  27. const OperationCardOssUpload = "/card.Card/OssUpload"
  28. const OperationCardSaveCard = "/card.Card/SaveCard"
  29. const OperationCardSearchCard = "/card.Card/SearchCard"
  30. const OperationCardWxRegisterLogin = "/card.Card/WxRegisterLogin"
  31. type CardHTTPServer interface {
  32. AddCardByShareToken(context.Context, *AddCardByShareTokenRequest) (*AddCardByShareTokenReply, error)
  33. CreateAccountUser(context.Context, *CreateAccountUserRequest) (*CreateAccountUserReply, error)
  34. CreateCard(context.Context, *CreateCardRequest) (*CreateCardReply, error)
  35. CreateShareToken(context.Context, *CreateShareTokenRequest) (*CreateShareTokenReply, error)
  36. DelCard(context.Context, *DelCardInfoRequest) (*DelCardReply, error)
  37. GetCardInfo(context.Context, *GetCardInfoRequest) (*GetCardInfoReply, error)
  38. GetMyCards(context.Context, *GetMyCardsRequest) (*GetMyCardsReply, error)
  39. GetTemplates(context.Context, *GetTemplatesRequest) (*GetTemplatesReply, error)
  40. LoginAccount(context.Context, *LoginAccountRequest) (*LoginAccountReply, error)
  41. OCRCard(context.Context, *OCRCardRequest) (*OCRCardReply, error)
  42. OssUpload(context.Context, *OssUploadRequest) (*OssUploadReplay, error)
  43. SaveCard(context.Context, *SaveCardInfoRequest) (*SaveCardReply, error)
  44. SearchCard(context.Context, *SearchCardRequest) (*SearchCardReply, error)
  45. WxRegisterLogin(context.Context, *WxRegisterLoginRequest) (*WxRegisterLoginReply, error)
  46. }
  47. func RegisterCardHTTPServer(s *http.Server, srv CardHTTPServer) {
  48. r := s.Route("/")
  49. r.POST("/v1/account/create", _Card_CreateAccountUser0_HTTP_Handler(srv))
  50. r.POST("/v1/account/login", _Card_LoginAccount0_HTTP_Handler(srv))
  51. r.POST("/v1/account/wx/login", _Card_WxRegisterLogin0_HTTP_Handler(srv))
  52. r.POST("/v1/card/create", _Card_CreateCard0_HTTP_Handler(srv))
  53. r.POST("/v1/card/info", _Card_GetCardInfo0_HTTP_Handler(srv))
  54. r.POST("/v1/cards", _Card_GetMyCards0_HTTP_Handler(srv))
  55. r.POST("/v1/card/del", _Card_DelCard0_HTTP_Handler(srv))
  56. r.POST("/v1/card/save", _Card_SaveCard0_HTTP_Handler(srv))
  57. r.POST("/v1/card/search", _Card_SearchCard0_HTTP_Handler(srv))
  58. r.POST("/v1/card/templates", _Card_GetTemplates0_HTTP_Handler(srv))
  59. r.POST("/v1/card/token/create", _Card_CreateShareToken0_HTTP_Handler(srv))
  60. r.POST("/v1/card/user/bind", _Card_AddCardByShareToken0_HTTP_Handler(srv))
  61. r.POST("/v1/card/ocr", _Card_OCRCard0_HTTP_Handler(srv))
  62. r.POST("/v1/card/ossupload", _Card_OssUpload0_HTTP_Handler(srv))
  63. }
  64. func _Card_CreateAccountUser0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  65. return func(ctx http.Context) error {
  66. var in CreateAccountUserRequest
  67. if err := ctx.Bind(&in); err != nil {
  68. return err
  69. }
  70. http.SetOperation(ctx, OperationCardCreateAccountUser)
  71. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  72. return srv.CreateAccountUser(ctx, req.(*CreateAccountUserRequest))
  73. })
  74. out, err := h(ctx, &in)
  75. if err != nil {
  76. return err
  77. }
  78. reply := out.(*CreateAccountUserReply)
  79. return ctx.Result(200, reply)
  80. }
  81. }
  82. func _Card_LoginAccount0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  83. return func(ctx http.Context) error {
  84. var in LoginAccountRequest
  85. if err := ctx.Bind(&in); err != nil {
  86. return err
  87. }
  88. http.SetOperation(ctx, OperationCardLoginAccount)
  89. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  90. return srv.LoginAccount(ctx, req.(*LoginAccountRequest))
  91. })
  92. out, err := h(ctx, &in)
  93. if err != nil {
  94. return err
  95. }
  96. reply := out.(*LoginAccountReply)
  97. return ctx.Result(200, reply)
  98. }
  99. }
  100. func _Card_WxRegisterLogin0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  101. return func(ctx http.Context) error {
  102. var in WxRegisterLoginRequest
  103. if err := ctx.Bind(&in); err != nil {
  104. return err
  105. }
  106. http.SetOperation(ctx, OperationCardWxRegisterLogin)
  107. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  108. return srv.WxRegisterLogin(ctx, req.(*WxRegisterLoginRequest))
  109. })
  110. out, err := h(ctx, &in)
  111. if err != nil {
  112. return err
  113. }
  114. reply := out.(*WxRegisterLoginReply)
  115. return ctx.Result(200, reply)
  116. }
  117. }
  118. func _Card_CreateCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  119. return func(ctx http.Context) error {
  120. var in CreateCardRequest
  121. if err := ctx.Bind(&in); err != nil {
  122. return err
  123. }
  124. http.SetOperation(ctx, OperationCardCreateCard)
  125. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  126. return srv.CreateCard(ctx, req.(*CreateCardRequest))
  127. })
  128. out, err := h(ctx, &in)
  129. if err != nil {
  130. return err
  131. }
  132. reply := out.(*CreateCardReply)
  133. return ctx.Result(200, reply)
  134. }
  135. }
  136. func _Card_GetCardInfo0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  137. return func(ctx http.Context) error {
  138. var in GetCardInfoRequest
  139. if err := ctx.Bind(&in); err != nil {
  140. return err
  141. }
  142. http.SetOperation(ctx, OperationCardGetCardInfo)
  143. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  144. return srv.GetCardInfo(ctx, req.(*GetCardInfoRequest))
  145. })
  146. out, err := h(ctx, &in)
  147. if err != nil {
  148. return err
  149. }
  150. reply := out.(*GetCardInfoReply)
  151. return ctx.Result(200, reply)
  152. }
  153. }
  154. func _Card_GetMyCards0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  155. return func(ctx http.Context) error {
  156. var in GetMyCardsRequest
  157. if err := ctx.Bind(&in); err != nil {
  158. return err
  159. }
  160. http.SetOperation(ctx, OperationCardGetMyCards)
  161. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  162. return srv.GetMyCards(ctx, req.(*GetMyCardsRequest))
  163. })
  164. out, err := h(ctx, &in)
  165. if err != nil {
  166. return err
  167. }
  168. reply := out.(*GetMyCardsReply)
  169. return ctx.Result(200, reply)
  170. }
  171. }
  172. func _Card_DelCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  173. return func(ctx http.Context) error {
  174. var in DelCardInfoRequest
  175. if err := ctx.Bind(&in); err != nil {
  176. return err
  177. }
  178. http.SetOperation(ctx, OperationCardDelCard)
  179. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  180. return srv.DelCard(ctx, req.(*DelCardInfoRequest))
  181. })
  182. out, err := h(ctx, &in)
  183. if err != nil {
  184. return err
  185. }
  186. reply := out.(*DelCardReply)
  187. return ctx.Result(200, reply)
  188. }
  189. }
  190. func _Card_SaveCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  191. return func(ctx http.Context) error {
  192. var in SaveCardInfoRequest
  193. if err := ctx.Bind(&in); err != nil {
  194. return err
  195. }
  196. http.SetOperation(ctx, OperationCardSaveCard)
  197. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.SaveCard(ctx, req.(*SaveCardInfoRequest))
  199. })
  200. out, err := h(ctx, &in)
  201. if err != nil {
  202. return err
  203. }
  204. reply := out.(*SaveCardReply)
  205. return ctx.Result(200, reply)
  206. }
  207. }
  208. func _Card_SearchCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  209. return func(ctx http.Context) error {
  210. var in SearchCardRequest
  211. if err := ctx.Bind(&in); err != nil {
  212. return err
  213. }
  214. http.SetOperation(ctx, OperationCardSearchCard)
  215. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  216. return srv.SearchCard(ctx, req.(*SearchCardRequest))
  217. })
  218. out, err := h(ctx, &in)
  219. if err != nil {
  220. return err
  221. }
  222. reply := out.(*SearchCardReply)
  223. return ctx.Result(200, reply)
  224. }
  225. }
  226. func _Card_GetTemplates0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  227. return func(ctx http.Context) error {
  228. var in GetTemplatesRequest
  229. if err := ctx.Bind(&in); err != nil {
  230. return err
  231. }
  232. http.SetOperation(ctx, OperationCardGetTemplates)
  233. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  234. return srv.GetTemplates(ctx, req.(*GetTemplatesRequest))
  235. })
  236. out, err := h(ctx, &in)
  237. if err != nil {
  238. return err
  239. }
  240. reply := out.(*GetTemplatesReply)
  241. return ctx.Result(200, reply)
  242. }
  243. }
  244. func _Card_CreateShareToken0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  245. return func(ctx http.Context) error {
  246. var in CreateShareTokenRequest
  247. if err := ctx.Bind(&in); err != nil {
  248. return err
  249. }
  250. http.SetOperation(ctx, OperationCardCreateShareToken)
  251. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  252. return srv.CreateShareToken(ctx, req.(*CreateShareTokenRequest))
  253. })
  254. out, err := h(ctx, &in)
  255. if err != nil {
  256. return err
  257. }
  258. reply := out.(*CreateShareTokenReply)
  259. return ctx.Result(200, reply)
  260. }
  261. }
  262. func _Card_AddCardByShareToken0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  263. return func(ctx http.Context) error {
  264. var in AddCardByShareTokenRequest
  265. if err := ctx.Bind(&in); err != nil {
  266. return err
  267. }
  268. http.SetOperation(ctx, OperationCardAddCardByShareToken)
  269. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  270. return srv.AddCardByShareToken(ctx, req.(*AddCardByShareTokenRequest))
  271. })
  272. out, err := h(ctx, &in)
  273. if err != nil {
  274. return err
  275. }
  276. reply := out.(*AddCardByShareTokenReply)
  277. return ctx.Result(200, reply)
  278. }
  279. }
  280. func _Card_OCRCard0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  281. return func(ctx http.Context) error {
  282. var in OCRCardRequest
  283. if err := ctx.Bind(&in); err != nil {
  284. return err
  285. }
  286. http.SetOperation(ctx, OperationCardOCRCard)
  287. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  288. return srv.OCRCard(ctx, req.(*OCRCardRequest))
  289. })
  290. out, err := h(ctx, &in)
  291. if err != nil {
  292. return err
  293. }
  294. reply := out.(*OCRCardReply)
  295. return ctx.Result(200, reply)
  296. }
  297. }
  298. func _Card_OssUpload0_HTTP_Handler(srv CardHTTPServer) func(ctx http.Context) error {
  299. return func(ctx http.Context) error {
  300. var in OssUploadRequest
  301. if err := ctx.Bind(&in); err != nil {
  302. return err
  303. }
  304. http.SetOperation(ctx, OperationCardOssUpload)
  305. h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
  306. return srv.OssUpload(ctx, req.(*OssUploadRequest))
  307. })
  308. out, err := h(ctx, &in)
  309. if err != nil {
  310. return err
  311. }
  312. reply := out.(*OssUploadReplay)
  313. return ctx.Result(200, reply)
  314. }
  315. }
  316. type CardHTTPClient interface {
  317. AddCardByShareToken(ctx context.Context, req *AddCardByShareTokenRequest, opts ...http.CallOption) (rsp *AddCardByShareTokenReply, err error)
  318. CreateAccountUser(ctx context.Context, req *CreateAccountUserRequest, opts ...http.CallOption) (rsp *CreateAccountUserReply, err error)
  319. CreateCard(ctx context.Context, req *CreateCardRequest, opts ...http.CallOption) (rsp *CreateCardReply, err error)
  320. CreateShareToken(ctx context.Context, req *CreateShareTokenRequest, opts ...http.CallOption) (rsp *CreateShareTokenReply, err error)
  321. DelCard(ctx context.Context, req *DelCardInfoRequest, opts ...http.CallOption) (rsp *DelCardReply, err error)
  322. GetCardInfo(ctx context.Context, req *GetCardInfoRequest, opts ...http.CallOption) (rsp *GetCardInfoReply, err error)
  323. GetMyCards(ctx context.Context, req *GetMyCardsRequest, opts ...http.CallOption) (rsp *GetMyCardsReply, err error)
  324. GetTemplates(ctx context.Context, req *GetTemplatesRequest, opts ...http.CallOption) (rsp *GetTemplatesReply, err error)
  325. LoginAccount(ctx context.Context, req *LoginAccountRequest, opts ...http.CallOption) (rsp *LoginAccountReply, err error)
  326. OCRCard(ctx context.Context, req *OCRCardRequest, opts ...http.CallOption) (rsp *OCRCardReply, err error)
  327. OssUpload(ctx context.Context, req *OssUploadRequest, opts ...http.CallOption) (rsp *OssUploadReplay, err error)
  328. SaveCard(ctx context.Context, req *SaveCardInfoRequest, opts ...http.CallOption) (rsp *SaveCardReply, err error)
  329. SearchCard(ctx context.Context, req *SearchCardRequest, opts ...http.CallOption) (rsp *SearchCardReply, err error)
  330. WxRegisterLogin(ctx context.Context, req *WxRegisterLoginRequest, opts ...http.CallOption) (rsp *WxRegisterLoginReply, err error)
  331. }
  332. type CardHTTPClientImpl struct {
  333. cc *http.Client
  334. }
  335. func NewCardHTTPClient(client *http.Client) CardHTTPClient {
  336. return &CardHTTPClientImpl{client}
  337. }
  338. func (c *CardHTTPClientImpl) AddCardByShareToken(ctx context.Context, in *AddCardByShareTokenRequest, opts ...http.CallOption) (*AddCardByShareTokenReply, error) {
  339. var out AddCardByShareTokenReply
  340. pattern := "/v1/card/user/bind"
  341. path := binding.EncodeURL(pattern, in, false)
  342. opts = append(opts, http.Operation(OperationCardAddCardByShareToken))
  343. opts = append(opts, http.PathTemplate(pattern))
  344. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  345. if err != nil {
  346. return nil, err
  347. }
  348. return &out, err
  349. }
  350. func (c *CardHTTPClientImpl) CreateAccountUser(ctx context.Context, in *CreateAccountUserRequest, opts ...http.CallOption) (*CreateAccountUserReply, error) {
  351. var out CreateAccountUserReply
  352. pattern := "/v1/account/create"
  353. path := binding.EncodeURL(pattern, in, false)
  354. opts = append(opts, http.Operation(OperationCardCreateAccountUser))
  355. opts = append(opts, http.PathTemplate(pattern))
  356. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  357. if err != nil {
  358. return nil, err
  359. }
  360. return &out, err
  361. }
  362. func (c *CardHTTPClientImpl) CreateCard(ctx context.Context, in *CreateCardRequest, opts ...http.CallOption) (*CreateCardReply, error) {
  363. var out CreateCardReply
  364. pattern := "/v1/card/create"
  365. path := binding.EncodeURL(pattern, in, false)
  366. opts = append(opts, http.Operation(OperationCardCreateCard))
  367. opts = append(opts, http.PathTemplate(pattern))
  368. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  369. if err != nil {
  370. return nil, err
  371. }
  372. return &out, err
  373. }
  374. func (c *CardHTTPClientImpl) CreateShareToken(ctx context.Context, in *CreateShareTokenRequest, opts ...http.CallOption) (*CreateShareTokenReply, error) {
  375. var out CreateShareTokenReply
  376. pattern := "/v1/card/token/create"
  377. path := binding.EncodeURL(pattern, in, false)
  378. opts = append(opts, http.Operation(OperationCardCreateShareToken))
  379. opts = append(opts, http.PathTemplate(pattern))
  380. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  381. if err != nil {
  382. return nil, err
  383. }
  384. return &out, err
  385. }
  386. func (c *CardHTTPClientImpl) DelCard(ctx context.Context, in *DelCardInfoRequest, opts ...http.CallOption) (*DelCardReply, error) {
  387. var out DelCardReply
  388. pattern := "/v1/card/del"
  389. path := binding.EncodeURL(pattern, in, false)
  390. opts = append(opts, http.Operation(OperationCardDelCard))
  391. opts = append(opts, http.PathTemplate(pattern))
  392. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  393. if err != nil {
  394. return nil, err
  395. }
  396. return &out, err
  397. }
  398. func (c *CardHTTPClientImpl) GetCardInfo(ctx context.Context, in *GetCardInfoRequest, opts ...http.CallOption) (*GetCardInfoReply, error) {
  399. var out GetCardInfoReply
  400. pattern := "/v1/card/info"
  401. path := binding.EncodeURL(pattern, in, false)
  402. opts = append(opts, http.Operation(OperationCardGetCardInfo))
  403. opts = append(opts, http.PathTemplate(pattern))
  404. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  405. if err != nil {
  406. return nil, err
  407. }
  408. return &out, err
  409. }
  410. func (c *CardHTTPClientImpl) GetMyCards(ctx context.Context, in *GetMyCardsRequest, opts ...http.CallOption) (*GetMyCardsReply, error) {
  411. var out GetMyCardsReply
  412. pattern := "/v1/cards"
  413. path := binding.EncodeURL(pattern, in, false)
  414. opts = append(opts, http.Operation(OperationCardGetMyCards))
  415. opts = append(opts, http.PathTemplate(pattern))
  416. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  417. if err != nil {
  418. return nil, err
  419. }
  420. return &out, err
  421. }
  422. func (c *CardHTTPClientImpl) GetTemplates(ctx context.Context, in *GetTemplatesRequest, opts ...http.CallOption) (*GetTemplatesReply, error) {
  423. var out GetTemplatesReply
  424. pattern := "/v1/card/templates"
  425. path := binding.EncodeURL(pattern, in, false)
  426. opts = append(opts, http.Operation(OperationCardGetTemplates))
  427. opts = append(opts, http.PathTemplate(pattern))
  428. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  429. if err != nil {
  430. return nil, err
  431. }
  432. return &out, err
  433. }
  434. func (c *CardHTTPClientImpl) LoginAccount(ctx context.Context, in *LoginAccountRequest, opts ...http.CallOption) (*LoginAccountReply, error) {
  435. var out LoginAccountReply
  436. pattern := "/v1/account/login"
  437. path := binding.EncodeURL(pattern, in, false)
  438. opts = append(opts, http.Operation(OperationCardLoginAccount))
  439. opts = append(opts, http.PathTemplate(pattern))
  440. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  441. if err != nil {
  442. return nil, err
  443. }
  444. return &out, err
  445. }
  446. func (c *CardHTTPClientImpl) OCRCard(ctx context.Context, in *OCRCardRequest, opts ...http.CallOption) (*OCRCardReply, error) {
  447. var out OCRCardReply
  448. pattern := "/v1/card/ocr"
  449. path := binding.EncodeURL(pattern, in, false)
  450. opts = append(opts, http.Operation(OperationCardOCRCard))
  451. opts = append(opts, http.PathTemplate(pattern))
  452. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  453. if err != nil {
  454. return nil, err
  455. }
  456. return &out, err
  457. }
  458. func (c *CardHTTPClientImpl) OssUpload(ctx context.Context, in *OssUploadRequest, opts ...http.CallOption) (*OssUploadReplay, error) {
  459. var out OssUploadReplay
  460. pattern := "/v1/card/ossupload"
  461. path := binding.EncodeURL(pattern, in, false)
  462. opts = append(opts, http.Operation(OperationCardOssUpload))
  463. opts = append(opts, http.PathTemplate(pattern))
  464. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  465. if err != nil {
  466. return nil, err
  467. }
  468. return &out, err
  469. }
  470. func (c *CardHTTPClientImpl) SaveCard(ctx context.Context, in *SaveCardInfoRequest, opts ...http.CallOption) (*SaveCardReply, error) {
  471. var out SaveCardReply
  472. pattern := "/v1/card/save"
  473. path := binding.EncodeURL(pattern, in, false)
  474. opts = append(opts, http.Operation(OperationCardSaveCard))
  475. opts = append(opts, http.PathTemplate(pattern))
  476. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  477. if err != nil {
  478. return nil, err
  479. }
  480. return &out, err
  481. }
  482. func (c *CardHTTPClientImpl) SearchCard(ctx context.Context, in *SearchCardRequest, opts ...http.CallOption) (*SearchCardReply, error) {
  483. var out SearchCardReply
  484. pattern := "/v1/card/search"
  485. path := binding.EncodeURL(pattern, in, false)
  486. opts = append(opts, http.Operation(OperationCardSearchCard))
  487. opts = append(opts, http.PathTemplate(pattern))
  488. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  489. if err != nil {
  490. return nil, err
  491. }
  492. return &out, err
  493. }
  494. func (c *CardHTTPClientImpl) WxRegisterLogin(ctx context.Context, in *WxRegisterLoginRequest, opts ...http.CallOption) (*WxRegisterLoginReply, error) {
  495. var out WxRegisterLoginReply
  496. pattern := "/v1/account/wx/login"
  497. path := binding.EncodeURL(pattern, in, false)
  498. opts = append(opts, http.Operation(OperationCardWxRegisterLogin))
  499. opts = append(opts, http.PathTemplate(pattern))
  500. err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
  501. if err != nil {
  502. return nil, err
  503. }
  504. return &out, err
  505. }