|
@@ -62,8 +62,6 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
|
|
|
queryWrapper.and(VIDEO_STABLE.NAME.like
|
|
|
(videoStableBo.getName()));
|
|
|
- queryWrapper.and(VIDEO_STABLE.STATUS.eq
|
|
|
- (videoStableBo.getStatus()));
|
|
|
queryWrapper.and(VIDEO_STABLE.IN_PATH.eq
|
|
|
(videoStableBo.getInPath()));
|
|
|
queryWrapper.and(VIDEO_STABLE.OUT_PATH.eq
|
|
@@ -128,6 +126,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
@Override
|
|
|
public boolean insert(VideoStableBo videoStableBo) {
|
|
|
VideoStable videoStable = MapstructUtils.convert(videoStableBo, VideoStable.class);
|
|
|
+ videoStable.setStatus(BizConstant.VideoStatus.NOT_START);
|
|
|
|
|
|
return this.save(videoStable);// 使用全局配置的雪花算法主键生成器生成ID值
|
|
|
}
|
|
@@ -161,22 +160,8 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResult start(VideoStableStartBo videoStableStartBo) {
|
|
|
- VideoStable videoStable = new VideoStable();
|
|
|
- videoStable.setInPath(videoStableStartBo.getIn_path());
|
|
|
- videoStable.setOutPath(videoStableStartBo.getOut_path());
|
|
|
- videoStable.setBlock_size(videoStableStartBo.getBlock_size());
|
|
|
- videoStable.setRadius(videoStable.getRadius());
|
|
|
- videoStable.setBuffer_size(videoStableStartBo.getBuffer_size());
|
|
|
- videoStable.setCornerquality(videoStable.getCornerquality());
|
|
|
- videoStable.setCornerminDistance(videoStable.getCornerminDistance());
|
|
|
- videoStable.setLklevel(videoStable.getLklevel());
|
|
|
- videoStable.setLkwinSiz(videoStable.getLkwinSiz());
|
|
|
-
|
|
|
- videoStable.setStatus(BizConstant.VideoStatus.RUNNING);
|
|
|
-
|
|
|
- save(videoStable);
|
|
|
- System.out.println(videoStable.getId());
|
|
|
+ public CommonResult start(Long id) {
|
|
|
+ VideoStable videoStable = getById(id);
|
|
|
|
|
|
log.info("start video_stable_url: {}", video_stable_url);
|
|
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
|
@@ -186,11 +171,13 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
StringEntity entity = new StringEntity(JsonUtils.toJsonString(videoStable), "UTF-8");
|
|
|
entity.setContentType("application/json");
|
|
|
request.setEntity(entity);
|
|
|
- try (CloseableHttpResponse response = httpClient.execute(request)) {
|
|
|
- String responseBody = EntityUtils.toString(response.getEntity());
|
|
|
- System.out.println(responseBody);
|
|
|
- return CommonResult.success("start video_stable success");
|
|
|
- }
|
|
|
+ CloseableHttpResponse response = httpClient.execute(request);
|
|
|
+ String responseBody = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println(responseBody);
|
|
|
+
|
|
|
+ videoStable.setStatus(BizConstant.VideoStatus.RUNNING);
|
|
|
+ updateById(videoStable);
|
|
|
+ return CommonResult.success("start video_stable success");
|
|
|
} catch (Exception e) {
|
|
|
videoStable.setStatus(BizConstant.VideoStatus.FAILED);
|
|
|
updateById(videoStable);
|