Sfoglia il codice sorgente

Merge branch 'develop' of gitadmin/tuoheng_air_monitor into release

pull/101/head
wanjing 10 mesi fa
parent
commit
6430a8eb21
6 ha cambiato i file con 21 aggiunte e 12 eliminazioni
  1. +1
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java
  2. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/QueryRecordIService.java
  3. +8
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordIService.java
  4. +0
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordIService.java
  5. +12
    -0
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/DspCallbackServiceTest.java
  6. +0
    -4
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionServiceTest.java

+ 1
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java Vedi File

@@ -62,8 +62,7 @@ public class UpdateFlightStatusService {
}
log.info("调用DSP开始录制, 返回:result={}", JacksonUtil.obj2StringPretty(result));

JSONObject jsonObject = (JSONObject) result.getData();
DspCallbackRecordVo vo = JSON.toJavaObject(jsonObject.getJSONObject("data"), DspCallbackRecordVo.class);
DspCallbackRecordVo vo = (DspCallbackRecordVo) result.getData();

log.info("修改inspection status 开始");
inspectionUpdate.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode());

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/QueryRecordIService.java Vedi File

@@ -43,7 +43,6 @@ public class QueryRecordIService {
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
throw new ServiceException("调用dsp平台,查询录屏信息接口失败");
}

return jsonResult;
}
}

+ 8
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordIService.java Vedi File

@@ -1,11 +1,13 @@
package com.tuoheng.admin.service.third.dsp;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.domain.Inspection;
import com.tuoheng.admin.entity.request.inspection.MissionStatusRequest;
import com.tuoheng.admin.entity.vo.DspCallbackRecordVo;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.JsonResult;
@@ -14,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
@@ -52,9 +55,12 @@ public class StartRecordIService {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity httpEntity = new HttpEntity(jsonObject, headers);
ResponseEntity<JsonResult> response;
ResponseEntity<JsonResult<DspCallbackRecordVo>> response;
ParameterizedTypeReference<JsonResult<DspCallbackRecordVo>> parameterizedTypeReference =
new ParameterizedTypeReference<JsonResult<DspCallbackRecordVo>>() {
};
try {
response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, JsonResult.class);
response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, parameterizedTypeReference);
} catch (Exception e) {
log.info("调用dsp平台,开始录制接口异常,e:{}", e);
throw new ServiceException("调用dsp平台,开始录制接口异常");
@@ -70,7 +76,6 @@ public class StartRecordIService {
throw new ServiceException("调用dsp平台,开始录制接口,失败");
}
return jsonResult;

}

}

+ 0
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordIService.java Vedi File

@@ -56,9 +56,7 @@ public class StopRecordIService {
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
return JsonResult.error("调用dsp平台,停止录制接失败,请重试!");
}

return jsonResult;

}

}

+ 12
- 0
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/DspCallbackServiceTest.java Vedi File

@@ -2,9 +2,11 @@ package com.tuoheng.admin.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tuoheng.admin.entity.request.inspection.MissionStatusRequest;
import com.tuoheng.admin.entity.request.third.DspCallbackRequest;
import com.tuoheng.admin.service.third.dsp.IDspCallbackService;
import com.tuoheng.admin.service.third.dsp.SendPost;
import com.tuoheng.admin.service.third.dsp.StartRecordIService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -20,6 +22,9 @@ public class DspCallbackServiceTest {
@Autowired
private IDspCallbackService dspCallbackService;

@Autowired
private StartRecordIService startRecordIService;

@Test
public void testGetOneById() {
String requestId = "dc96139337854ae78da7f20e144b3a9f";
@@ -59,4 +64,11 @@ public class DspCallbackServiceTest {
System.out.println(stringStr);
}

@Test
public void testStartRecord() {
MissionStatusRequest request = new MissionStatusRequest();
request.setRequestId("2199124367dd36d6c1d99d7b15d38c3b");
request.setPullUrl("https://live.play.t-aaron.com/live/test21.flv");
startRecordIService.startRecord(request);
}
}

+ 0
- 4
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionServiceTest.java Vedi File

@@ -67,12 +67,8 @@ public class InspectionServiceTest {
request.setAirportId(1);
request.setAirportName("禄口-2022112501");
request.setInspectionLine(1);
request.setInspectionLineName("路线1");


JSONObject json = (JSONObject) JSONObject.toJSON(request);
log.info("-----> 新增任务请求参数:json={}", json);

JsonResult result = iInspectionService.insert(request);
System.out.println(">>>>>>>>>>>>>" + result);
}

Loading…
Annulla
Salva