Skip to content

Add cloud SMS interface #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2019
Merged

Add cloud SMS interface #300

merged 3 commits into from
May 27, 2019

Conversation

ankadada
Copy link
Contributor

No description provided.

$params['pics'] = $this->imgToBase64($pics);
}
$body = json_encode($params);
$url =$this->baseURL."signature";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用单引号

@@ -119,7 +126,13 @@ public static function sendRequest($request)
curl_close($ch);
return $r;
}
$curl_info = curl_getinfo($ch);
$header_size = $curl_info["header_size"];
$body = substr($result, $header_size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块逻辑下面有了

$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($code != 200) {
throw new \Exception("\nhttpcode:".$code."\nmessage".$body);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php 这边没引入 Exception, 还是使用error 处理吧。

trade_name 商标名的全称或简称,
* pics: 本地的图片路径 string 类型,可选
*/
public function createSignature($signature, $source, $pics = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数参数 指定好类型

* audit_status: 审核状态 string 类型,可选,
取值范围为: "passed"(通过), "rejected"(未通过), "reviewing"(审核中)
* page:页码 int 类型,
* maxUsers:人数限制 ,可选,默认为 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数里没有提现

$params['signature_id'] = $signture_id;

$body = json_encode($params);
var_dump($body);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试代码删除


$body = json_encode($params);
var_dump($body);
$url =$this->baseURL."template";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单引号

取值范围为: notification (通知类短信), verification (验证码短信), marketing (营销类短信)
* description: 申请理由简述 string 类型,必填
* signature_id: 已经审核通过的签名 string 类型,必填
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回值最好加上注释

取值范围为: passed (通过), rejected (未通过), reviewing (审核中)
* page: 页码 int 类型,可选,默认为 1
* page_size: 分页大小 int 类型,可选,默认为 20
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回值的数据结构加上注释

if ($fp) {
$filesize = filesize($app_img_file);
if ($filesize > 5*1024*1024) {
new Error("pic size < 5M !");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回错误?

return array($ret->json(), null);
}

private function post($url, $body, $contentType = 'application/json')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@方兴看下这个是否要重构下, 不能每个class 都要封装一次 post/get 。。 等方法

@rwifeng rwifeng merged commit bc3265f into qiniu:master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants