package com.cool.store.enums;

/**
 * 加盟商类型" +
 *                 "0-新加盟商开单店;1-老加盟商开单店;" +
 *                 "2-新加盟商开新区域单店;" +
 *                 "3-新加盟商开老区域单店;" +
 *                 "4-老加盟商开新区域单店;" +
 *                 "5-老加盟商开老区域单店;" +
 *                 "6-直营门店;" +
 *                 "7-同异业转化;" +
 *                 "8-老加盟商迁址开新店
 */
public enum FranchiseeTypeEnum {
    ONE(0,"新加盟商开单店"),
    TWO(1,"老加盟商开单店"),
    THREE(2,"新加盟商开新区域单店"),
    FOUR(4,"新加盟商开老区域单店"),
    FIVE(5,"老加盟商开老区域单店"),
    SIX(6,"直营门店"),
    SEVEN(7,"同异业转化"),
    EIGHT(8,"老加盟商迁址开新店"),
    ;

    private Integer code;

    private String message;

    FranchiseeTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static FranchiseeTypeEnum getByCode(Integer code) {
        for (FranchiseeTypeEnum franchiseeTypeEnum : FranchiseeTypeEnum.values()) {
            if (franchiseeTypeEnum.getCode().equals(code)) {
                return franchiseeTypeEnum;
            }
        }
        return null;
    }
}
