| | |
| | | |
| | | /** |
| | | * 设备日志Controller |
| | | * |
| | | * |
| | | * @author kerwincui |
| | | * @date 2022-01-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/iot/deviceLog") |
| | | public class DeviceLogController extends BaseController |
| | | { |
| | | public class DeviceLogController extends BaseController { |
| | | @Autowired |
| | | private IDeviceLogService deviceLogService; |
| | | |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(DeviceLog deviceLog) |
| | | { |
| | | public TableDataInfo list(DeviceLog deviceLog) { |
| | | startPage(); |
| | | List<DeviceLog> list = deviceLogService.selectDeviceLogList(deviceLog); |
| | | return getDataTable(list); |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:list')") |
| | | @GetMapping("/monitor") |
| | | public TableDataInfo monitorList(DeviceLog deviceLog) |
| | | { |
| | | public TableDataInfo monitorList(DeviceLog deviceLog) { |
| | | List<MonitorModel> list = deviceLogService.selectMonitorList(deviceLog); |
| | | return getDataTable(list); |
| | | } |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:device:export')") |
| | | @Log(title = "设备日志", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, DeviceLog deviceLog) |
| | | { |
| | | public void export(HttpServletResponse response, DeviceLog deviceLog) { |
| | | List<DeviceLog> list = deviceLogService.selectDeviceLogList(deviceLog); |
| | | ExcelUtil<DeviceLog> util = new ExcelUtil<DeviceLog>(DeviceLog.class); |
| | | util.exportExcel(response, list, "设备日志数据"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取设备日志详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:query')") |
| | | @GetMapping(value = "/{logId}") |
| | | public AjaxResult getInfo(@PathVariable("logId") Long logId) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("logId") Long logId) { |
| | | return AjaxResult.success(deviceLogService.selectDeviceLogByLogId(logId)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:device:add')") |
| | | @Log(title = "设备日志", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DeviceLog deviceLog) |
| | | { |
| | | public AjaxResult add(@RequestBody DeviceLog deviceLog) { |
| | | return toAjax(deviceLogService.insertDeviceLog(deviceLog)); |
| | | } |
| | | |
| | |
| | | @PreAuthorize("@ss.hasPermi('iot:device:edit')") |
| | | @Log(title = "设备日志", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DeviceLog deviceLog) |
| | | { |
| | | public AjaxResult edit(@RequestBody DeviceLog deviceLog) { |
| | | return toAjax(deviceLogService.updateDeviceLog(deviceLog)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('iot:device:remove')") |
| | | @Log(title = "设备日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{logIds}") |
| | | public AjaxResult remove(@PathVariable Long[] logIds) |
| | | { |
| | | @DeleteMapping("/{logIds}") |
| | | public AjaxResult remove(@PathVariable Long[] logIds) { |
| | | return toAjax(deviceLogService.deleteDeviceLogByLogIds(logIds)); |
| | | } |
| | | } |