package com.ruoyi.rocketmq.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.RmAlarmRuleTemplate;
import com.ruoyi.rocketmq.service.IRmAlarmRuleTemplateService;
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;

import java.util.List;

/**
 * 告警规则模板Controller
 * 
 * @author gyt
 * @date 2025-09-12
 */
@RestController
@RequestMapping("/alarmTemplate")
public class RmAlarmRuleTemplateController extends BaseController
{
    @Autowired
    private IRmAlarmRuleTemplateService rmAlarmRuleTemplateService;

    /**
     * 查询告警规则模板列表
     */
    @RequiresPermissions("rocketmq:template:list")
    @PostMapping("/list")
    public AjaxResult list(@RequestBody RmAlarmRuleTemplate rmAlarmRuleTemplate)
    {
        List<RmAlarmRuleTemplate> list = rmAlarmRuleTemplateService.selectRmAlarmRuleTemplateList(rmAlarmRuleTemplate);
        return success(list);
    }
}
