|
@@ -31,9 +31,25 @@ class Index extends BaseController{
|
|
|
die;
|
|
|
}
|
|
|
|
|
|
- $result = $this->createTaskOneInfo($audiourl,$overview);
|
|
|
-
|
|
|
- var_dump($result);
|
|
|
+ $taskone = $this->createTaskOneInfo($audiourl,$overview);
|
|
|
+// print_r($taskone);
|
|
|
+ //判断返回输出结果
|
|
|
+ if($taskone['body']['Code'] == '0' && $taskone['body']['Message'] == 'success'){
|
|
|
+ $result = array();
|
|
|
+ $result['TaskId'] = $taskone['body']['Data']['TaskId'];
|
|
|
+ $result['TaskKey'] = $taskone['body']['Data']['TaskKey'];
|
|
|
+ $result['TaskStatus'] = $taskone['body']['Data']['TaskStatus'];
|
|
|
+
|
|
|
+ $res = array('error' => 0, 'errortip' => '任务创建成功', 'result' => $result);
|
|
|
+ exit(json_encode($res,1));
|
|
|
+ }else{
|
|
|
+ $result = array();
|
|
|
+ $res = array('error' => 1, 'errortip' => '任务创建失败', 'result' => $result);
|
|
|
+ exit(json_encode($res,1));
|
|
|
+ }
|
|
|
+ print_r($result);
|
|
|
+ die;
|
|
|
+ ajax_return(array('error' => $this->error, 'errortip' => $this->errortip, 'result' => array()));
|
|
|
}
|
|
|
//解析任务
|
|
|
public function gettaskinfo(){
|
|
@@ -43,8 +59,27 @@ class Index extends BaseController{
|
|
|
die;
|
|
|
}
|
|
|
|
|
|
- $result = $this->getTaskOneInfo($taskid);
|
|
|
- var_dump($result);
|
|
|
+ $taskone = $this->getTaskOneInfo($taskid);
|
|
|
+// print_r($taskone);
|
|
|
+ //判断返回输出结果
|
|
|
+ if($taskone['body']['Code'] == '0' && $taskone['body']['Message'] == 'success'){
|
|
|
+ $result = array();
|
|
|
+ $result['TaskId'] = $taskone['body']['Data']['TaskId'];
|
|
|
+ $result['TaskKey'] = $taskone['body']['Data']['TaskKey'];
|
|
|
+ $result['TaskStatus'] = $taskone['body']['Data']['TaskStatus'];
|
|
|
+ $result['Result']['Transcription'] = $taskone['body']['Data']['Result']['Transcription']?$taskone['body']['Data']['Result']['Transcription']:'';
|
|
|
+ $result['Result']['CustomPrompt'] = $taskone['body']['Data']['Result']['CustomPrompt']?$taskone['body']['Data']['Result']['CustomPrompt']:'';
|
|
|
+
|
|
|
+ $res = array('error' => 0, 'errortip' => '任务解析成功', 'result' => $result);
|
|
|
+ exit(json_encode($res,1));
|
|
|
+ }else{
|
|
|
+ $result = array();
|
|
|
+ $res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => $result);
|
|
|
+ exit(json_encode($res,1));
|
|
|
+ }
|
|
|
+ print_r($result);
|
|
|
+ die;
|
|
|
+ ajax_return(array('error' => $this->error, 'errortip' => $this->errortip, 'result' => array()));
|
|
|
}
|
|
|
|
|
|
|