package com.alibaba.csp.sentinel.dashboard.rule.nacos.processor;

import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient;
import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo;
import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement;
import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Set;

/**
 * @author Clay
 * @date 2022/11/14
 */
public class BaseProcessor {

    @Autowired
    protected AppManagement appManagement;

    @Autowired
    protected SentinelApiClient sentinelApiClient;


    public Set<MachineInfo> getAppInfo(String app){
        AppInfo detailApp = appManagement.getDetailApp(app);
        return detailApp.getMachines();
    }
}
