2026-01-12 17:16:33 +08:00
|
|
|
from enum import unique, Enum
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@unique
|
|
|
|
|
class RequestMethod(Enum):
|
|
|
|
|
GET = 1
|
|
|
|
|
POST = 2
|
|
|
|
|
PUT = 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@unique
|
|
|
|
|
class ResponseCode(Enum):
|
|
|
|
|
def __init__(self, code: int, message: str) -> None:
|
|
|
|
|
self.code: int = code
|
|
|
|
|
self.message: str = message
|
|
|
|
|
|
|
|
|
|
RESPONSE_100_CONTINUE = 100, "Continue"
|
|
|
|
|
RESPONSE_101_NOT_BUILD_MSG = 101, "Not Build Message"
|
|
|
|
|
RESPONSE_102_PARAM_ERROR = 102, "参数错误"
|
2026-01-12 20:11:49 +08:00
|
|
|
RESPONSE_103_MODEL_ERROR = 103, "不允许使用的模型"
|
2026-01-12 17:16:33 +08:00
|
|
|
RESPONSE_200_SUCCESS = 200, "Success"
|
|
|
|
|
RESPONSE_405_METHODS_NOT_ALLOWED = 405, "Method Not Allowed"
|
|
|
|
|
RESPONSE_500_SERVER_Exception = 500, "服务器逻辑处理异常"
|
|
|
|
|
RESPONSE_501_1_API_EXCEPTION = 501.1, "腾讯云API调用异常" # API调用异常
|
2026-01-12 20:11:49 +08:00
|
|
|
RESPONSE_501_2_API_EXCEPTION = 501.2, "百度云API调用异常" # API调用异常
|
2026-01-13 00:48:35 +08:00
|
|
|
RESPONSE_501_3_API_EXCEPTION = 501.3, "小牛翻译API调用异常" # API调用异常
|