passport_reg.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package http
  2. import (
  3. "go-common/app/service/main/passport-game/model"
  4. bm "go-common/library/net/http/blademaster"
  5. "go-common/library/net/metadata"
  6. )
  7. func regV3(c *bm.Context) {
  8. var argRegV3 = new(model.ArgRegV3)
  9. err := c.Bind(argRegV3)
  10. if err != nil {
  11. return
  12. }
  13. var cookie = c.Request.Header.Get("Cookie")
  14. c.JSON(srv.RegV3(c, model.TdoRegV3{Arg: *argRegV3, IP: metadata.String(c, metadata.RemoteIP), Cookie: cookie}))
  15. }
  16. func regV2(c *bm.Context) {
  17. var argRegV2 = new(model.ArgRegV2)
  18. err := c.Bind(argRegV2)
  19. if err != nil {
  20. return
  21. }
  22. var cookie = c.Request.Header.Get("Cookie")
  23. c.JSON(srv.RegV2(c, model.TdoRegV2{Arg: *argRegV2, IP: metadata.String(c, metadata.RemoteIP), Cookie: cookie}))
  24. }
  25. func reg(c *bm.Context) {
  26. var argReg = new(model.ArgReg)
  27. err := c.Bind(argReg)
  28. if err != nil {
  29. return
  30. }
  31. var cookie = c.Request.Header.Get("Cookie")
  32. c.JSON(srv.Reg(c, model.TdoReg{Arg: *argReg, IP: metadata.String(c, metadata.RemoteIP), Cookie: cookie}))
  33. }
  34. func byTel(c *bm.Context) {
  35. var argByTel = new(model.ArgByTel)
  36. err := c.Bind(argByTel)
  37. if err != nil {
  38. return
  39. }
  40. var cookie = c.Request.Header.Get("Cookie")
  41. c.JSON(srv.ByTel(c, model.TdoByTel{Arg: *argByTel, IP: metadata.String(c, metadata.RemoteIP), Cookie: cookie}))
  42. }
  43. func captcha(c *bm.Context) {
  44. c.JSON(srv.Captcha(c, metadata.String(c, metadata.RemoteIP)))
  45. }
  46. func sendSms(c *bm.Context) {
  47. var sendSmsp = new(model.SendSms)
  48. berr := c.Bind(sendSmsp)
  49. if berr != nil {
  50. return
  51. }
  52. var cookie = c.Request.Header.Get("Cookie")
  53. err := srv.SendSms(c, model.TdoSendSms{Arg: *sendSmsp, IP: metadata.String(c, metadata.RemoteIP), Cookie: cookie})
  54. c.JSON(nil, err)
  55. }