|
@@ -3,14 +3,20 @@ package com.fdkankan.ucenter.controller;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
|
+import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.ucenter.common.OssPath;
|
|
import com.fdkankan.ucenter.common.OssPath;
|
|
import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
import com.fdkankan.ucenter.common.Result;
|
|
import com.fdkankan.ucenter.common.Result;
|
|
-import com.fdkankan.ucenter.service.IFolderSceneService;
|
|
|
|
|
|
+import com.fdkankan.ucenter.entity.ScenePlus;
|
|
|
|
+import com.fdkankan.ucenter.entity.ScenePlusExt;
|
|
|
|
+import com.fdkankan.ucenter.entity.ScenePro;
|
|
|
|
+import com.fdkankan.ucenter.entity.SceneProRe;
|
|
|
|
+import com.fdkankan.ucenter.service.*;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -19,9 +25,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
|
+@RequestMapping("/ucenter")
|
|
public class TestController {
|
|
public class TestController {
|
|
@Resource
|
|
@Resource
|
|
private IFolderSceneService folderSceneService;
|
|
private IFolderSceneService folderSceneService;
|
|
@@ -32,4 +40,32 @@ public class TestController {
|
|
return Result.success( count);
|
|
return Result.success( count);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ RedisUtil redisUtil;
|
|
|
|
+ @Autowired
|
|
|
|
+ ISceneProService sceneProService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IScenePlusService scenePlusService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IScenePlusExtService scenePlusExtService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ISceneProReService sceneProReService;
|
|
|
|
+
|
|
|
|
+ @RequestMapping("/_updateViewCount_test")
|
|
|
|
+ public Result updateViewCount() throws Exception {
|
|
|
|
+ List<SceneProRe> sceneProRes = sceneProReService.getV4Num();
|
|
|
|
+ for (SceneProRe sceneProRe : sceneProRes) {
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(sceneProRe.getNum());
|
|
|
|
+ if(scenePlus != null){
|
|
|
|
+ ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
|
+ if(ext!= null && sceneProRe.getViewCount() != null){
|
|
|
|
+ LambdaUpdateWrapper<ScenePlusExt> wrapper = new LambdaUpdateWrapper<>();
|
|
|
|
+ wrapper.eq(ScenePlusExt::getId,ext.getId());
|
|
|
|
+ wrapper.set(ScenePlusExt::getViewCount,sceneProRe.getViewCount());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return Result.success( );
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|