package com.gkhy.hazmat.admin.controller.web;
|
|
|
import com.gkhy.hazmat.common.annotation.RepeatSubmit;
|
import com.gkhy.hazmat.common.api.CommonResult;
|
import com.gkhy.hazmat.system.domain.HzWarning;
|
import com.gkhy.hazmat.system.service.HzWarningService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 预警表 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2024-08-05 14:41:40
|
*/
|
@Api(tags = "预警前端控制器")
|
@RestController
|
@RequestMapping("/warning")
|
public class HzWarningController {
|
|
@Autowired
|
private HzWarningService warningService;
|
|
@ApiOperation(value = "预警列表(分页)")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
|
@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
|
})
|
@GetMapping("/list")
|
public CommonResult list(HzWarning warning){
|
return CommonResult.success(warningService.selectWarningList(warning));
|
}
|
|
@ApiOperation(value = "未处理预警数量")
|
@GetMapping("/warningCount")
|
public CommonResult warningCount(){
|
return CommonResult.success(warningService.selectWarningCount());
|
}
|
|
@RepeatSubmit
|
@PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
|
@ApiOperation(value = "标记处理预警")
|
@PutMapping("/markWarning")
|
public CommonResult markWarning(@RequestBody HzWarning warning){
|
return CommonResult.success(warningService.markWarning(warning));
|
}
|
|
@RepeatSubmit
|
@PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
|
@ApiOperation(value = "删除预警")
|
@DeleteMapping(value = { "/{warningId}" })
|
public CommonResult delete(@PathVariable(value = "warningId", required = true) Long warningId){
|
return CommonResult.success(warningService.deleteWarningById(warningId));
|
}
|
|
}
|