package com.jiayue.ipfcst.common.data.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 假期类型
 *
 * @author zzy
 * @version 1.0
 * @since 2019/8/7 15:31
 */
@Getter
@AllArgsConstructor
public enum HolidayTypeEnum {
	E1(1, "假期"),
	E2(2, "特殊工作日");
	private Integer code;
	private String message;

	/**
	 * 根据code获取去value
	 *
	 * @param code
	 * @return
	 */
	public static HolidayTypeEnum getEnumByCode(int code) {
		for (HolidayTypeEnum platformFree : HolidayTypeEnum.values()) {
			if (code == platformFree.getCode()) {
				return platformFree;
			}
		}
		return null;
	}

}
