talent_post_api.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package youngeetalentapi
  2. import (
  3. "github.com/gogf/gf/net/ghttp"
  4. "youngmini_server/app/service/youngee_talent_service"
  5. )
  6. var TalentPostApi = talentPostApi{}
  7. type talentPostApi struct {
  8. }
  9. // Login 达人端微信授权登录
  10. func (*talentPostApi) Login(r *ghttp.Request) {
  11. // 向微信服务端校验登录凭证
  12. res := youngee_talent_service.WxLogin(r)
  13. err := r.Response.WriteJson(res)
  14. if err != nil {
  15. panic("write response error")
  16. }
  17. }
  18. // 获取手机号码接口测试
  19. //func (*talentPostApi) GetPhoneNum(r *ghttp.Request) {
  20. // // 向微信服务端校验登录凭证
  21. // res := youngee_talent_service.GetPhoneNum1(r)
  22. // err := r.Response.WriteJson(res)
  23. // if err != nil {
  24. // panic("write response error")
  25. // }
  26. //}
  27. // Login 达人端手机号登录
  28. func (*talentPostApi) SmsLogin(r *ghttp.Request) {
  29. // 向微信服务端校验登录凭证
  30. res := youngee_talent_service.LoginFromSms(r)
  31. err := r.Response.WriteJson(res)
  32. if err != nil {
  33. panic("write response error")
  34. }
  35. }
  36. // GetQrcode 获取微信分享二维码
  37. func (*talentPostApi) GetQrcode(r *ghttp.Request) {
  38. res := youngee_talent_service.RequestShareInfo(r)
  39. err := r.Response.WriteJson(res)
  40. if err != nil {
  41. panic("write response error")
  42. }
  43. }
  44. // 达人短信登录,发送验证码
  45. func (*talentPostApi) SendSmsCode(r *ghttp.Request) {
  46. // 向微信服务端校验登录凭证
  47. res := youngee_talent_service.SendSmsCode(r)
  48. err := r.Response.WriteJson(res)
  49. if err != nil {
  50. r.Response.WriteJson("短信发送失败")
  51. }
  52. }