package cn.iocoder.yudao.module.system.controller.app.devicewarn;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.controller.admin.devicewarn.vo.DeviceWarnSaveReqVO;
import cn.iocoder.yudao.module.system.service.devicewarn.DeviceWarnService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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 javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 设备报警")
@RestController
@RequestMapping("/system/device-warn")
@Validated
public class AppDeviceWarnController {

    @Resource
    private DeviceWarnService deviceWarnService;

    @PostMapping("/create")
    @Operation(summary = "创建设备报警")
    public CommonResult<Long> createDeviceWarn(@Valid @RequestBody DeviceWarnSaveReqVO createReqVO) {
        return success(deviceWarnService.createDeviceWarn(createReqVO));
    }



}