package com.goafanti.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum UserCareerFields {
	
	UID("uid", "用户id"),
	ENGAGEDFIELD("engagedField", "从事领域"),
	WORKINGAGE("workingAge", "从业工龄"),
	PROFESSIONALTITLE("professionalTitle", "职称名字"),
	PROFESSIONALTITLEGETTIME("professionalTitleGettime", "职称取得时间(年份)"),
	PROFESSIONALCERTIFICATEURL("professionalCertificateUrl", "职称证明图URL"),
	QUALIFICATION("qualification", "执业资格"),
	QUALIFICATIONGETTIME("qualificationGettime", "执业资格取得时间(年份)"),
	QUALIFICATIONCERTIFICATEURL("qualificationCertificateUrl", "执业资格证明图URL"),
	WORKUNIT("workUnit", "工作单位"),
	POSITION("position", "职位/职务/头衔"),
	EXPERIENCES("experiences", "从业经历"),
	ACHIEVEMENT("achievement", "主要成就"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, UserCareerFields> status = new HashMap<String, UserCareerFields>();
	
	private UserCareerFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (UserCareerFields value : UserCareerFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static UserCareerFields getField(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return OTHER;
	}
	
	public static String getFieldDesc(String code) {
		return getField(code).getDesc();
	}

	public static boolean containsType(String code) {
		return status.containsKey(code);
	}
	
	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}


}
