All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qingxun.javasdkapi.common.ApiCode Maven / Gradle / Ivy

Go to download

openapi SDK for Java Copyright © 2023 杭州轻寻科技 All rights reserved. 版权所有 (C)杭州轻寻科技 http://open.qingxun.com

The newest version!
package com.qingxun.javasdkapi.common;


public enum ApiCode {
    /**
     * 100	请求成功
     * 101	没有访问权限
     * 102	业务停机
     * 103	账户不存在
     * 104	账户异常
     * 105	系统错误
     * 106	参数异常
     * 107	黑名单管控
     * 108	访问地址频率过高
     * 109	该应用不存在
     * 110	该应用尚未启用
     * 111	无该功能权限
     */
    OK(100, "请求成功"),
    OK2(0, "请求成功"),
    NO_ACCESS(101, "没有访问权限"),
    BUSINESS_DOWN(102, "业务停机"),
    NO_ACCOUNT(103, "账户不存在"),
    ACCOUNT_ERROR(104, "账户异常"),
    SYSTEM_ERROR(105, "系统错误"),
    PARAMETER_ERROR(106, "参数异常"),
    BLACKLIST_CONTROL(107, "黑名单管控"),
    CURRENT_LIMITING(108, "访问地址频率过高"),
    NO_APPLICATION(109, "该应用不存在"),
    NOT_ENABLED_APPLICATION(110, "该应用尚未启用"),
    NO_PERMISSION_FOR_FEATURE(111, "无该功能权限"),
    API_EXCEPTION(-1, "接口异常"),
    PARAMETERISNULL(300, "参数为空"),
    DOCISNULL(301, "文件为空"),
    DOCTYPENOTSUPPORT(302, "文件类型不支持"),
    MD5NOTMATCH(303, "文件MD5不匹配"),
    ACCOUNT_NOT_ENOUGH(304, "可用积分不足"),
    DOC_ENCRYPTION(305, "文档已加密或被保护"),
    DOC_UNRECOGNIZE(306, "文档不能识别"),
    DOC_THE_DAMAGE(307, "文档损坏"),
    DOC_READ_FAIL(309, "文档无法成功读取或读取超时,请将文件转换成其他版本的word或pdf后再次尝试"),
    DOC_MANUAL_HANDLING(310, "自动处理超时,等待人工处理"),
    EXCEEDS_THE_LIMIT(311, "文件大小超过限制(50M)"),
    TRANSLATE_NOT_EXISTS(312, "该翻译不存在"),
    TRANSLATING(313, "进行中"),
    TRANSLATE_COMPLETED(314, "翻译完成"),
    PASSING(315, "正在传递"),
    TIMEOUT(316, "处理超时"),
    CANCEL(317, "已取消"),
    DOC_NOT_EXISTS(318, "该文件不存在"),
    TRANSLATION_CHANNEL_OCCUPIED(320, "翻译通道已被占用(不能上传进行翻译,需等待正在翻译的文件翻译结束)"),
    NOT_READ_NEED(321, "没有读取到需要翻译的内容"),
    IMAGE_SIZE_TO_LARGE(322, "图片文件大小超过限制(20M)"),
    PIXEL_LIMIT_EXCEEDED(323, "图片文件像素超过限制(1000万)"),
    PARSING_FAILED(324, "图片文件解析失败"),
    MANUAL_HANDLING(325, "正在人工处理"),
    REPEAT_TRANS(326, "重复翻译"),
    DOC_PAGECOUNT_EXCEEDED(327, "文档页数超限"),
    GENERATION_IMAGE_FAIL(328, "图片生成失败"),
    DOC_ABNORMAL(329, "该文档状态异常"),
    DETECTE_PAGE_COMPELETE(330, "检测页数完成"),
    ;

    private int code;

    private String message;

    ApiCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static ApiCode getByCode(Integer code) {
        if (code == null) {
            return API_EXCEPTION;
        }
        for (ApiCode apiCode : ApiCode.values()) {
            if (apiCode.getCode() == code) {
                return apiCode;
            }
        }
        return API_EXCEPTION;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy