|
@@ -0,0 +1,75 @@
|
|
|
+//package com.fdkankan.scene.init;
|
|
|
+//
|
|
|
+//import cn.hutool.core.collection.CollUtil;
|
|
|
+//import com.alibaba.fastjson.JSON;
|
|
|
+//import com.alibaba.fastjson.JSONObject;
|
|
|
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+//import com.fdkankan.download.bean.DownLoadTaskBean;
|
|
|
+//import com.fdkankan.redis.constant.RedisKey;
|
|
|
+//import com.fdkankan.redis.constant.RedisLockKey;
|
|
|
+//import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
+//import com.fdkankan.redis.util.RedisUtil;
|
|
|
+//import com.fdkankan.scene.entity.ScenePlus;
|
|
|
+//import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
+//import com.fdkankan.scene.service.IScenePlusExtService;
|
|
|
+//import com.fdkankan.scene.service.IScenePlusService;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.boot.CommandLineRunner;
|
|
|
+//import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+//import org.springframework.stereotype.Component;
|
|
|
+//
|
|
|
+//import java.util.List;
|
|
|
+//import java.util.stream.Collectors;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * <p>
|
|
|
+// * 应用启动校验是否有下载任务正在进行,如有过就重新入队头,从新下载
|
|
|
+// * </p>
|
|
|
+// *
|
|
|
+// * @author dengsixing
|
|
|
+// * @since 2022/2/22
|
|
|
+// **/
|
|
|
+//@Component
|
|
|
+//public class InitDataHandler implements CommandLineRunner {
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// RedisUtil redisUtil;
|
|
|
+// @Autowired
|
|
|
+// RedisTemplate redisTemplate;
|
|
|
+// @Autowired
|
|
|
+// RedisLockUtil redisLockUtil;
|
|
|
+// @Autowired
|
|
|
+// private IScenePlusService scenePlusService;
|
|
|
+// @Autowired
|
|
|
+// private IScenePlusExtService scenePlusExtService;
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void run(String... args) throws Exception {
|
|
|
+//
|
|
|
+// List<ScenePlusExt> scenePlusExtList = scenePlusExtService.list(new LambdaQueryWrapper<ScenePlusExt>().like(ScenePlusExt::getVideos, "/oss/"));
|
|
|
+// if(CollUtil.isNotEmpty(scenePlusExtList)){
|
|
|
+// scenePlusExtList.stream().forEach(ext -> {
|
|
|
+// ScenePlus scenePlus = scenePlusService.getById(ext.getPlusId());
|
|
|
+//
|
|
|
+// JSONObject jsonObject = JSON.parseObject(ext.getVideos());
|
|
|
+// String upPath = jsonObject.getString("upPath");
|
|
|
+// jsonObject.put("upPath", upPath.replace("/oss/", ""));
|
|
|
+//
|
|
|
+// String key = String.format(RedisKey.SCENE_JSON, scenePlus.getNum());
|
|
|
+// String sceneJsonStr = redisUtil.get(key);
|
|
|
+// JSONObject sceneJsonObj = JSON.parseObject(sceneJsonStr);
|
|
|
+// sceneJsonObj.getJSONObject()
|
|
|
+//
|
|
|
+//
|
|
|
+// });
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//}
|