|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.fusion.common.util.LocalToOssUtil;
|
|
|
import com.fdkankan.fusion.common.util.MyFileUtils;
|
|
|
import com.fdkankan.fusion.config.CacheUtil;
|
|
@@ -56,8 +57,10 @@ public class InitService {
|
|
|
writerStateFile();
|
|
|
delRedisKey();
|
|
|
cleanRedisKey();
|
|
|
+ updateHotIcon();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public void getSettingJson() {
|
|
|
CacheUtil.settingPath = settingPath;
|
|
|
String s = FileUtil.readUtf8String(new File(settingPath));
|
|
@@ -214,5 +217,28 @@ public class InitService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ private void updateHotIcon() {
|
|
|
+ LambdaQueryWrapper<HotIcon> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(HotIcon::getIconTitle,"其他");
|
|
|
+ List<HotIcon> list = hotIconService.list(wrapper);
|
|
|
+ if(list.isEmpty()){
|
|
|
+ HotIcon hotIcon = new HotIcon();
|
|
|
+ hotIcon.setIconTitle("其他");
|
|
|
+ hotIcon.setIsSystem(1);
|
|
|
+ hotIcon.setSort(2);
|
|
|
+ hotIconService.save(hotIcon);
|
|
|
+
|
|
|
+ List<HotIcon> list1 = hotIconService.list();
|
|
|
+ for (HotIcon icon : list1) {
|
|
|
+ if(icon.getIconId().equals(hotIcon.getIconId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ icon.setParentId(hotIcon.getIconId());
|
|
|
+ hotIconService.updateById(icon);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|