package top.baogutang.strategy.alerts;

import top.baogutang.strategy.models.PositionPlan;
import top.baogutang.strategy.models.Signal;

import java.util.List;

public class CompositeAlertChannel implements AlertChannel {
    private final List<AlertChannel> list;

    public CompositeAlertChannel(List<AlertChannel> list) {
        this.list = list;
    }

    public void send(Signal s, PositionPlan plan) {
        for (AlertChannel c : list) {
            try {
                c.send(s, plan);
            } catch (Exception ignored) {
            }
        }
    }
}
