1 | <?php |
||
11 | class SendCloudAgent extends Agent |
||
12 | { |
||
13 | public function sendSms($to, $content, $tempId, array $data) |
||
17 | |||
18 | public function sendTemplateSms($to, $tempId, array $data) |
||
28 | |||
29 | public function voiceVerify($to, $code, $tempId, array $data) |
||
37 | |||
38 | protected function request($sendUrl, array $params) |
||
44 | |||
45 | protected function createParams(array $params) |
||
54 | |||
55 | protected function genSign($params) |
||
67 | |||
68 | protected function setResult($result) |
||
69 | { |
||
70 | if ($result) { |
||
71 | $response = json_decode($result['response'], true); |
||
72 | if (isset($response['result'])) { |
||
73 | $this->result(Agent::SUCCESS, (bool) $response['result']); |
||
74 | $this->result(Agent::INFO, $response['message']); |
||
75 | $this->result(Agent::CODE, $response['statusCode']); |
||
76 | } |
||
77 | } else { |
||
78 | $this->result(Agent::INFO, '请求失败'); |
||
79 | } |
||
80 | } |
||
81 | |||
82 | protected function getTempDataString(array $data) |
||
86 | |||
87 | public function sendContentSms($to, $content) |
||
90 | } |
||
91 |