package com.ningdatech.pmapi.meta.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liuxinxin
 * @date 2022/7/22 上午11:13
 */
@AllArgsConstructor
@Getter
public enum ExpertTagEnum {

    //    专家来源
    EXPERT_SOURCE("expert_source"),
    // 擅长方向
    GOOD_AT("good_at"),
    // 技术专长
    TECHNICAL_EXPERTISE("technical_expertise"),
    // 行业领域
    INDUSTRY_SECTOR("industry_sector"),
    // 其他
    OTHER("other");

    private final String key;

    public static List<String> getAll() {
        List<String> tagList = new ArrayList<>();
        ExpertTagEnum[] values = ExpertTagEnum.values();
        for (ExpertTagEnum fieldEnum : values) {
            tagList.add(fieldEnum.key);
        }
        return tagList;
    }

    public static boolean contains(String key) {
        if (StringUtils.isBlank(key)) {
            return false;
        }
        for (ExpertTagEnum fieldEnum : ExpertTagEnum.values()) {
            if (fieldEnum.key.equals(key)) {
                return true;
            }
        }
        return false;
    }
}
