|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.dao.admin.response.DeviceEventDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.DeviceEvent; | 
|---|
|  |  |  | import com.doumee.dao.system.vo.DeviceEventVo; | 
|---|
|  |  |  | import com.doumee.service.business.DeviceEventService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | * @date 2023/11/23 18:16 | 
|---|
|  |  |  | * @date 2023/11/30 15:33 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Api(tags = "门禁事件推送记录表") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("business:deviceevent:create") | 
|---|
|  |  |  | //    @RequiresPermissions("business:deviceevent:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody DeviceEvent deviceEvent) { | 
|---|
|  |  |  | return ApiResponse.success(deviceEventService.create(deviceEvent)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @RequiresPermissions("business:deviceevent:query") | 
|---|
|  |  |  | public ApiResponse<PageData<DeviceEvent>> findPage (@RequestBody PageWrap<DeviceEvent> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(deviceEventService.findPage(pageWrap)); | 
|---|
|  |  |  | //@RequiresPermissions("business:deviceevent:query") | 
|---|
|  |  |  | public ApiResponse<PageData<DeviceEventDTO>> findPage (@RequestBody PageWrap<DeviceEvent> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(deviceEventService.findDeviceEventDTOPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @RequiresPermissions("business:deviceevent:exportExcel") | 
|---|
|  |  |  | //@RequiresPermissions("business:deviceevent:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<DeviceEvent> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | ExcelExporter.build(DeviceEvent.class).export(deviceEventService.findPage(pageWrap).getRecords(), "门禁事件推送记录表", response); | 
|---|
|  |  |  | ExcelExporter.build(DeviceEventDTO.class).export(deviceEventService.findDeviceEventDTOPage(pageWrap).getRecords(), "门禁事件推送记录表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //    public void exportExcel (@RequestBody PageWrap<DeviceEvent> pageWrap, HttpServletResponse response) { | 
|---|
|  |  |  | //        ExcelExporter.build(DeviceEventVo.class).export(deviceEventService.findDeviceEventExcel(pageWrap), "门禁事件推送记录表", response); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|