package com.casic.missiles.modular.alarm.controller;

import com.casic.missiles.core.base.controller.BaseController;
import com.casic.missiles.modular.alarm.service.IAlarmContentTypeService;
import com.casic.missiles.modular.system.model.AlarmContentType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Controller
@RequestMapping("/alarmContent")
public class AlarmTypeConfigController extends BaseController {
    @Autowired
    private IAlarmContentTypeService alarmContentTypeService;

    @RequestMapping(value = "/list")
    @ResponseBody
    public Object selectListPage(String alarmType, String deviceType, String alarmContent) {
        return alarmContentTypeService.selectListPage(alarmType, deviceType, alarmContent);
    }

    @RequestMapping(value = "/delete/{id}")
    @ResponseBody
    public Object delete(@PathVariable(name = "id") Long Id) {
        return alarmContentTypeService.deleteById(Id);

    }

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public Object add(@RequestBody AlarmContentType alarmContentType) {
        return alarmContentTypeService.add(alarmContentType);

    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
    public Object update(@RequestBody AlarmContentType alarmContentType) {
        return alarmContentTypeService.update(alarmContentType);
    }

}
