|
@@ -12,6 +12,9 @@ import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.LifeUserLearningVideo;
|
|
import shop.alien.entity.store.LifeUserLearningVideo;
|
|
|
import shop.alien.mapper.LifeUserLearningVideoMapper;
|
|
import shop.alien.mapper.LifeUserLearningVideoMapper;
|
|
|
import shop.alien.store.service.LifeUserLearningVideoService;
|
|
import shop.alien.store.service.LifeUserLearningVideoService;
|
|
|
|
|
+import shop.alien.util.common.VideoDurationFFmpeg;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
@@ -19,8 +22,10 @@ import shop.alien.store.service.LifeUserLearningVideoService;
|
|
|
public class LifeUserLearningVideoServiceImpl extends ServiceImpl<LifeUserLearningVideoMapper, LifeUserLearningVideo> implements LifeUserLearningVideoService {
|
|
public class LifeUserLearningVideoServiceImpl extends ServiceImpl<LifeUserLearningVideoMapper, LifeUserLearningVideo> implements LifeUserLearningVideoService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public R<String> add(LifeUserLearningVideo lifeUserLearningVideo) {
|
|
|
|
|
|
|
+ public R<String> add(LifeUserLearningVideo lifeUserLearningVideo) throws IOException, InterruptedException {
|
|
|
log.info("LifeUserLearningVideoServiceImpl.add, param={}", lifeUserLearningVideo);
|
|
log.info("LifeUserLearningVideoServiceImpl.add, param={}", lifeUserLearningVideo);
|
|
|
|
|
+ long videoDuration = VideoDurationFFmpeg.getVideoDuration(lifeUserLearningVideo.getVideoUrl());
|
|
|
|
|
+ lifeUserLearningVideo.setVideoDuration(String.valueOf(videoDuration));
|
|
|
boolean result = this.save(lifeUserLearningVideo);
|
|
boolean result = this.save(lifeUserLearningVideo);
|
|
|
if (result) {
|
|
if (result) {
|
|
|
return R.success("新增成功");
|
|
return R.success("新增成功");
|