|
@@ -3,6 +3,8 @@ package com.management.platform.controller;
|
|
import com.management.platform.entity.vo.ScreenshotVO;
|
|
import com.management.platform.entity.vo.ScreenshotVO;
|
|
import com.management.platform.service.ScreenshotService;
|
|
import com.management.platform.service.ScreenshotService;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -15,6 +17,7 @@ import javax.annotation.Resource;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/imageProcessing")
|
|
@RequestMapping("/imageProcessing")
|
|
|
|
+@EnableScheduling
|
|
public class ImageProcessingController {
|
|
public class ImageProcessingController {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -31,9 +34,12 @@ public class ImageProcessingController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 初始化redis图片搜索的关键词
|
|
|
|
|
|
+ * 初始化redis图片搜索的关键词,
|
|
|
|
+ * 防止数据库初始添加了其他字段导致redis里的数据不是最新的,
|
|
|
|
+ * 做定时在系统不忙时进行更新redis里的最新图片关键词(注意:如果想要立即更新可手动调用)
|
|
*/
|
|
*/
|
|
@RequestMapping("/updateKeyWords")
|
|
@RequestMapping("/updateKeyWords")
|
|
|
|
+ @Scheduled(cron = "0 0 23 * * ?")//配置时间点触发(每日23点)
|
|
public HttpRespMsg updateRedisPicContentKeywords() {
|
|
public HttpRespMsg updateRedisPicContentKeywords() {
|
|
return screenshotService.updateRedisPicContentKeywords();
|
|
return screenshotService.updateRedisPicContentKeywords();
|
|
}
|
|
}
|