feat: 添加基建配置文件设置接口

This commit is contained in:
DLmaster361
2025-08-17 15:54:54 +08:00
parent 8e2c6bb642
commit 515367f61f
6 changed files with 52 additions and 7 deletions

View File

@@ -205,3 +205,20 @@ async def reorder_user(user: UserReorderIn = Body(...)) -> OutBase:
code=500, status="error", message=f"{type(e).__name__}: {str(e)}"
)
return OutBase()
@router.post(
"/user/infrastructure",
summary="导入基建配置文件",
response_model=OutBase,
status_code=200,
)
async def import_infrastructure(user: UserSetIn = Body(...)) -> OutBase:
try:
await Config.set_infrastructure(user.scriptId, user.userId, user.jsonFile)
except Exception as e:
return OutBase(
code=500, status="error", message=f"{type(e).__name__}: {str(e)}"
)
return OutBase()