whyclxw
2025-01-21 e202f9e54e7ec0c983cad49825a1bda6ee314d8b
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.db_area.KeyInf;
import com.whyc.service.KeyInfService;
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 KeyInfController {
    @Autowired
    private KeyInfService service;
 
    @ApiOperation(value = "查询所有钥匙信息")
    @GetMapping("getAllKeyInf")
    public Response getAllKeyInf(@RequestParam(required = false) String keyName, @RequestParam(required = false) String uname
            , int pageNum, int pageSize){
        return service.getAllKeyInf(keyName,uname,pageNum,pageSize);
    }
 
    @ApiOperation(value = "查询所有钥匙名信息(用于下拉)")
    @GetMapping("getkinf")
    public Response getkinf(){
        return service.getkinf();
    }
 
    @ApiOperation(value = "授权时查询所有钥匙信息(不分页)")
    @GetMapping("getKeyInfAuth")
    public Response getKeyInfAuth(){
        return service.getKeyInfAuth();
    }
 
    @ApiOperation(value = "添加钥匙")
    @PostMapping("addKey")
    public Response addKey(@RequestBody KeyInf kinf){
        return service.addKey(kinf);
    }
 
 
    @ApiOperation(value = "删除钥匙")
    @GetMapping("delKey")
    public Response delKey(@RequestParam Integer keyId){
        return service.delKey(keyId);
    }
 
    @ApiOperation(value = "修改钥匙")
    @PostMapping("updateKey")
    public Response updateKey(@RequestBody KeyInf kinf){
        return service.updateKey(kinf);
    }
 
}