package com.usky.alarm.controller.web;


import com.aliyuncs.exceptions.ClientException;
import com.usky.alarm.domain.BaseAlarm;
import com.usky.alarm.service.BaseAlarmService;
import com.usky.common.core.bean.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * <p>
 * 统一告警表 前端控制器
 * </p>
 *
 * @author han
 * @since 2023-09-22
 */
@RestController
@RequestMapping("/baseAlarm")
public class BaseAlarmController {

    @Autowired
    private BaseAlarmService baseAlarmService;

    /**
     * 新增
     * @param baseAlarm
     * @return
     */
    @PostMapping("/alarmInfo")
    public ApiResult<Void> add(@RequestBody BaseAlarm baseAlarm) throws ClientException {
        baseAlarmService.add(baseAlarm);
        return ApiResult.success();
    }
}

