ResumeSdk.java 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
package cn.timer.api.dto.resumesdk.enumresume;

import lombok.Getter;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.springframework.util.StringUtils;

/**
 * @author wuqingjun
 * @email 284718418@qq.com
 * @date 2022/4/24
 */
public interface ResumeSdk {
    /**
     * 200	正常状态,表示解析成功
     * 250	账号(uid)或密码(pwd)错误
     * 251	账号剩余用量为0(需及时充值)
     * 260	请求参数错误
     * 261	简历内容为空
     * 262	简历内容过长
     * 263	不支持的简历文件格式
     * 264	base64解码出错
     * 265	图片文件过大,或者长宽大小超过限制
     * 266	输入参数file_name缺少文件后缀名(请带上正确的文件后缀,如果是纯文本则为.txt)
     * 267	输入的json结构体有误(即解码失败)
     * 240	简历解析内部错误
     * 280	人岗匹配内部错误
     */
    @Getter
    enum StatusCodeEnum implements ResumeSdk {
        SUCCESSS(200, "解析成功"),
        ERROR250(250, "账号(uid)或密码(pwd)错误"),
        ERROR251(251, "账号剩余用量为0(需及时充值)"),
        ERROR260(260, "请求参数错误"),
        ERROR261(261, "简历内容为空"),
        ERROR262(262, "简历内容过长"),
        ERROR263(263, "不支持的简历文件格式"),
        ERROR264(264, "base64解码出错"),
        ERROR265(265, "图片文件过大,或者长宽大小超过限制"),
        ERROR266(266, "输入参数file_name缺少文件后缀名(请带上正确的文件后缀,如果是纯文本则为.txt)"),
        ERROR267(267, "输入的json结构体有误(即解码失败)"),
        ERROR240(240, "简历解析内部错误"),
        ERROR280(280, "人岗匹配内部错误");

        private Integer type;

        private String name;

        StatusCodeEnum(Integer type, String name) {
            this.type = type;
            this.name = name;
        }
        public static String getName(Integer type){
            if(type < 0){
                return "";
            }
            for(StatusCodeEnum.StatusCodeEnum statusCodeEnum : StatusCodeEnum.StatusCodeEnum.values()){
                if(statusCodeEnum.getType() == type){
                    return statusCodeEnum.name;
                }
            }
            return "";
        }

    }
}