feat: 添加掉落物的url查询API
This commit is contained in:
@@ -186,6 +186,21 @@ async def get_web_config() -> InfoOut:
|
||||
return InfoOut(data={"WebConfig": data})
|
||||
|
||||
|
||||
@router.post(
|
||||
"/get/materials", summary="获取材料URL", response_model=InfoOut, status_code=200
|
||||
)
|
||||
async def get_materials(
|
||||
materials: GetMaterialsIn = Body(..., description="材料ID")
|
||||
) -> InfoOut:
|
||||
try:
|
||||
data = await Config.get_materials(materials.dropId)
|
||||
except Exception as e:
|
||||
return InfoOut(
|
||||
code=500, status="error", message=f"{type(e).__name__}: {str(e)}", data={}
|
||||
)
|
||||
return InfoOut(data={"FileUrl": data})
|
||||
|
||||
|
||||
@router.post(
|
||||
"/get/overview", summary="信息总览", response_model=InfoOut, status_code=200
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user