package com.qunzhixinxi.hnqz.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *  结算渠道
 */
@Getter
@AllArgsConstructor
public enum SubjectTypeEnum {

	TYPE_RENLIJIA("0", "人力家"),
	TYPE_SHUIBANGYUN("1", "税邦云"),

	ENABLE_FLAG_FALSE("0", "无效"),
	ENABLE_FLAG_TRUE("1", "有效"),

	TYPE_NULL("", "")
	;

	/**
	 * 类型
	 */
	private String code;

	/**
	 * 描述
	 */
	private String desc;

	public static SubjectTypeEnum resolve(String code) {
		for (SubjectTypeEnum subjectTypeEnum: SubjectTypeEnum.values()){
			if (subjectTypeEnum.code.equals(code) && subjectTypeEnum.name().startsWith("TYPE_")){
				return subjectTypeEnum;
			}
		}
		return TYPE_NULL;
	}

}
