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){
|
return service.getAuthByUidAndMac(mac);
|
}
|
}
|