Skip to content

Commit e86dfab

Browse files
committed
移动返回类到根目录
1 parent 41aa5d6 commit e86dfab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any
2-
2+
from fastapi import HTTPException
33
from pydantic import BaseModel
44

55

@@ -11,3 +11,7 @@ class BaseRes(BaseModel):
1111

1212
key_error = BaseRes(status=400, msg="主键错误")
1313
not_found_instance = BaseRes(status=404, msg="找不到对象")
14+
not_found_model = HTTPException(
15+
status_code=200,
16+
detail=BaseRes(msg="找不到对象").dict()
17+
)

0 commit comments

Comments
 (0)