| package com.ruoyi.alarm.access.controller; | 
|   | 
| import java.util.List; | 
| import javax.servlet.http.HttpServletResponse; | 
| import com.ruoyi.alarm.access.domain.ArdAlarmAccess; | 
| import com.ruoyi.alarm.access.service.IArdAlarmAccessService; | 
| 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.common.utils.poi.ExcelUtil; | 
| import com.ruoyi.common.core.page.TableDataInfo; | 
|   | 
| /** | 
|  * 门禁报警Controller | 
|  *  | 
|  * @author ard | 
|  * @date 2023-07-10 | 
|  */ | 
| @RestController | 
| @RequestMapping("/alarm/access") | 
| public class ArdAlarmAccessController extends BaseController | 
| { | 
|     @Autowired | 
|     private IArdAlarmAccessService ardAlarmAccessService; | 
|   | 
|     /** | 
|      * 查询门禁报警列表 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:list')") | 
|     @GetMapping("/list") | 
|     public TableDataInfo list(ArdAlarmAccess ardAlarmAccess) | 
|     { | 
|         startPage(); | 
|         List<ArdAlarmAccess> list = ardAlarmAccessService.selectArdAlarmAccessList(ardAlarmAccess); | 
|         return getDataTable(list); | 
|     } | 
|   | 
|     /** | 
|      * 导出门禁报警列表 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:export')") | 
|     @Log(title = "门禁报警", businessType = BusinessType.EXPORT) | 
|     @PostMapping("/export") | 
|     public void export(HttpServletResponse response, ArdAlarmAccess ardAlarmAccess) | 
|     { | 
|         List<ArdAlarmAccess> list = ardAlarmAccessService.selectArdAlarmAccessList(ardAlarmAccess); | 
|         ExcelUtil<ArdAlarmAccess> util = new ExcelUtil<ArdAlarmAccess>(ArdAlarmAccess.class); | 
|         util.exportExcel(response, list, "门禁报警数据"); | 
|     } | 
|   | 
|     /** | 
|      * 获取门禁报警详细信息 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:query')") | 
|     @GetMapping(value = "/{id}") | 
|     public AjaxResult getInfo(@PathVariable("id") String id) | 
|     { | 
|         return success(ardAlarmAccessService.selectArdAlarmAccessById(id)); | 
|     } | 
|   | 
|     /** | 
|      * 新增门禁报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:add')") | 
|     @Log(title = "门禁报警", businessType = BusinessType.INSERT) | 
|     @PostMapping | 
|     public AjaxResult add(@RequestBody ArdAlarmAccess ardAlarmAccess) | 
|     { | 
|         return toAjax(ardAlarmAccessService.insertArdAlarmAccess(ardAlarmAccess)); | 
|     } | 
|   | 
|     /** | 
|      * 修改门禁报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:edit')") | 
|     @Log(title = "门禁报警", businessType = BusinessType.UPDATE) | 
|     @PutMapping | 
|     public AjaxResult edit(@RequestBody ArdAlarmAccess ardAlarmAccess) | 
|     { | 
|         return toAjax(ardAlarmAccessService.updateArdAlarmAccess(ardAlarmAccess)); | 
|     } | 
|   | 
|     /** | 
|      * 删除门禁报警 | 
|      */ | 
|     @PreAuthorize("@ss.hasPermi('alarm:access:remove')") | 
|     @Log(title = "门禁报警", businessType = BusinessType.DELETE) | 
|     @DeleteMapping("/{ids}") | 
|     public AjaxResult remove(@PathVariable String[] ids) | 
|     { | 
|         return toAjax(ardAlarmAccessService.deleteArdAlarmAccessByIds(ids)); | 
|     } | 
| } |