package com.yuchen.saas.manage.system.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 申请方式:0申请,1邀请,2自动生成
 * @author CXJ
 */
@Getter
@AllArgsConstructor
public enum ApplyTypeEnum {


	TO_APPLY(0, "申请"),
	INVITE(1, "邀请"),
	AUTO(2, "自动生成"),
	;

	final Integer code;
	final String name;

	public static ApplyTypeEnum of(String name) {
		if (name == null) {
			return null;
		}
		ApplyTypeEnum[] values = ApplyTypeEnum.values();
		for (ApplyTypeEnum smsEnum : values) {
			if (smsEnum.name.equals(name)) {
				return smsEnum;
			}
		}
		return null;
	}

}
