| package com.ruoyi.alarm.apponekey.controller; | 
|   | 
| import java.util.List; | 
| import javax.servlet.http.HttpServletResponse; | 
| import org.springframework.security.access.prepost.PreAuthorize; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.GetMapping; | 
| import org.springframework.web.bind.annotation.PostMapping; | 
| import org.springframework.web.bind.annotation.PutMapping; | 
| import org.springframework.web.bind.annotation.DeleteMapping; | 
| import org.springframework.web.bind.annotation.PathVariable; | 
| import org.springframework.web.bind.annotation.RequestBody; | 
| import org.springframework.web.bind.annotation.RequestMapping; | 
| import org.springframework.web.bind.annotation.RestController; | 
| import com.ruoyi.common.annotation.Log; | 
| import com.ruoyi.common.core.controller.BaseController; | 
| import com.ruoyi.common.core.domain.AjaxResult; | 
| import com.ruoyi.common.enums.BusinessType; | 
| import com.ruoyi.alarm.apponekey.domain.ArdAlarmApponekey; | 
| import com.ruoyi.alarm.apponekey.service.IArdAlarmApponekeyService; | 
| import com.ruoyi.common.utils.poi.ExcelUtil; | 
| import com.ruoyi.common.core.page.TableDataInfo; | 
|   | 
| /** | 
|  * app一键报警Controller | 
|  *  | 
|  * @author ard | 
|  * @date 2023-07-21 | 
|  */ | 
| @RestController | 
| @RequestMapping("/alarm/apponekey") | 
| public class ArdAlarmApponekeyController extends BaseController | 
| { | 
|     @Autowired | 
|     private IArdAlarmApponekeyService ardAlarmApponekeyService; | 
|   | 
|     /** | 
|      * 查询app一键报警列表 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:list')") | 
|     @GetMapping("/list") | 
|     public TableDataInfo list(ArdAlarmApponekey ardAlarmApponekey) | 
|     { | 
|         startPage(); | 
|         List<ArdAlarmApponekey> list = ardAlarmApponekeyService.selectArdAlarmApponekeyList(ardAlarmApponekey); | 
|         return getDataTable(list); | 
|     } | 
|   | 
|     /** | 
|      * 导出app一键报警列表 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:export')") | 
|     @Log(title = "app一键报警", businessType = BusinessType.EXPORT) | 
|     @PostMapping("/export") | 
|     public void export(HttpServletResponse response, ArdAlarmApponekey ardAlarmApponekey) | 
|     { | 
|         List<ArdAlarmApponekey> list = ardAlarmApponekeyService.selectArdAlarmApponekeyList(ardAlarmApponekey); | 
|         ExcelUtil<ArdAlarmApponekey> util = new ExcelUtil<ArdAlarmApponekey>(ArdAlarmApponekey.class); | 
|         util.exportExcel(response, list, "app一键报警数据"); | 
|     } | 
|   | 
|     /** | 
|      * 获取app一键报警详细信息 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:query')") | 
|     @GetMapping(value = "/{id}") | 
|     public AjaxResult getInfo(@PathVariable("id") String id) | 
|     { | 
|         return success(ardAlarmApponekeyService.selectArdAlarmApponekeyById(id)); | 
|     } | 
|   | 
|     /** | 
|      * 新增app一键报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:add')") | 
|     @Log(title = "app一键报警", businessType = BusinessType.INSERT) | 
|     @PostMapping | 
|     public AjaxResult add(@RequestBody ArdAlarmApponekey ardAlarmApponekey) | 
|     { | 
|         return toAjax(ardAlarmApponekeyService.insertArdAlarmApponekey(ardAlarmApponekey)); | 
|     } | 
|   | 
|     /** | 
|      * 修改app一键报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:edit')") | 
|     @Log(title = "app一键报警", businessType = BusinessType.UPDATE) | 
|     @PutMapping | 
|     public AjaxResult edit(@RequestBody ArdAlarmApponekey ardAlarmApponekey) | 
|     { | 
|         return toAjax(ardAlarmApponekeyService.updateArdAlarmApponekey(ardAlarmApponekey)); | 
|     } | 
|   | 
|     /** | 
|      * 删除app一键报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:apponekey:remove')") | 
|     @Log(title = "app一键报警", businessType = BusinessType.DELETE) | 
|     @DeleteMapping("/{ids}") | 
|     public AjaxResult remove(@PathVariable String[] ids) | 
|     { | 
|         return toAjax(ardAlarmApponekeyService.deleteArdAlarmApponekeyByIds(ids)); | 
|     } | 
| } |