package cn.newfeifan.mall.module.distri.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SocialStatusEnum {

    REGISTER_SOCIAL(1,"本人注册用户"),
    REGISTER_ANCESTOR_SOCIAL(2,"成功推荐新用户注册"),
    SIGN_IN_SOCIAL(3,"签到获取的基础身价值"),
    FAVORITE_SOCIAL(4,"收藏一个商品获取的身价值"),
    SHOPPING_SOCIAL(5,"购物自得身价值"),
    SHOPPING_ANCESTOR_SOCIAL(6,"直推人购物，推荐人获得身价");

    /**
     * 类型
     */
    private final Integer status;
    /**
     * 类型的名字
     */
    private final String name;

    public static SocialStatusEnum getSocialStatusEnumByCode(int status) {
        for (SocialStatusEnum socialStatusEnum : SocialStatusEnum.values()) {
            if (socialStatusEnum.getStatus() == status) {
                return socialStatusEnum;
            }
        }
        return null;
    }
}
