whyclxw
2025-02-05 4b659a6ece105f30debf0def9225b9a89c43bcd4
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.db_area.AuthiruzeInf;
import com.whyc.pojo.db_area.KeyInf;
import com.whyc.service.AuthiruzeInfService;
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.*;
 
import java.util.List;
 
@RestController
@Api(tags = "授权管理")
@RequestMapping("authInf")
public class AuthiruzeInfController {
    @Autowired
    private AuthiruzeInfService service;
 
    @ApiOperation(value = "查询所有授权信息")
    @GetMapping("getAllAuthInf")
    public Response getAllAuthInf( @RequestParam(required = false) String uname
            ,@RequestParam int areaId , int pageNum, int pageSize){
        return service.getAllAuthInf(uname,areaId,pageNum,pageSize);
    }
 
    @ApiOperation(value = "添加授权(批量)")
    @PostMapping("addAuth")
    public Response addAuth(@RequestBody AuthiruzeInf auth){
        return service.addAuth(auth);
    }
 
 
    @ApiOperation(value = "删除授权(批量)")
    @PostMapping("delAuth")
    public Response delAuth(@RequestBody List<Integer> ids){
        return service.delAuth(ids);
    }
 
    @ApiOperation(value = "修改授权(批量)")
    @PostMapping("updateAuth")
    public Response updateAuth(@RequestBody AuthiruzeInf auth,@RequestParam int id){
        return service.updateAuth(auth,id);
    }
 
    @ApiOperation(value = "根据mac检测蓝牙锁是否有权限")
    @GetMapping("getAuthByUidAndMac")
    public Response getAuthByUidAndMac(@RequestParam String mac,@RequestParam String uname){
        return service.getAuthByUidAndMac(mac,uname);
    }
}