package com.CUST.brain.common.enums;

import lombok.Getter;

/**
 * 职称枚举
 */
@Getter
public enum TitleEnum {
    
    /**
     * 教授
     */
    PROFESSOR("PROFESSOR", "教授", "1", 1),
    
    /**
     * 副教授
     */
    ASSOCIATE_PROFESSOR("ASSOCIATE_PROFESSOR", "副教授", "2", 2),
    
    /**
     * 讲师
     */
    LECTURER("LECTURER", "讲师", "3", 3),
    
    /**
     * 助教
     */
    ASSISTANT("ASSISTANT", "助教", "4", 4),
    
    /**
     * 研究员
     */
    RESEARCHER("RESEARCHER", "研究员", "5", 5),
    
    /**
     * 副研究员
     */
    ASSOCIATE_RESEARCHER("ASSOCIATE_RESEARCHER", "副研究员", "6", 6),
    
    /**
     * 助理研究员
     */
    ASSISTANT_RESEARCHER("ASSISTANT_RESEARCHER", "助理研究员", "7", 7),
    
    /**
     * 其他
     */
    OTHER("OTHER", "其他", "8", 8);

    private final String code;
    private final String name;
    private final String value;
    private final Integer sort;

    TitleEnum(String code, String name, String value, Integer sort) {
        this.code = code;
        this.name = name;
        this.value = value;
        this.sort = sort;
    }

    public static TitleEnum getByCode(String code) {
        for (TitleEnum title : values()) {
            if (title.getCode().equals(code)) {
                return title;
            }
        }
        return null;
    }

    public static TitleEnum getByValue(String value) {
        for (TitleEnum title : values()) {
            if (title.getValue().equals(value)) {
                return title;
            }
        }
        return null;
    }
} 