realname.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package gorpc
  2. import (
  3. "go-common/app/service/main/member/model"
  4. "go-common/library/net/rpc/context"
  5. )
  6. // RealnameStatus is
  7. func (r *RPC) RealnameStatus(c context.Context, arg *model.ArgMemberMid, res *model.RealnameStatus) (err error) {
  8. var v model.RealnameStatus
  9. if v, err = r.s.RealnameStatus(c, arg.Mid); err == nil && res != nil {
  10. *res = v
  11. }
  12. return
  13. }
  14. // RealnameApplyStatus is
  15. func (r *RPC) RealnameApplyStatus(c context.Context, arg *model.ArgMemberMid, res *model.RealnameApplyStatusInfo) (err error) {
  16. var v *model.RealnameApplyStatusInfo
  17. if v, err = r.s.RealnameApplyStatus(c, arg.Mid); err == nil && v != nil {
  18. *res = *v
  19. }
  20. return
  21. }
  22. // RealnameTelCapture is
  23. func (r *RPC) RealnameTelCapture(c context.Context, arg *model.ArgMemberMid, res *struct{}) (err error) {
  24. _, err = r.s.RealnameTelCapture(c, arg.Mid)
  25. return
  26. }
  27. // RealnameApply is
  28. func (r *RPC) RealnameApply(c context.Context, arg *model.ArgRealnameApply, res *struct{}) (err error) {
  29. err = r.s.RealnameApply(c, arg.MID, arg.CaptureCode, arg.Realname, arg.CardType, arg.CardCode, arg.Country, arg.HandIMGToken, arg.FrontIMGToken, arg.BackIMGToken)
  30. return
  31. }
  32. // RealnameAlipayApply commit a alipay realname apply
  33. func (r *RPC) RealnameAlipayApply(c context.Context, arg *model.ArgRealnameAlipayApply, res *struct{}) (err error) {
  34. err = r.s.RealnameAlipayApply(c, arg.MID, arg.CaptureCode, arg.Realname, arg.CardCode, arg.IMGToken, arg.Bizno)
  35. return
  36. }
  37. // RealnameAlipayConfirm confirm a alipay realname apply
  38. func (r *RPC) RealnameAlipayConfirm(c context.Context, arg *model.ArgRealnameAlipayConfirm, res *struct{}) (err error) {
  39. err = r.s.RealnameAlipayConfirm(c, arg.MID, arg.Pass, arg.Reason)
  40. return
  41. }
  42. // RealnameAlipayBizno get alipay realname certify bizno by mid
  43. func (r *RPC) RealnameAlipayBizno(c context.Context, arg *model.ArgMemberMid, res *model.RealnameAlipayInfo) (err error) {
  44. var bizno string
  45. if bizno, err = r.s.RealnameAlipayBizno(c, arg.Mid); err == nil {
  46. (*res).Bizno = bizno
  47. }
  48. return
  49. }
  50. // RealnameDetail detail about realname by mid
  51. func (r *RPC) RealnameDetail(ctx context.Context, arg *model.ArgMemberMid, res *model.RealnameDetail) error {
  52. detail, err := r.s.RealnameDetail(ctx, arg.Mid)
  53. if err != nil {
  54. return err
  55. }
  56. *res = *detail
  57. return nil
  58. }