作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

1

@@ -104,32 +104,28 @@ class Notify extends Api @@ -104,32 +104,28 @@ class Notify extends Api
104 } 104 }
105 105
106 /** 106 /**
107 - * 七牛云通知回调 107 + * 七牛云音频转码通知回调
108 * @ApiInternal 108 * @ApiInternal
109 */ 109 */
110 - public function notifyQiniu() 110 + public function notifyQiniuAvthumb()
111 { 111 {
112 if($this->request->isPost()) { 112 if($this->request->isPost()) {
113 $arr = $this->request->param(); 113 $arr = $this->request->param();
114 Db::name('ceshi')->insert(['content'=>json_encode($arr,JSON_UNESCAPED_UNICODE)]); 114 Db::name('ceshi')->insert(['content'=>json_encode($arr,JSON_UNESCAPED_UNICODE)]);
115 // 判断七牛云回调code是否为完成 115 // 判断七牛云回调code是否为完成
116 if(isset($arr['code']) && $arr['code'] == 0) { 116 if(isset($arr['code']) && $arr['code'] == 0) {
117 - $url = '/' . $arr['key']; 117 + $url = '/' . $arr['items'][0]['key'];
118 $info = Attachment::get(['url'=>$url]); 118 $info = Attachment::get(['url'=>$url]);
119 - Db::name('ceshi')->insert(['content'=>$info ? '有' : '无']);  
120 if(!$info){ 119 if(!$info){
121 - $admin_id = isset($arr['admin']) ? $arr['admin'] : 0;  
122 - $user_id = isset($arr['user']) ? $arr['user'] : 0;  
123 - $imageInfo = json_decode($arr['imageInfo'], true);  
124 $params = array( 120 $params = array(
125 - 'admin_id' => (int)$admin_id,  
126 - 'user_id' => (int)$user_id,  
127 - 'filesize' => $arr['filesize'],  
128 - 'imagewidth' => isset($imageInfo['width']) ? $imageInfo['width'] : 0,  
129 - 'imageheight' => isset($imageInfo['height']) ? $imageInfo['height'] : 0,  
130 - 'imagetype' => isset($imageInfo['format']) ? $imageInfo['format'] : '',  
131 - 'imageframes' => 1,  
132 - 'mimetype' => "image/" . (isset($imageInfo['format']) ? $imageInfo['format'] : ''), 121 + 'admin_id' => 0,
  122 + 'user_id' => 0,
  123 + 'filesize' => 0,
  124 + 'imagewidth' => 0,
  125 + 'imageheight' => 0,
  126 + 'imagetype' => 'pcm',
  127 + 'imageframes' => 0,
  128 + 'mimetype' => 'application/octet-stream',
133 'extparam' => '', 129 'extparam' => '',
134 'url' => $url, 130 'url' => $url,
135 'uploadtime' => time(), 131 'uploadtime' => time(),
@@ -141,6 +137,5 @@ class Notify extends Api @@ -141,6 +137,5 @@ class Notify extends Api
141 } 137 }
142 return json(['ret' => 'failed']); 138 return json(['ret' => 'failed']);
143 } 139 }
144 - return json(['ret' => 'failed']);  
145 } 140 }
146 } 141 }