| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.db_area.AreaUser; |
| | | import com.whyc.pojo.db_lock_ram.LockCtlLog; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.service.AreaInfService; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "区域管理") |
| | |
| | | |
| | | @ApiOperation(value = "查询所有区域信息") |
| | | @GetMapping("getAllAreaInf") |
| | | public Response getAllAreaInf(){ |
| | | return service.getAllAreaInf(); |
| | | public Response getAllAreaInf(String uname){ |
| | | return service.getAllAreaInf(uname); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有区域信息(平台)") |
| | | @GetMapping("getAllAreaInfInPaltForm") |
| | | public Response getAllAreaInfInPaltForm(){ |
| | | UserInf uinf=ActionUtil.getUser(); |
| | | return service.getAllAreaInf(uinf.getUname()); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加区域") |
| | | @GetMapping("addArea") |
| | | public Response addArea(@RequestParam(required = false) Integer parentId,@RequestParam String areaName,@RequestParam(required = false) String areaUname,@RequestParam(required = false) String areaDescript){ |
| | | return service.addArea(parentId,areaName,areaUname,areaDescript); |
| | | @PostMapping("addArea") |
| | | public Response addArea(@RequestParam(required = false) Integer parentId,@RequestBody List<AreaUser> areaUserList,@RequestParam String areaName,@RequestParam(required = false) String areaDescript){ |
| | | return service.addArea(parentId,areaUserList,areaName,areaDescript); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除区域") |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "修改区域") |
| | | @GetMapping("updateArea") |
| | | public Response updateArea(@RequestParam(required = false) Integer id,@RequestParam String areaName,@RequestParam(required = false) String areaUname,@RequestParam(required = false) String areaDescript){ |
| | | return service.updateArea(id,areaName,areaUname,areaDescript); |
| | | @PostMapping("updateArea") |
| | | public Response updateArea(@RequestParam(required = false) Integer id, @RequestParam String areaName, @RequestBody List<AreaUser> areaUserList, @RequestParam(required = false) String areaDescript){ |
| | | return service.updateArea(id,areaName,areaUserList,areaDescript); |
| | | } |
| | | @ApiOperation(value = "查询所在区域下所有用户信息") |
| | | @GetMapping("getUinfById") |
| | | public Response getUinfById(@RequestParam Integer id, int pageNum, int pageSize){ |
| | | return service.getUinfById(id,pageNum,pageSize); |
| | | public Response getUinfById(@RequestParam Integer id){ |
| | | return service.getUinfById(id); |
| | | } |
| | | @ApiOperation(value = "查询所在区域下所有锁信息") |
| | | @ApiOperation(value = "查询所在区域下所有锁信息") |
| | | @GetMapping("getLinfById") |
| | | public Response getLinfById(@RequestParam Integer id, int pageNum, int pageSize){ |
| | | return service.getLinfById(id,pageNum,pageSize); |
| | | public Response getLinfById(@RequestParam Integer id){ |
| | | return service.getLinfById(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所在区域下所有钥匙信息") |
| | | @ApiOperation(value = "查询开锁日志") |
| | | @PostMapping("getLockLog") |
| | | public Response getLockLog(@RequestBody LockCtlLog log, int pageNum, int pageSize){ |
| | | return service.getLockLog(log,pageNum,pageSize); |
| | | } |
| | | /*@ApiOperation(value = "查询所在区域下所有钥匙信息") |
| | | @GetMapping("getKinfById") |
| | | public Response getKinfById(@RequestParam Integer id, int pageNum, int pageSize){ |
| | | return service.getKinfById(id,pageNum,pageSize); |
| | | } |
| | | }*/ |
| | | |
| | | @ApiOperation(value = "查询所在区域下所有开锁日志") |
| | | /* @ApiOperation(value = "查询所在区域下所有开锁日志") |
| | | @GetMapping("getLogById") |
| | | public Response getLogById(@RequestParam Integer id, int pageNum, int pageSize){ |
| | | return service.getLogById(id,pageNum,pageSize); |
| | | } |
| | | }*/ |
| | | |
| | | } |