|
|
@@ -0,0 +1,100 @@
|
|
|
+package com.doc.web.controller.system;
|
|
|
+
|
|
|
+import com.doc.common.annotation.Log;
|
|
|
+import com.doc.common.core.controller.BaseController;
|
|
|
+import com.doc.common.core.domain.AjaxResult;
|
|
|
+import com.doc.common.core.page.TableDataInfo;
|
|
|
+import com.doc.common.enums.BusinessType;
|
|
|
+import com.doc.common.utils.poi.ExcelUtil;
|
|
|
+import com.doc.system.domain.SysAlarm;
|
|
|
+import com.doc.system.service.ISysAlarmService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 系统告警Controller
|
|
|
+ *
|
|
|
+ * @author wukai
|
|
|
+ * @date 2023-11-24
|
|
|
+ */
|
|
|
+@Api(tags = "系统告警")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/alarm")
|
|
|
+public class SysAlarmController extends BaseController {
|
|
|
+ @Resource
|
|
|
+ private ISysAlarmService sysAlarmService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询系统告警列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询系统告警列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(SysAlarm sysAlarm) {
|
|
|
+ startPage();
|
|
|
+ List<SysAlarm> list = sysAlarmService.selectSysAlarmList(sysAlarm);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出系统告警列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出系统告警列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:export')")
|
|
|
+ @Log(title = "系统告警", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, SysAlarm sysAlarm) {
|
|
|
+ List<SysAlarm> list = sysAlarmService.selectSysAlarmList(sysAlarm);
|
|
|
+ ExcelUtil<SysAlarm> util = new ExcelUtil<SysAlarm>(SysAlarm.class);
|
|
|
+ util.exportExcel(response, list, "系统告警数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取系统告警详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取系统告警详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:query')")
|
|
|
+ @GetMapping(value = "/{alarmId}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId) {
|
|
|
+ return success(sysAlarmService.selectSysAlarmByAlarmId(alarmId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增系统告警
|
|
|
+ */
|
|
|
+ @ApiOperation("新增系统告警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:add')")
|
|
|
+ @Log(title = "系统告警", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody SysAlarm sysAlarm) {
|
|
|
+ return toAjax(sysAlarmService.insertSysAlarm(sysAlarm));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改系统告警
|
|
|
+ */
|
|
|
+ @ApiOperation("修改系统告警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:edit')")
|
|
|
+ @Log(title = "系统告警", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody SysAlarm sysAlarm) {
|
|
|
+ return toAjax(sysAlarmService.updateSysAlarm(sysAlarm));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除系统告警
|
|
|
+ */
|
|
|
+ @ApiOperation("删除系统告警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('alarm:alarm:remove')")
|
|
|
+ @Log(title = "系统告警", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{alarmIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] alarmIds) {
|
|
|
+ return toAjax(sysAlarmService.deleteSysAlarmByAlarmIds(alarmIds));
|
|
|
+ }
|
|
|
+}
|