UserAuthResultRequest.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. class UserAuthResultRequest extends SdkRequest {
  3. const REQUEST_URL = "/v2/personalauth/result";
  4. private $contact; // 认证用户联系方式
  5. private $contactType; // 认证用户联系方式类型
  6. private $authId; // 认证Id
  7. private $user;
  8. public function getUrl() {
  9. return self::REQUEST_URL;
  10. }
  11. public function getHttpParamers() {
  12. $paramSwitcher = ParamSwitcher::instanceParam();
  13. if($this->user == null){
  14. $paramSwitcher->addParam('contact', $this->contact);
  15. $paramSwitcher->addParam('contactType', $this->contactType);
  16. }else{
  17. $paramSwitcher->addParam('contact', $this->user->getContact());
  18. $paramSwitcher->addParam('contactType', $this->user->getContactType());
  19. }
  20. $paramSwitcher->addParam('authId', $this->authId);
  21. $httpParameters = HttpParameter::httpGetParamer();
  22. $httpParameters->setParams($paramSwitcher->getParams());
  23. return $httpParameters;
  24. }
  25. /**
  26. * @return mixed
  27. */
  28. public function getContact()
  29. {
  30. return $this->contact;
  31. }
  32. /**
  33. * @param mixed $contact
  34. */
  35. public function setContact($contact)
  36. {
  37. $this->contact = $contact;
  38. }
  39. /**
  40. * @return mixed
  41. */
  42. public function getContactType()
  43. {
  44. return $this->contactType;
  45. }
  46. /**
  47. * @param mixed $contactType
  48. */
  49. public function setContactType($contactType)
  50. {
  51. $this->contactType = $contactType;
  52. }
  53. /**
  54. * @return mixed
  55. */
  56. public function getAuthId()
  57. {
  58. return $this->authId;
  59. }
  60. /**
  61. * @param mixed $authId
  62. */
  63. public function setAuthId($authId)
  64. {
  65. $this->authId = $authId;
  66. }
  67. /**
  68. * @return mixed
  69. */
  70. public function getUser()
  71. {
  72. return $this->user;
  73. }
  74. /**
  75. * @param mixed $user
  76. */
  77. public function setUser($user)
  78. {
  79. $this->user = $user;
  80. }
  81. }