package cn.axzo.msg.center.inside.notices.config.push;

import cn.axzo.msg.center.common.enums.SystemTypeEnum;
import cn.axzo.msg.center.nimpush.PushChannel;
import com.google.common.collect.Sets;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;

/**
 * @author yanglin
 */
@Setter
@Getter
public class PushChannelConfig {
    private Set<PushChannel> pushChannels = Sets.newHashSet(
            PushChannel.NIM, PushChannel.YOU_MENG);
    private Set<PushChannel> ambiguityPushChannels = pushChannels;

    private PushDeviceVersion androidNimPush = new PushDeviceVersion();
    private PushDeviceVersion iosNimPush = new PushDeviceVersion();

    {
        androidNimPush.setWorkerAppVersion(470);
        androidNimPush.setManagerAppVersion(492);
        iosNimPush.setWorkerAppVersion(3369);
        iosNimPush.setManagerAppVersion(1837);
    }

    public PushDeviceVersion getNimPushVersion(SystemTypeEnum systemType) {
        if (systemType == SystemTypeEnum.IOS)
            return iosNimPush;
        if (systemType == SystemTypeEnum.ANDROID)
            return androidNimPush;
        return null;
    }

}