package com.qs.mp.common.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import io.swagger.annotations.ApiModel;

/**
 * 小程序来源枚举
 * @author Cup
 * @date 2022/7/11
 */
@ApiModel("小程序来源枚举")
public enum AppSourceEnum implements IEnum<Integer> {

    /**
     * 盲票AppId
     */
    MP(1,"wx8533800e393dbd6b", "f7a104e09d6c2e55445be2a45c4ab551"),
    /**
     * 马上兑券AppId
     */
    MSDQ(2,"wxffb4598e70b9f871", "1c7ba0eed8c0287b8800b089e3c9d102"),

    /**
     * 支付宝盲票AppID
     */
    ALI_MP(3, "2021003127607930", null),

    /**
     * 票赢填写AppID
     */
    CHANNEL(4, "wxc3a684f1196f6e15", "7708655ba65f04de2a42f23d20ab4134");

    private Integer value;

    private String appId;

    private String appSecret;


    AppSourceEnum(Integer value, String appId, String appSecret) {
        this.value = value;
        this.appId = appId;
        this.appSecret = appSecret;
    }

    public static AppSourceEnum getByValue(Integer value){
        for (AppSourceEnum appSourceEnum : AppSourceEnum.values()) {
            if (appSourceEnum.getValue().equals(value)) {
                return appSourceEnum;
            }
        }
        return AppSourceEnum.MP;
    }

    public String getAppSecret() {
        return appSecret;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public String getAppId() {
        return appId;
    }

    @Override
    public String toString() {
        return "AppSourceEnum{" +
            "value='" + value + '\'' +
            ", appId='" + appId + '\'' +
            '}';
    }
}
