package vip.xiaonuo.write.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 vip.xiaonuo.common.pojo.CommonResult;
import vip.xiaonuo.write.entity.WriteThreshold;
import vip.xiaonuo.write.entity.WriteWarning;
import vip.xiaonuo.write.param.WriteThresholdPageParam;
import vip.xiaonuo.write.param.WriteWarningPageParam;
import vip.xiaonuo.write.service.IWriteWarningService;

/**
 * <p>
 * 通用预警列表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-01
 */
@RestController
@Api(tags = "通用预警列表")
@ApiSupport(author = "wang", order = 1)
@Validated
public class WriteWarningController {

    @Autowired
    private IWriteWarningService warningService;

    @PostMapping("/write-warning/page")
    @ApiOperationSupport(order = 1)
    @ApiOperation("通用预警分页")
    public CommonResult<Page<WriteWarning>> page(@RequestBody WriteWarningPageParam pageParam) {
        return CommonResult.data(warningService.page(pageParam));
    }
}
