| | |
| | | } |
| | | |
| | | @PostMapping("/getByUserId") |
| | | public Object getByUserId(Long userId) { |
| | | User byId = userService.getById(userId); |
| | | public Object getByUserId(String parkIds) { |
| | | List<Park> list = new ArrayList<>(); |
| | | if(byId == null){ |
| | | return R.failed("未查询到用户"); |
| | | }else { |
| | | String parkIds = byId.getParkIds(); |
| | | if(StringUtils.isBlank(parkIds)){ |
| | | return R.failed("该用户未管理停车场"); |
| | | } |
| | |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/getById") |
| | | public Object getById(Long parkId) { |
| | | Park byId = parkService.getById(parkId); |
| | |
| | | return R.failed("未查询到该停车场"); |
| | | }else { |
| | | String s = redisTemplate.opsForValue().get("car_park_" + parkId); |
| | | if(StringUtils.isBlank(s)){ |
| | | redisTemplate.opsForValue().set("car_park_" + parkId,"0",30, TimeUnit.DAYS); |
| | | s = "0"; |
| | | } |
| | | byId.setCarNum(Integer.parseInt(s)); |
| | | return R.ok(byId,"查询成功"); |
| | | } |