package com.whyc.controller;
|
|
import com.whyc.dto.LockIdDto;
|
import com.whyc.dto.LockInfDto;
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.plus_inf.LockInf;
|
import com.whyc.pojo.plus_user.UserInf;
|
import com.whyc.service.LockInfService;
|
import com.whyc.util.ActionUtil;
|
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 LockInfController {
|
@Autowired
|
private LockInfService service;
|
|
|
@ApiOperation(value = "查询所有锁信息")
|
@PostMapping("getAllLockInf")
|
public Response getAllLockInf(@RequestBody LockInfDto dto){
|
UserInf uinf= ActionUtil.getUser();
|
dto.setUid(uinf.getUid());
|
return service.getAllLockInf(dto);
|
}
|
|
/*@ApiOperation(value = "查询所有锁名信息(用于下拉)")
|
@GetMapping("getLinf")
|
public Response getLinf(){
|
return service.getLinf();
|
}*/
|
|
|
@ApiOperation(value = "添加锁")
|
@PostMapping("addLock")
|
public Response addLock(@RequestBody LockInf lockInf){
|
return service.addLock(lockInf);
|
}
|
|
|
@ApiOperation(value = "删除锁")
|
@GetMapping("delLock")
|
public Response delLock(@RequestParam Integer lockId){
|
return service.delLock(lockId);
|
}
|
|
@ApiOperation(value = "修改锁")
|
@PostMapping("updateLock")
|
public Response updateLock(@RequestBody LockInf lockInf){
|
return service.updateLock(lockInf);
|
}
|
|
/*@ApiOperation(value = "获取区域下所有锁的状态(socket测试)")
|
@GetMapping("getLockRt")
|
public Response getLockRt(@RequestParam Integer areaId){
|
return service.getLockRt(areaId);
|
}*/
|
|
@ApiOperation("查询锁的信息和id卡")
|
@PostMapping("getLockId")
|
public Response getLockId(@RequestBody LockIdDto dto) {
|
UserInf uinf= ActionUtil.getUser();
|
dto.setUid(uinf.getUid());
|
Response res=service.getLockId(dto);
|
return res;
|
}
|
|
}
|