Newer
Older
newfiber-termite / newfiber-system / newfiber-system-sms / src / main / java / com / newfiber / system / enums / SmsEnum.java
@yanghui yanghui on 11 May 748 bytes 白蚁项目初版代码提交
package com.newfiber.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Sms枚举类
 *
 * @author Chill
 */
@Getter
@AllArgsConstructor
public enum SmsEnum {

	/**
	 * qiniu
	 */
	QINIU("qiniu", "七牛"),

	/**
	 * ali
	 */
	ALI("aliyun", "阿里云"),

	/**
	 * tencent
	 */
	TENCENT("tencent", "腾讯"),
	;

	/**
	 * 类型
	 */
	final String code;

	/**
	 * 名称
	 */
	final String name;

	/**
	 * 匹配枚举值
	 *
	 * @param name 名称
	 * @return OssEnum
	 */
	public static SmsEnum match(String name) {
		if (name == null) {
			return null;
		}
		SmsEnum[] values = SmsEnum.values();
		for (SmsEnum smsEnum : values) {
			if (smsEnum.name.equals(name)) {
				return smsEnum;
			}
		}
		return null;
	}

}