|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
+import com.sxtvs.open.api.h5template.service.impl.OSSService;
|
|
|
import com.sxtvs.open.api.review.dto.PageReqDTO;
|
|
|
import com.sxtvs.open.api.review.dto.VideoReviewResp;
|
|
|
import com.sxtvs.open.api.review.entity.ReviewImgRecord;
|
|
@@ -39,6 +40,9 @@ public class ReviewVideosRecordServiceImpl extends ServiceImpl<ReviewVideosRecor
|
|
|
@Resource
|
|
|
private VcrService vcrService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private OSSService ossService;
|
|
|
+
|
|
|
public ReviewVideosRecord store(ReviewVideosRecord reviewVideosRecord) {
|
|
|
Optional<String> token = HttpContextUtil.getToken();
|
|
|
|
|
@@ -54,6 +58,10 @@ public class ReviewVideosRecordServiceImpl extends ServiceImpl<ReviewVideosRecor
|
|
|
throw new BizException("视频审核失败,系统正在尝试重新提交 SHARES稍后");
|
|
|
}
|
|
|
body.fill();
|
|
|
+ if(TextUtils.isEmpty(reviewVideosRecord.getTitle())){
|
|
|
+ String[] extension = reviewVideosRecord.getUrl().split("/");
|
|
|
+ reviewVideosRecord.setTitle(extension[extension.length - 1]);
|
|
|
+ }
|
|
|
reviewVideosRecord.setTaskId(body.getTaskId());
|
|
|
reviewVideosRecord.setStatus(body.getStatus());
|
|
|
reviewVideosRecord.setResult(JSON.toJSONString(body));
|
|
@@ -73,6 +81,13 @@ public class ReviewVideosRecordServiceImpl extends ServiceImpl<ReviewVideosRecor
|
|
|
body.fill();
|
|
|
reviewVideosRecord.setStatus(body.getStatus());
|
|
|
reviewVideosRecord.setResult(JSON.toJSONString(body));
|
|
|
+
|
|
|
+ // 图片本地化
|
|
|
+ body.getResults().forEach(result -> result.getItems().forEach(item -> {
|
|
|
+ VideoReviewResp.ResultsDTO.ItemsDTO.EvidenceDTO evidence = item.getEvidence();
|
|
|
+ evidence.setThumbnail(ossService.vcr2local(evidence.getThumbnail()));
|
|
|
+ }));
|
|
|
+
|
|
|
updateById(reviewVideosRecord);
|
|
|
}
|
|
|
|