| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.query.MwWarningRecordQuery; |
| | | import com.sinata.system.domain.vo.MwWarningRecordVO; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = "预警记录相关接口") |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/mwWarningRecord") |
| | | public class MwWarningRecordController { |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | |
| | | /** |
| | | * 预警信息分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("预警信息分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwWarningRecordVO>> pageList(@Valid @RequestBody MwWarningRecordQuery query) { |
| | | return R.ok(mwWarningRecordService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 解除预警 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("解除预警") |
| | | @GetMapping("/relieve/{id}") |
| | | public R<?> relieve(@ApiParam(name = "id", value = "预警记录id", required = true) @PathVariable("id") Long id) { |
| | | mwWarningRecordService.relieve(id); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation("预警信息导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MwWarningRecordQuery query) { |
| | | try { |
| | | mwWarningRecordService.export(query); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | } |