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); } }