|
@@ -11,7 +11,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
import com.ruoyi.common.utils.xunfei.HttpUtil;
|
|
|
-import com.ruoyi.framework.config.ServerConfig;
|
|
|
import com.ruoyi.system.domain.MeetingRecords;
|
|
|
import com.ruoyi.system.service.IMeetingRecordsService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -46,9 +45,6 @@ public class RealTimeController extends BaseController {
|
|
|
|
|
|
private static final Gson gson = new Gson();
|
|
|
|
|
|
- @Autowired
|
|
|
- private ServerConfig serverConfig;
|
|
|
-
|
|
|
@Autowired
|
|
|
private IMeetingRecordsService meetingRecordsService;
|
|
|
|
|
@@ -91,7 +87,7 @@ public class RealTimeController extends BaseController {
|
|
|
//回调地址
|
|
|
//订单完成时回调该地址通知完成支持get 请求,我们会在回调地址中拼接参数,长度限制512: http://{ip}/{port}?xxx&OrderId=xxxx&status=1
|
|
|
//参数:orderId为订单号、status为订单状态: 1(转写识别成功) 、-1(转写识别失败)
|
|
|
- //map.put("callbackUrl", "");
|
|
|
+ map.put("callbackUrl", "https://zxyyq.qs163.cn/prod-api/real/time/getResult/");
|
|
|
String paramString = HttpUtil.parseMapToPathParam(map);
|
|
|
System.out.println("upload paramString:" + paramString);
|
|
|
|
|
@@ -111,6 +107,7 @@ public class RealTimeController extends BaseController {
|
|
|
JsonParse jsonParse = gson.fromJson(response, JsonParse.class);
|
|
|
String orderId = jsonParse.content.orderId;
|
|
|
System.out.println("upload response:" + response);
|
|
|
+ meetingRecords.setAudioUrl(fileName);
|
|
|
//新增会议纪要
|
|
|
toAjax(meetingRecordsService.insertMeetingRecords(meetingRecords));
|
|
|
Long recordId = meetingRecords.getRecordId();
|
|
@@ -133,7 +130,7 @@ public class RealTimeController extends BaseController {
|
|
|
* @throws InterruptedException
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- @GetMapping(value = "/{orderId}/{status}")
|
|
|
+ @GetMapping(value = "/getResult/{orderId}/{status}")
|
|
|
private void getResult(@PathVariable("orderId") String orderId, @PathVariable("status") String status) throws SignatureException, InterruptedException, IOException {
|
|
|
if ("1".equals(status)) {
|
|
|
HashMap<String, Object> map = new HashMap<>(16);
|
|
@@ -149,7 +146,7 @@ public class RealTimeController extends BaseController {
|
|
|
while (true) {
|
|
|
String response = HttpUtil.iflyrecGet(url);
|
|
|
JsonParse jsonParse = gson.fromJson(response, JsonParse.class);
|
|
|
- if (jsonParse.content.orderInfo.status == 4) {
|
|
|
+ if (jsonParse.content.orderInfo.status == 4 || jsonParse.content.orderInfo.status == -1) {
|
|
|
System.out.println("订单完成:" + response);
|
|
|
//处理返回值
|
|
|
/**
|
|
@@ -196,6 +193,7 @@ public class RealTimeController extends BaseController {
|
|
|
meetingRecords.setRecordId(Long.parseLong(recordId.toString()));
|
|
|
meetingRecords.setRecordContent(resultText.toString());
|
|
|
meetingRecordsService.updateMeetingRecords(meetingRecords);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|