whyclxw
2024-11-27 26fc0e819bf48574e65ace989d1fb2253d551e93
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.mapper.LockInfMapper;
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;
 
@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) String lockType,@RequestParam(required = false) Integer lockState
                                 ,int pageNum,int pageSize){
        return service.getAllLockInf(lockName,lockType,lockState,pageNum,pageSize);
    }
 
    @ApiOperation(value = "添加锁(批量)")
    @GetMapping("addLock")
    public Response addLock(@RequestParam(required = false) Integer areaId, @RequestParam String lockName, @RequestParam(required = false) String lockType, @RequestParam(required = false) Integer num){
        return service.addLock(areaId,lockName,lockType,num);
    }
 
 
    @ApiOperation(value = "删除锁")
    @GetMapping("delLock")
    public Response delLock(@RequestParam Integer id){
        return service.delLock(id);
    }
 
    @ApiOperation(value = "修改锁")
    @GetMapping("updateLock")
    public Response updateLock(@RequestParam(required = false) Integer areaId,@RequestParam Integer id, @RequestParam String lockName, @RequestParam(required = false) String lockType){
        return service.updateLock(id,areaId,lockName,lockType);
    }
}