MrShi
2025-01-06 e1ec365640eefdcb06abb1d73da0d80367f79be3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.doumee.api;
 
import com.doumee.api.BaseController;
import com.doumee.config.DataSyncConfig;
import com.doumee.core.model.ApiResponse;
import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncImgServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author 江蹄蹄
 * @date 2023/11/30 15:33
 */
@Api(tags = "海康事件图片下载定时器接口")
@RestController
@RequestMapping("/timer/image")
public class HkImageTimerController extends BaseController {
 
    /**
     * 是否开发者
     */
    @Autowired
    private DataSyncConfig dataSyncConfig;
    @Autowired
    private HkSyncImgServiceImpl hkSyncImgService;
    @ApiOperation("开启定时下载海康系统图片数据")
    @GetMapping("/downHKImgs")
    public ApiResponse downHKImgs() {
        if(dataSyncConfig.getNeedDealImg()!=null && dataSyncConfig.getNeedDealImg()){
            hkSyncImgService.downHKImgs(0);
        }
        return ApiResponse.success("开启定时下载海康系统图片数据成功");
    }
 
}