whyclxw
2025-03-25 a7fef2846505b08e0711345b17902e7381612d23
src/main/java/com/whyc/controller/LockInfController.java
@@ -2,15 +2,13 @@
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
@Api(tags = "锁具管理")
@@ -22,9 +20,21 @@
    @ApiOperation(value = "查询所有锁信息")
    @GetMapping("getAllLockInf")
    public Response getAllLockInf(@RequestParam(required = false) String lockName, @RequestParam(required = false) String lockType,@RequestParam(required = false) Integer lockState
    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 = "授权时查询所有蓝牙锁信息(不分页)")
@@ -35,10 +45,22 @@
    @ApiOperation(value = "添加锁(批量)")
    @GetMapping("addLock")
    public Response addLock(@RequestParam(required = false) Integer areaId, @RequestParam String lockName, @RequestParam(required = false) Integer lockType, @RequestParam(required = false) Integer num){
        return service.addLock(areaId,lockName,lockType,num);
    @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 = "删除锁")
@@ -48,9 +70,9 @@
    }
    @ApiOperation(value = "修改锁")
    @GetMapping("updateLock")
    public Response updateLock(@RequestParam(required = false) Integer areaId,@RequestParam Integer lockId, @RequestParam String lockName, @RequestParam(required = false) String lockType){
        return service.updateLock(lockId,areaId,lockName,lockType);
    @PostMapping("updateLock")
    public Response updateLock(@RequestBody LockInf lockInf){
        return service.updateLock(lockInf);
    }
    @ApiOperation(value = "获取区域下所有锁的状态(socket测试)")