package com.fzm.mall.server.admin.message.enums.type;

import com.fzm.mall.server.admin.goods_center.enums.type.ReturnGoodsTypeEnum;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author wangp
 * @date 2021/5/6 17:40
 * @description 短信发送类别
 * @since JDK 1.8
 */
public enum SendTypeEnum {
    SEND_NOW(1),//立即发送
    SEND_TIMING(2);//定时发送

    private Integer type;

    SendTypeEnum(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public static List<Integer> getValueList() {
        return Arrays.stream(SendTypeEnum.values())
                .map(SendTypeEnum::getType)
                .collect(Collectors.toList());
    }

    public static SendTypeEnum getByType(Integer type) {
        for (SendTypeEnum v : values()) {
            if (v.type.equals(type)) {
                return v;
            }
        }
        return null;
    }
}
