
package com.tmerclub.cloud.systemtest.util;

import com.moyuer.cloud.systemtest.constants.Constant;

/**
 * url枚举
 * @author yxf
 */
public enum UrlEnum {

    /**
     * 用户端
     */
    API(1, Constant.API_TOKEN),
    API_OTHER(2, Constant.OTHER_API_TOKEN),
    /**
     * 门店端
     */
    STATION(3, Constant.STATION_TOKEN),

    /**
     * 商家端
     */
    SHOP(4, Constant.SHOP_TOKEN),
    SHOP_OTHER(5, Constant.OTHER_SHOP_TOKEN),

    /**
     * 平台端
     */
    PLATFORM(6, Constant.PLATFORM_TOKEN),
    /**
     *  供应商
     * */
    SUPPLIER(7, Constant.SUPPLIER_TOKEN),
    SUPPLIER_OTHER(8, Constant.OTHER_SUPPLIER_TOKEN)
    ;
    private final Integer value;

    private final String token;

    public Integer value() {
        return value;
    }

    public String token() {
        return token;
    }

    UrlEnum(Integer value, String token) {
        this.value = value;
        this.token = token;
    }

    public static UrlEnum instance(Integer value) {
        UrlEnum[] enums = values();
        for (UrlEnum statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

}
