Authored by mali

直播的回调请求

package com.yoho.ufo.service.impl;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.qiniu.common.QiniuException;
import com.qiniu.common.Zone;
import com.qiniu.http.Response;
import com.qiniu.processing.OperationManager;
import com.qiniu.processing.OperationStatus;
import com.qiniu.storage.BucketManager;
... ... @@ -12,12 +18,6 @@ import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlSafeBase64;
import com.yoho.ufo.exception.PlatformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* Created by li.ma on 2018/12/11.
... ... @@ -94,8 +94,6 @@ public class QNliveUtil {
logger.info("Resp is {} from bucketManager.fetch", fetch.key);
} catch (QiniuException e) {
//捕获异常信息
Response r = e.response;
logger.error("bucketManager.fetch find wrong fileKey is {}, cameraIdentify is {}, startTime is {}, endTime is {} error is {}", fileKey, cameraIdentify, startTime, endTime, e.response);
throw new PlatformException(400);
... ... @@ -152,6 +150,8 @@ public class QNliveUtil {
} else if (1 == operationStatus.code || 2 == operationStatus.code) {
return "operating";
}
logger.info("result queryPrefopStatus is {}, persistId is {}", operationStatus.code, persistId);
} catch (QiniuException e) {
logger.error("method queryPrefopStatus find wrong persistId is {}, error is {}", persistId, e.response);
} catch (Exception e) {
... ...
... ... @@ -39,7 +39,7 @@ public class UfoLiveService {
String persistId = qNliveUtil.transfer(fileName, fileName);
if (StringUtils.isEmpty(persistId)) {
if (StringUtils.isEmpty(persistId) || "fail".equals(qNliveUtil.queryPrefopStatus(persistId))) {
throw new PlatformException(400);
}
... ... @@ -55,11 +55,12 @@ public class UfoLiveService {
record.setCreateTime(DateUtil.getCurrentTimeSeconds());
record.setEndTime(req.getEndTime());
record.setOrderCode(req.getOrderCode());
record.setSellerOrderCode(0L);
record.setPersistId(persistId);
record.setPid(new UserHelper().getUserId());
record.setSkup(req.getSkup());
record.setStartTime(req.getStartTime());
record.setStatus(1);
record.setStatus(0);
record.setVedioFileUrl(fileName + ".mp4");
qiniuLiveRecordMapper.insert(record);
}
... ...
... ... @@ -35,6 +35,7 @@ datasources:
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
- com.yoho.order.dal.SellerWalletMapper
- com.yoho.order.dal.QiniuLiveRecordMapper
ufo_resource:
servers:
- 192.168.102.219:3306
... ...
... ... @@ -35,6 +35,8 @@ datasources:
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
- com.yoho.order.dal.SellerWalletMapper
- com.yoho.order.dal.QiniuLiveRecordMapper
ufo_resource:
servers:
- ${jdbc.mysql.ufo.master}
... ...
... ... @@ -711,7 +711,7 @@ function addRecordPage(skup, order_code, id) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "鉴定通过操作成功!"
msg : "上传云端操作成功!"
});
}else {
window.self.$.messager.alert("失败", data.message, "error");
... ...