Selaa lähdekoodia

提交调用dsp开始录屏,停止录屏,查询录屏信息代码日志

pull/80/head
wanjing 10 kuukautta sitten
vanhempi
commit
6015032209
3 muutettua tiedostoa jossa 18 lisäystä ja 17 poistoa
  1. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/QueryRecordIService.java
  2. +10
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordIService.java
  3. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordIService.java

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/QueryRecordIService.java Näytä tiedosto

@@ -17,6 +17,7 @@ import java.util.Objects;
@Slf4j
@Service
public class QueryRecordIService {
@Autowired
@Qualifier("restTemplate")
private RestTemplate restTemplate;
@@ -31,16 +32,16 @@ public class QueryRecordIService {
String url = UriComponentsBuilder.fromHttpUrl(dspDomainUrl+SystemConstant.DSP_QUERY_RECORD)
.queryParam("requestId", msgId)
.toUriString();
log.info("调用dsp平台,查询录屏信息接口,url:{}", url);
JsonResult jsonResult;
try {
jsonResult = restTemplate.getForObject(url, JsonResult.class);
} catch (Exception e) {
log.info("调用查询录屏信息接口异常, url:{}", url);
throw new ServiceException("调用查询录屏信息接口异常");
log.info("调用dsp平台,查询录屏信息接口异常");
throw new ServiceException("调用dsp平台,查询录屏信息接口异常");
}
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
return JsonResult.error("调用查询录屏信息接口失败,请重试!");
throw new ServiceException("调用dsp平台,查询录屏信息接口失败");
}

return jsonResult;

+ 10
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StartRecordIService.java Näytä tiedosto

@@ -46,6 +46,9 @@ public class StartRecordIService {
jsonObject.put("requestId", request.getRequestId());
jsonObject.put("pullUrl", request.getPullUrl());

log.info("调用dsp平台,开始录制接口,url:{}", url);
log.info("调用dsp平台,开始录制接口,jsonObject:{}", jsonObject);

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity httpEntity = new HttpEntity(jsonObject, headers);
@@ -53,21 +56,18 @@ public class StartRecordIService {
try {
response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, JsonResult.class);
} catch (Exception e) {
log.info("调用dsp平台,调用开始录制接口异常,url:{}", url);
log.info("调用dsp平台,调用开始录制接口异常,jsonObject:{}", jsonObject);
return null;
log.info("调用dsp平台,开始录制接口异常,e:{}", e);
throw new ServiceException("调用dsp平台,开始录制接口异常");
}
if (ObjectUtil.isEmpty(response)) {
log.info("调用dsp平台,调用开始录制接口返回为空,url:{}", url);
log.info("调用dsp平台,调用开始录制接口返回为空,jsonObject:{}", jsonObject);
return null;
log.info("调用dsp平台,开始录制接口返回为空");
throw new ServiceException("调用dsp平台,开始录制接口返回为空");
}
JsonResult jsonResult = response.getBody();
if (0 != jsonResult.getCode()) {
log.info("调用dsp平台,调用开始录制接口,失败,url:{}", url);
log.info("调用dsp平台,调用开始录制接口,失败,jsonObject:{}", jsonObject);
log.info("调用dsp平台,调用开始录制接口,失败", jsonResult.getMsg());
return null;
log.info("调用dsp平台,开始录制接口,失败,jsonResult:{}", jsonResult);
log.info("调用dsp平台,开始录制接口,失败", jsonResult.getMsg());
throw new ServiceException("调用dsp平台,开始录制接口,失败");
}
return jsonResult;


+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopRecordIService.java Näytä tiedosto

@@ -45,16 +45,16 @@ public class StopRecordIService {
String url = UriComponentsBuilder.fromHttpUrl(dspDomainUrl+SystemConstant.DSP_STOP_RECORD)
.queryParam("requestId", msgId)
.toUriString();
log.info("调用dsp平台,停止录制接口,url:{}", url);
JsonResult jsonResult;
try {
jsonResult = restTemplate.getForObject(url, JsonResult.class);
} catch (Exception e) {
log.info("调用停止录制接口异常, url:{}", url);
log.info("调用dsp平台,停止录制接异常, e:{}", e);
throw new ServiceException("调用停止录制接口异常");
}
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
return JsonResult.error("调用停止录制接失败,请重试!");
return JsonResult.error("调用dsp平台,停止录制接失败,请重试!");
}

return jsonResult;

Loading…
Peruuta
Tallenna