jiangping
2023-12-06 aaf97e7b61e4fbde5adbda553d55d34eb5fef568
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.doumee.api.business;
 
import com.doumee.api.BaseController;
import com.doumee.core.annotation.excel.ExcelExporter;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest;
import com.doumee.core.haikang.model.param.request.ParkListRequest;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.Device;
import com.doumee.service.business.DeviceService;
import com.doumee.service.business.HkSyncService;
import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl;
import com.doumee.service.business.impl.hksync.HkSyncPrivilegeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
 
/**
 * @author 江蹄蹄
 * @date 2023/11/30 15:33
 */
@Api(tags = "海康数据同步接口")
@RestController
@RequestMapping("/business/hksync")
public class HkSyncController extends BaseController {
 
    @Autowired
    private HkSyncDeviceServiceImpl hkSyncDeviceService;
    @Autowired
    private HkSyncParkServiceImpl hkSyncParkService;
    @Autowired
    private HkSyncPrivilegeServiceImpl hkSyncPrivilegeService;
 
    @PreventRepeat
    @ApiOperation("【海康】全量同步门禁设备接口")
    @PostMapping("/getDevices")
//    @RequiresPermissions("business:hksync:device")
    public ApiResponse getDevices(@RequestBody AcsDeviceListRequest param) {
        String result = hkSyncDeviceService.syncHkDevices(param);
        return ApiResponse.success(result);
    }
    @PreventRepeat
    @ApiOperation("【海康】全量同步停车库接口")
    @PostMapping("/getParks")
//    @RequiresPermissions("business:hksync:park")
    public ApiResponse getParks(@RequestBody ParkListRequest param) {
        String result = hkSyncParkService.syncHkParks(param);
        return ApiResponse.success(result);
    }
    @PreventRepeat
    @ApiOperation("【海康】全量同步停车库接口")
    @PostMapping("/getPrivilege")
//    @RequiresPermissions("business:hksync:privilege")
    public ApiResponse getPrivilege(@RequestBody ParkListRequest param) {
        String result = hkSyncPrivilegeService.syncHkParks(param);
        return ApiResponse.success(result);
    }
}