whyclxw
2025-01-20 364adf83c47366a5b01dfe005fd0eed11f9346e6
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.mapper.LockInfMapper;
import com.whyc.pojo.db_area.LockInf;
import com.whyc.service.AreaInfService;
import com.whyc.service.LockInfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RestController
@Api(tags = "锁具管理")
@RequestMapping("lockInf")
public class LockInfController {
    @Autowired
    private LockInfService service;
 
 
    @ApiOperation(value = "查询所有锁信息")
    @GetMapping("getAllLockInf")
    public Response getAllLockInf(@RequestParam(required = false) String lockName, @RequestParam(required = false) Integer lockType,@RequestParam(required = false) Integer lockState
            ,@RequestParam int areaId,int pageNum,int pageSize){
        return service.getAllLockInf(lockName,lockType,lockState,areaId,pageNum,pageSize);
    }
 
    @ApiOperation(value = "查询所有锁名信息(用于下拉)")
    @GetMapping("getLinf")
    public Response getLinf(){
        return service.getLinf();
    }
 
    @ApiOperation(value = "查询区域管理员的所有区域下锁具(用于下拉)")
    @GetMapping("getAreaUserLock")
    public Response getAreaUserLock(){
        return service.getAreaUserLock();
    }
 
    @ApiOperation(value = "授权时查询所有蓝牙锁信息(不分页)")
    @GetMapping("getLockInfAuth")
    public Response getLockInfAuth(){
        return service.getLockInfAuth();
    }
 
 
    @ApiOperation(value = "添加锁(批量)")
    @PostMapping("addLock")
    public Response addLock(@RequestParam(required = false) Integer num,@RequestBody LockInf lockInf){
        return service.addLock(num,lockInf);
    }
    @ApiOperation(value = "查询屏柜全部类型(下拉)")
    @PostMapping("getScreenType")
    public Response getScreenType(){
        return service.getScreenType();
    }
 
    @ApiOperation(value = "查询屏柜全部品牌(下拉)")
    @PostMapping("getScreenProduct")
    public Response getScreenProduct(){
        return service.getScreenProduct();
    }
 
 
 
    @ApiOperation(value = "删除锁")
    @GetMapping("delLock")
    public Response delLock(@RequestParam Integer lockId){
        return service.delLock(lockId);
    }
 
    @ApiOperation(value = "修改锁")
    @PostMapping("updateLock")
    public Response updateLock(@RequestBody LockInf lockInf){
        return service.updateLock(lockInf);
    }
 
    @ApiOperation(value = "获取区域下所有锁的状态(socket测试)")
    @GetMapping("getLockRt")
    public Response getLockRt(@RequestParam Integer areaId){
        return service.getLockRt(areaId);
    }
 
}