package com.gic.haoban.manage.api.enums;

/**
 * Created by hua on 2020/6/24.
 */
public enum ChannelCodeEnum {
    /**
     * 好办绑定 解绑类型
     */
    ADMIN_BIND(1001,"后台管理员绑定"),
    SELF_BIND(1002,"好办小程序绑定"),
    AUDIT_BIND(1003,"后台审核绑定"),
    SYNC_BIND(1004,"GIC同步绑定"),

    ADMIN_UNBIND(2001,"后台管理员解绑"),
    SELF_UNBIND(2002,"好办小程序解绑"),
    SYNC_UNBIND(2003,"门店同步解绑"),
    WEIXIN_DEL(2004,"员工离职解绑"),
    AUDIT_UNBIND(2005,"后台审核解绑"),
    RIGHT_CHANGE_UNBIND(2006, "好办门店权限变更解绑"),
    STORE_CHANGE_UNBIND(2007, "导购变更门店解绑"),
    GIC_CLERK_DEL_UNBIND(2008, "导购删除解绑"),
    QW_DEL_UNBIND(2009, "企微通讯录成员删除解绑"),

    ;
    private int code;
    private String name;

    ChannelCodeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getNameByCode(int code) {
        ChannelCodeEnum[] values = ChannelCodeEnum.values();
        for (ChannelCodeEnum channelCodeEnum : values) {
            if (channelCodeEnum.getCode() == code) {
                return channelCodeEnum.getName();
            }
        }
        return null;
    }
}
