chenzx
2024-02-20 77847fe500de2519cba82d1a5ef03d055739f0d7
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceLogController.java
@@ -18,14 +18,13 @@
/**
 * 设备日志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;
@@ -34,8 +33,7 @@
     */
    @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);
@@ -46,8 +44,7 @@
     */
    @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);
    }
@@ -58,20 +55,19 @@
    @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));
    }
@@ -81,8 +77,7 @@
    @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));
    }
@@ -92,8 +87,7 @@
    @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));
    }
@@ -102,9 +96,8 @@
     */
    @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));
    }
}