| | |
| | | /** |
| | | * 获取用户所有的设备码 |
| | | */ |
| | | public List<String> listDeviceCode(/*int start, int end*/) { |
| | | return baseMapper.listCode(/*start,end,*/SecurityUtils.getClientId()); |
| | | public List<String> listDeviceCode(int start, int end) { |
| | | if (SecurityUtils.getClientId() != null) { |
| | | PageHelper.startPage(start, end); |
| | | return baseMapper.listCode(SecurityUtils.getUserId()); |
| | | } |
| | | PageHelper.startPage(start, end); |
| | | return baseMapper.listCode(null); |
| | | } |
| | | |
| | | public boolean setPower(List<Long> ids, Integer power1, Integer power2) { |
| | | List<Light> lights = listByIds(ids); |
| | | lights.forEach(light -> { |
| | | light.setPower1(power1); |
| | | light.setPower2(power2); |
| | | } |
| | | ); |
| | | return updateBatchById(lights); |
| | | } |
| | | } |