| | |
| | | import com.ruoyi.iot.model.DeviceShortOutput; |
| | | import com.ruoyi.iot.mqtt.EmqxService; |
| | | import com.ruoyi.iot.service.IDeviceService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static sun.audio.AudioDevice.device; |
| | | |
| | | /** |
| | | * 设备Controller |
| | | * |
| | |
| | | @RestController |
| | | @RequestMapping("/iot/device") |
| | | public class DeviceController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IDeviceService deviceService; |
| | | |
| | |
| | | startPage(); |
| | | return getDataTable(deviceService.selectDeviceList(device)); |
| | | } |
| | | |
| | | /** |
| | | * 查询首页的总用户数(人),总设备数(台) |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:list')") |
| | | @GetMapping("/select/{id}") |
| | | @ApiOperation(value = "获取总用户数和总设备数") |
| | | public AjaxResult selectCount(@PathVariable("id") int id) throws Exception { |
| | | if (id > 0) { |
| | | return deviceService.selectDeviceCount(id); |
| | | } else { |
| | | return AjaxResult.error("未查询到有关信息,id的值不能小于1"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询未分配授权码设备列表 |
| | |
| | | @ApiOperation("设备分页简短列表") |
| | | public TableDataInfo shortList(Device device) { |
| | | startPage(); |
| | | return getDataTable(deviceService.selectDeviceShortList(device)); |
| | | return getDataTable(deviceService.selectDeviceShortList(device, false)); |
| | | } |
| | | |
| | | /** |
| | | * 查询设备简短列表,主页列表数据 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:list')") |
| | | @GetMapping("/shortListRepair") |
| | | @ApiOperation("设备分页简短列表") |
| | | public TableDataInfo shortListRepair(Device device) { |
| | | startPage(); |
| | | return getDataTable(deviceService.selectDeviceShortList(device, true)); |
| | | } |
| | | |
| | | /** |