Browse Source

1、添加回调接口日志;2、新增dsp服务服务实例Id;

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
4b03d5fbe2
7 changed files with 35 additions and 6 deletions
  1. +5
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineIdentifService.java
  2. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java
  3. +8
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspServiceImpl.java
  4. +3
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml
  5. +3
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml
  6. +3
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-prod.yml
  7. +3
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-test.yml

+ 5
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineIdentifService.java View File

@@ -68,6 +68,9 @@ public class OnlineIdentifService {
@Value("${tuoheng.dsp-domain-url:}")
private String dspDomainUrl;

@Value("${tuoheng.dsp-service-inst-id:}")
private String dspServiceInstId;

@Value("${tuoheng.dsp-callback-url:}")
private String dspCallbackUrl;

@@ -102,7 +105,8 @@ public class OnlineIdentifService {
log.info("开始调用DSP服务");

// 调用DSP服务
String url = String.format(Locale.ENGLISH, "%s/api/web/serviceInst/827938791cf98ec2dfceea59726e5085/application", dspDomainUrl, "");
String url = String.format(Locale.ENGLISH, "%s/api/web/serviceInst/%s/application", dspDomainUrl, dspServiceInstId);
log.info("调用DSP服务, url:{}", url);
try {
Map<String, Object> paramMap = new HashMap<>();


+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java View File

@@ -88,22 +88,29 @@ public class UploadFlightUrlService {

Inspection inspection = (Inspection) result.getData();

log.info("上传离线视频业务接口, inspectionid:{}", inspection.getId());
log.info("上传离线视频业务接口, isLive:{}, analyseStatus:{}", inspection.getIsLive(), inspection.getAnalyseStatus());

//修改用户直播完也可以进行分析
if (1 == inspection.getIsLive() && inspection.getAnalyseStatus() != 1) {
log.info("上传离线视频业务接口, 修改用户直播完进行分析");
inspection.setAnalyseStatus(1);
inspectionMapper.updateById(inspection);
}

if (TaskStatusEnum.COMPLETE.getCode() != inspection.getStatus()) {
log.info("上传离线视频业务接口, 只有飞行完成状态可以操作!");
throw new ServiceException(ServiceExceptionEnum.TASK_NOT_OPERATION);
}
// 如果任务处于待分析中,响应前端,任务待分析中,不能上传视频
if (AiAnalyseStatusEnum.WAITING.getCode() == inspection.getAnalyseStatus()
|| AiAnalyseStatusEnum.RUNNING.getCode() == inspection.getAnalyseStatus()) {
log.info("上传离线视频业务接口, 视频分析中,请稍后再试!");
throw new ServiceException(ServiceExceptionEnum.VIDEO_ANALYSIS_IN_PROGRESS);
}
if (AiAnalyseStatusEnum.SUCCESS.getCode() == inspection.getAnalyseStatus()
|| AiAnalyseStatusEnum.SUCCESS_TIMEOUT.getCode() == inspection.getAnalyseStatus()) {
log.info("上传离线视频业务接口, 视频分析已完成!");
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "视频分析已完成");
}

@@ -115,6 +122,7 @@ public class UploadFlightUrlService {
.eq(InspectionFile::getInspectionId, inspection.getId())
.eq(InspectionFile::getMark, 1));
if (num > 0) {
log.info("上传离线视频业务接口, 每次上传或重试,清除上次的数据");
inspectionFileMapper.deleteByInspectionId(inspection.getId());
}

@@ -220,6 +228,8 @@ public class UploadFlightUrlService {
* 调用DSP接口
*/
private void callDsp(String inspectionId, String videoUrl) {
log.info("调用DSP接口, inspectionId:{}, videoUrl:{}", inspectionId, videoUrl);

JSONObject requestDsp = new JSONObject();
JSONArray configList = new JSONArray();
JSONObject instConfigMode = new JSONObject();

+ 8
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspServiceImpl.java View File

@@ -12,6 +12,7 @@ import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Locale;
import java.util.Map;

@Slf4j
@@ -24,10 +25,16 @@ public class DspServiceImpl implements IDspService {
@Value("${tuoheng.dsp-domain-url:}")
private String dspDomainUrl;

@Value("${tuoheng.dsp-service-inst-id:}")
private String dspServiceInstId;

@Override
public JSONObject serviceInstApplication(JSONObject jsonObject) {
String url = dspDomainUrl + "api/web/serviceInst/827938791cf98ec2dfceea59726e5085/application";
String url = String.format(Locale.ENGLISH, "%s/api/web/serviceInst/%s/application", dspDomainUrl, dspServiceInstId);
log.info("调用DSP服务, url:{}", url);
log.info("调用DSP服务, jsonObject:{}", jsonObject);
String result = doPost(url, jsonObject, null);
log.info("调用DSP服务, result:{}", result);
return JSONObject.parseObject(result);
}


+ 3
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-dev.yml View File

@@ -136,7 +136,9 @@ tuoheng:
# 通道地址
live-channel-domain-url: https://streaming.t-aaron.com/
# DSP服务域名
dsp-domain-url: https://dsp.t-aaron.com/
dsp-domain-url: https://dsp.t-aaron.com
# DSP服务实例Id
dsp-service-inst-id: ece32f4da856be0f4fc704930a52b9e7
# DSP回调地址
dsp-callback-url: https://192.168.11.11:9177/dsp/callback/{requestId}
#飞手平台地址

+ 3
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml View File

@@ -142,7 +142,9 @@ tuoheng:
# 通道地址
live-channel-domain-url: https://streaming.t-aaron.com/
# DSP服务域名
dsp-domain-url: http://192.168.11.241:7011/
dsp-domain-url: http://192.168.11.241:7011
# DSP服务实例Id
dsp-service-inst-id: ece32f4da856be0f4fc704930a52b9e7
# DSP回调地址
dsp-callback-url: https://127.0.0.1:9117/dsp/callback/{requestId}
#飞手平台地址

+ 3
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-prod.yml View File

@@ -137,7 +137,9 @@ tuoheng:
# 通道地址
live-channel-domain-url: https://streaming.t-aaron.com/
# DSP服务域名
dsp-domain-url: https://dsp-portal.t-aaron.com/
dsp-domain-url: https://dsp-portal.t-aaron.com
# DSP服务实例Id
dsp-service-inst-id: b7a505c204d5605235829ac0bb9b616a
# DSP回调地址
dsp-callback-url: https://freeway.t-aaron.com/freeway/admin/dsp/callback/{requestId}
#飞手平台地址

+ 3
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-test.yml View File

@@ -137,7 +137,9 @@ tuoheng:
# 通道地址
live-channel-domain-url: https://streaming.t-aaron.com/
# DSP服务域名
dsp-domain-url: http://172.15.1.11:7011/
dsp-domain-url: http://172.15.1.11:7011
# DSP服务实例Id
dsp-service-inst-id: 0d8166ba7a3081aa1179c37fa57d7d6b
# DSP回调地址
dsp-callback-url: https://freeway-test.t-aaron.com/freeway/admin/dsp/callback/{requestId}
#飞手平台地址

Loading…
Cancel
Save