package com.inkasso.factoring.system.user.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
public enum CodeBusinessTypeEnum {

  PHONE_BIND("phoneBind","手机绑定"),

  PASSWORD_EDIT("passwordEdit","密码修改"),

  EMAIL_BIND("emailBind","邮箱绑定"),

  PASSWORD_RESET("passwordReset","密码重置"),

  OTHER("other","其他");

  private String code;

  private String desc;

  CodeBusinessTypeEnum(String code,String desc){
    this.code = code;
    this.desc = desc;
  }

  public static CodeBusinessTypeEnum getByCode(String code){
    if(StringUtils.isEmpty(code)){
      return null;
    }
    for(CodeBusinessTypeEnum e:values()){
      if(e.getCode().equals(code)){
        return e;
      }
    }
    return null;
  }

}
