package com.red.circle.other.inner.enums.sys;

import com.red.circle.tool.core.text.StringPool;
import java.util.Objects;

/**
 * 用户奖励类型枚举
 *
 * @author pengshigang on 2021/06/01
 */
public enum SysCurrencySendReasonEnum {

  APP(0, "APP"),
  REWARD(1, "奖励"),
  INTERNAL(2, "内部"),
  WAGE(3, "工资"),
  OTHER(4, "其他"),
  LOTTERY(5, "抽奖"),
  ;

  private final Integer type;
  private final String typeName;

  SysCurrencySendReasonEnum(Integer type, String typeName) {
    this.type = type;
    this.typeName = typeName;
  }

  public Integer getType() {
    return type;
  }

  public String getTypeName() {
    return typeName;
  }

  public static String getReasonDesc(Integer type) {
    for (SysCurrencySendReasonEnum rewardType : SysCurrencySendReasonEnum.values()) {
      if (Objects.equals(rewardType.getType(), type)) {
        return rewardType.getTypeName();
      }
    }
    return StringPool.EMPTY;
  }

}
