package com.tongran.rocketmq.controller;

import com.tongran.common.core.web.controller.BaseController;
import com.tongran.common.core.web.domain.AjaxResult;
import com.tongran.common.security.annotation.RequiresPermissions;
import com.tongran.rocketmq.domain.RmAlarmRuleTemplate;
import com.tongran.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 tongran
 * @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);
    }
}
