diff --git a/app/api/info.py b/app/api/info.py index e7194ac..f8aa381 100644 --- a/app/api/info.py +++ b/app/api/info.py @@ -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 ) diff --git a/app/core/config.py b/app/core/config.py index 4930b66..00a93a0 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -30,9 +30,10 @@ import requests import truststore from pathlib import Path from fastapi import WebSocket +from urllib.parse import quote from collections import defaultdict from datetime import datetime, timedelta, date, timezone -from typing import Literal, Optional, Tuple +from typing import Literal, Optional from app.models.ConfigBase import * from app.utils.constants import * @@ -1741,6 +1742,12 @@ class AppConfig(GlobalConfig): return stage_data + async def get_materials(self, dropId): + """获取材料URL""" + if dropId not in MATERIALS_MAP: + raise ValueError(f"未知的材料ID: {dropId}") + return f"file:///{quote((Path.cwd() / f"res/images/materials/{dropId}.png").as_posix())}" + async def get_script_combox(self): """获取脚本下拉框信息""" diff --git a/app/models/schema.py b/app/models/schema.py index 210c9f7..0b9af74 100644 --- a/app/models/schema.py +++ b/app/models/schema.py @@ -67,6 +67,10 @@ class GetStageIn(BaseModel): ) +class GetMaterialsIn(BaseModel): + dropId: str = Field(..., description="材料ID") + + class GlobalConfig_Function(BaseModel): HistoryRetentionTime: Optional[Literal[7, 15, 30, 60, 90, 180, 365, 0]] = Field( None, description="历史记录保留时间, 0表示永久保存" diff --git a/app/utils/constants.py b/app/utils/constants.py index bc214bd..c4f9fa1 100644 --- a/app/utils/constants.py +++ b/app/utils/constants.py @@ -206,5 +206,9 @@ MATERIALS_MAP = { "3261": "医疗芯片", "3271": "辅助芯片", "3281": "特种芯片", + "PR-A": "医疗/重装芯片", + "PR-B": "术师/狙击芯片", + "PR-C": "先锋/辅助芯片", + "PR-D": "近卫/特种芯片", } """掉落物索引表""" diff --git a/res/images/materials/2001.png b/res/images/materials/2001.png new file mode 100644 index 0000000..7211599 Binary files /dev/null and b/res/images/materials/2001.png differ diff --git a/res/images/materials/2002.png b/res/images/materials/2002.png new file mode 100644 index 0000000..9a682dd Binary files /dev/null and b/res/images/materials/2002.png differ diff --git a/res/images/materials/2003.png b/res/images/materials/2003.png new file mode 100644 index 0000000..dce123c Binary files /dev/null and b/res/images/materials/2003.png differ diff --git a/res/images/materials/2004.png b/res/images/materials/2004.png new file mode 100644 index 0000000..c9a09bc Binary files /dev/null and b/res/images/materials/2004.png differ diff --git a/res/images/materials/30011.png b/res/images/materials/30011.png new file mode 100644 index 0000000..196997d Binary files /dev/null and b/res/images/materials/30011.png differ diff --git a/res/images/materials/30012.png b/res/images/materials/30012.png new file mode 100644 index 0000000..667f1c7 Binary files /dev/null and b/res/images/materials/30012.png differ diff --git a/res/images/materials/30013.png b/res/images/materials/30013.png new file mode 100644 index 0000000..c203fc9 Binary files /dev/null and b/res/images/materials/30013.png differ diff --git a/res/images/materials/30014.png b/res/images/materials/30014.png new file mode 100644 index 0000000..dcbef60 Binary files /dev/null and b/res/images/materials/30014.png differ diff --git a/res/images/materials/30021.png b/res/images/materials/30021.png new file mode 100644 index 0000000..9dd787e Binary files /dev/null and b/res/images/materials/30021.png differ diff --git a/res/images/materials/30022.png b/res/images/materials/30022.png new file mode 100644 index 0000000..be43280 Binary files /dev/null and b/res/images/materials/30022.png differ diff --git a/res/images/materials/30023.png b/res/images/materials/30023.png new file mode 100644 index 0000000..387992a Binary files /dev/null and b/res/images/materials/30023.png differ diff --git a/res/images/materials/30024.png b/res/images/materials/30024.png new file mode 100644 index 0000000..17fae0a Binary files /dev/null and b/res/images/materials/30024.png differ diff --git a/res/images/materials/30031.png b/res/images/materials/30031.png new file mode 100644 index 0000000..29eb94a Binary files /dev/null and b/res/images/materials/30031.png differ diff --git a/res/images/materials/30032.png b/res/images/materials/30032.png new file mode 100644 index 0000000..79d866b Binary files /dev/null and b/res/images/materials/30032.png differ diff --git a/res/images/materials/30033.png b/res/images/materials/30033.png new file mode 100644 index 0000000..3599d8d Binary files /dev/null and b/res/images/materials/30033.png differ diff --git a/res/images/materials/30034.png b/res/images/materials/30034.png new file mode 100644 index 0000000..5ccafb2 Binary files /dev/null and b/res/images/materials/30034.png differ diff --git a/res/images/materials/30041.png b/res/images/materials/30041.png new file mode 100644 index 0000000..12639b0 Binary files /dev/null and b/res/images/materials/30041.png differ diff --git a/res/images/materials/30042.png b/res/images/materials/30042.png new file mode 100644 index 0000000..d28be03 Binary files /dev/null and b/res/images/materials/30042.png differ diff --git a/res/images/materials/30043.png b/res/images/materials/30043.png new file mode 100644 index 0000000..e4ba4cc Binary files /dev/null and b/res/images/materials/30043.png differ diff --git a/res/images/materials/30044.png b/res/images/materials/30044.png new file mode 100644 index 0000000..aa06c52 Binary files /dev/null and b/res/images/materials/30044.png differ diff --git a/res/images/materials/30051.png b/res/images/materials/30051.png new file mode 100644 index 0000000..79b2d96 Binary files /dev/null and b/res/images/materials/30051.png differ diff --git a/res/images/materials/30052.png b/res/images/materials/30052.png new file mode 100644 index 0000000..3f26b14 Binary files /dev/null and b/res/images/materials/30052.png differ diff --git a/res/images/materials/30053.png b/res/images/materials/30053.png new file mode 100644 index 0000000..62026f8 Binary files /dev/null and b/res/images/materials/30053.png differ diff --git a/res/images/materials/30054.png b/res/images/materials/30054.png new file mode 100644 index 0000000..05acc92 Binary files /dev/null and b/res/images/materials/30054.png differ diff --git a/res/images/materials/30061.png b/res/images/materials/30061.png new file mode 100644 index 0000000..f1b58ce Binary files /dev/null and b/res/images/materials/30061.png differ diff --git a/res/images/materials/30062.png b/res/images/materials/30062.png new file mode 100644 index 0000000..ddc298c Binary files /dev/null and b/res/images/materials/30062.png differ diff --git a/res/images/materials/30063.png b/res/images/materials/30063.png new file mode 100644 index 0000000..16345b3 Binary files /dev/null and b/res/images/materials/30063.png differ diff --git a/res/images/materials/30064.png b/res/images/materials/30064.png new file mode 100644 index 0000000..f43def1 Binary files /dev/null and b/res/images/materials/30064.png differ diff --git a/res/images/materials/30073.png b/res/images/materials/30073.png new file mode 100644 index 0000000..64b88b6 Binary files /dev/null and b/res/images/materials/30073.png differ diff --git a/res/images/materials/30074.png b/res/images/materials/30074.png new file mode 100644 index 0000000..f5359c6 Binary files /dev/null and b/res/images/materials/30074.png differ diff --git a/res/images/materials/30083.png b/res/images/materials/30083.png new file mode 100644 index 0000000..1e2f87f Binary files /dev/null and b/res/images/materials/30083.png differ diff --git a/res/images/materials/30084.png b/res/images/materials/30084.png new file mode 100644 index 0000000..746cb96 Binary files /dev/null and b/res/images/materials/30084.png differ diff --git a/res/images/materials/30093.png b/res/images/materials/30093.png new file mode 100644 index 0000000..a68e16b Binary files /dev/null and b/res/images/materials/30093.png differ diff --git a/res/images/materials/30094.png b/res/images/materials/30094.png new file mode 100644 index 0000000..bc6c56b Binary files /dev/null and b/res/images/materials/30094.png differ diff --git a/res/images/materials/30103.png b/res/images/materials/30103.png new file mode 100644 index 0000000..de0cba6 Binary files /dev/null and b/res/images/materials/30103.png differ diff --git a/res/images/materials/30104.png b/res/images/materials/30104.png new file mode 100644 index 0000000..5fcd144 Binary files /dev/null and b/res/images/materials/30104.png differ diff --git a/res/images/materials/30115.png b/res/images/materials/30115.png new file mode 100644 index 0000000..ac065be Binary files /dev/null and b/res/images/materials/30115.png differ diff --git a/res/images/materials/30125.png b/res/images/materials/30125.png new file mode 100644 index 0000000..4502fec Binary files /dev/null and b/res/images/materials/30125.png differ diff --git a/res/images/materials/30135.png b/res/images/materials/30135.png new file mode 100644 index 0000000..f856865 Binary files /dev/null and b/res/images/materials/30135.png differ diff --git a/res/images/materials/30145.png b/res/images/materials/30145.png new file mode 100644 index 0000000..84c37b0 Binary files /dev/null and b/res/images/materials/30145.png differ diff --git a/res/images/materials/30155.png b/res/images/materials/30155.png new file mode 100644 index 0000000..27f3890 Binary files /dev/null and b/res/images/materials/30155.png differ diff --git a/res/images/materials/30165.png b/res/images/materials/30165.png new file mode 100644 index 0000000..47b38ca Binary files /dev/null and b/res/images/materials/30165.png differ diff --git a/res/images/materials/31013.png b/res/images/materials/31013.png new file mode 100644 index 0000000..7ea5d52 Binary files /dev/null and b/res/images/materials/31013.png differ diff --git a/res/images/materials/31014.png b/res/images/materials/31014.png new file mode 100644 index 0000000..9c7765b Binary files /dev/null and b/res/images/materials/31014.png differ diff --git a/res/images/materials/31023.png b/res/images/materials/31023.png new file mode 100644 index 0000000..b06e1fc Binary files /dev/null and b/res/images/materials/31023.png differ diff --git a/res/images/materials/31024.png b/res/images/materials/31024.png new file mode 100644 index 0000000..caff072 Binary files /dev/null and b/res/images/materials/31024.png differ diff --git a/res/images/materials/31033.png b/res/images/materials/31033.png new file mode 100644 index 0000000..721103f Binary files /dev/null and b/res/images/materials/31033.png differ diff --git a/res/images/materials/31034.png b/res/images/materials/31034.png new file mode 100644 index 0000000..d5990c8 Binary files /dev/null and b/res/images/materials/31034.png differ diff --git a/res/images/materials/31043.png b/res/images/materials/31043.png new file mode 100644 index 0000000..8059ac8 Binary files /dev/null and b/res/images/materials/31043.png differ diff --git a/res/images/materials/31044.png b/res/images/materials/31044.png new file mode 100644 index 0000000..e5b2bb7 Binary files /dev/null and b/res/images/materials/31044.png differ diff --git a/res/images/materials/31053.png b/res/images/materials/31053.png new file mode 100644 index 0000000..bb589f8 Binary files /dev/null and b/res/images/materials/31053.png differ diff --git a/res/images/materials/31054.png b/res/images/materials/31054.png new file mode 100644 index 0000000..29a01dc Binary files /dev/null and b/res/images/materials/31054.png differ diff --git a/res/images/materials/31063.png b/res/images/materials/31063.png new file mode 100644 index 0000000..a707b2a Binary files /dev/null and b/res/images/materials/31063.png differ diff --git a/res/images/materials/31064.png b/res/images/materials/31064.png new file mode 100644 index 0000000..33fbdc6 Binary files /dev/null and b/res/images/materials/31064.png differ diff --git a/res/images/materials/31073.png b/res/images/materials/31073.png new file mode 100644 index 0000000..f7063bf Binary files /dev/null and b/res/images/materials/31073.png differ diff --git a/res/images/materials/31074.png b/res/images/materials/31074.png new file mode 100644 index 0000000..62af816 Binary files /dev/null and b/res/images/materials/31074.png differ diff --git a/res/images/materials/31083.png b/res/images/materials/31083.png new file mode 100644 index 0000000..2e1b55f Binary files /dev/null and b/res/images/materials/31083.png differ diff --git a/res/images/materials/31084.png b/res/images/materials/31084.png new file mode 100644 index 0000000..306deab Binary files /dev/null and b/res/images/materials/31084.png differ diff --git a/res/images/materials/31093.png b/res/images/materials/31093.png new file mode 100644 index 0000000..cd8fd82 Binary files /dev/null and b/res/images/materials/31093.png differ diff --git a/res/images/materials/31094.png b/res/images/materials/31094.png new file mode 100644 index 0000000..a20b0c7 Binary files /dev/null and b/res/images/materials/31094.png differ diff --git a/res/images/materials/3112.png b/res/images/materials/3112.png new file mode 100644 index 0000000..a240b7b Binary files /dev/null and b/res/images/materials/3112.png differ diff --git a/res/images/materials/3113.png b/res/images/materials/3113.png new file mode 100644 index 0000000..4202368 Binary files /dev/null and b/res/images/materials/3113.png differ diff --git a/res/images/materials/3114.png b/res/images/materials/3114.png new file mode 100644 index 0000000..3e71f3d Binary files /dev/null and b/res/images/materials/3114.png differ diff --git a/res/images/materials/3211.png b/res/images/materials/3211.png new file mode 100644 index 0000000..c3b3150 Binary files /dev/null and b/res/images/materials/3211.png differ diff --git a/res/images/materials/3212.png b/res/images/materials/3212.png new file mode 100644 index 0000000..7618c2c Binary files /dev/null and b/res/images/materials/3212.png differ diff --git a/res/images/materials/3213.png b/res/images/materials/3213.png new file mode 100644 index 0000000..cbda9ce Binary files /dev/null and b/res/images/materials/3213.png differ diff --git a/res/images/materials/3221.png b/res/images/materials/3221.png new file mode 100644 index 0000000..0f19ea0 Binary files /dev/null and b/res/images/materials/3221.png differ diff --git a/res/images/materials/3222.png b/res/images/materials/3222.png new file mode 100644 index 0000000..1acee90 Binary files /dev/null and b/res/images/materials/3222.png differ diff --git a/res/images/materials/3223.png b/res/images/materials/3223.png new file mode 100644 index 0000000..9837951 Binary files /dev/null and b/res/images/materials/3223.png differ diff --git a/res/images/materials/3231.png b/res/images/materials/3231.png new file mode 100644 index 0000000..8ae7344 Binary files /dev/null and b/res/images/materials/3231.png differ diff --git a/res/images/materials/3232.png b/res/images/materials/3232.png new file mode 100644 index 0000000..e75f531 Binary files /dev/null and b/res/images/materials/3232.png differ diff --git a/res/images/materials/3233.png b/res/images/materials/3233.png new file mode 100644 index 0000000..b0c9f21 Binary files /dev/null and b/res/images/materials/3233.png differ diff --git a/res/images/materials/3241.png b/res/images/materials/3241.png new file mode 100644 index 0000000..32fc401 Binary files /dev/null and b/res/images/materials/3241.png differ diff --git a/res/images/materials/3242.png b/res/images/materials/3242.png new file mode 100644 index 0000000..51d60ba Binary files /dev/null and b/res/images/materials/3242.png differ diff --git a/res/images/materials/3243.png b/res/images/materials/3243.png new file mode 100644 index 0000000..09425bb Binary files /dev/null and b/res/images/materials/3243.png differ diff --git a/res/images/materials/3251.png b/res/images/materials/3251.png new file mode 100644 index 0000000..96abeb4 Binary files /dev/null and b/res/images/materials/3251.png differ diff --git a/res/images/materials/3252.png b/res/images/materials/3252.png new file mode 100644 index 0000000..cf9357b Binary files /dev/null and b/res/images/materials/3252.png differ diff --git a/res/images/materials/3253.png b/res/images/materials/3253.png new file mode 100644 index 0000000..d9a42f8 Binary files /dev/null and b/res/images/materials/3253.png differ diff --git a/res/images/materials/3261.png b/res/images/materials/3261.png new file mode 100644 index 0000000..409c1a6 Binary files /dev/null and b/res/images/materials/3261.png differ diff --git a/res/images/materials/3262.png b/res/images/materials/3262.png new file mode 100644 index 0000000..a298d23 Binary files /dev/null and b/res/images/materials/3262.png differ diff --git a/res/images/materials/3263.png b/res/images/materials/3263.png new file mode 100644 index 0000000..cc9a8d9 Binary files /dev/null and b/res/images/materials/3263.png differ diff --git a/res/images/materials/3271.png b/res/images/materials/3271.png new file mode 100644 index 0000000..8de0cc7 Binary files /dev/null and b/res/images/materials/3271.png differ diff --git a/res/images/materials/3272.png b/res/images/materials/3272.png new file mode 100644 index 0000000..5556cd2 Binary files /dev/null and b/res/images/materials/3272.png differ diff --git a/res/images/materials/3273.png b/res/images/materials/3273.png new file mode 100644 index 0000000..7e700d8 Binary files /dev/null and b/res/images/materials/3273.png differ diff --git a/res/images/materials/3281.png b/res/images/materials/3281.png new file mode 100644 index 0000000..5207057 Binary files /dev/null and b/res/images/materials/3281.png differ diff --git a/res/images/materials/3282.png b/res/images/materials/3282.png new file mode 100644 index 0000000..0bd6cbe Binary files /dev/null and b/res/images/materials/3282.png differ diff --git a/res/images/materials/3283.png b/res/images/materials/3283.png new file mode 100644 index 0000000..6a1e43c Binary files /dev/null and b/res/images/materials/3283.png differ diff --git a/res/images/materials/3301.png b/res/images/materials/3301.png new file mode 100644 index 0000000..6977bc4 Binary files /dev/null and b/res/images/materials/3301.png differ diff --git a/res/images/materials/3302.png b/res/images/materials/3302.png new file mode 100644 index 0000000..48ca15b Binary files /dev/null and b/res/images/materials/3302.png differ diff --git a/res/images/materials/3303.png b/res/images/materials/3303.png new file mode 100644 index 0000000..c132cbf Binary files /dev/null and b/res/images/materials/3303.png differ diff --git a/res/images/materials/4001.png b/res/images/materials/4001.png new file mode 100644 index 0000000..2f7691a Binary files /dev/null and b/res/images/materials/4001.png differ diff --git a/res/images/materials/4006.png b/res/images/materials/4006.png new file mode 100644 index 0000000..cb0238a Binary files /dev/null and b/res/images/materials/4006.png differ diff --git a/res/images/materials/PR-A.png b/res/images/materials/PR-A.png new file mode 100644 index 0000000..1367a59 Binary files /dev/null and b/res/images/materials/PR-A.png differ diff --git a/res/images/materials/PR-B.png b/res/images/materials/PR-B.png new file mode 100644 index 0000000..46b9995 Binary files /dev/null and b/res/images/materials/PR-B.png differ diff --git a/res/images/materials/PR-C.png b/res/images/materials/PR-C.png new file mode 100644 index 0000000..9b4bb3d Binary files /dev/null and b/res/images/materials/PR-C.png differ diff --git a/res/images/materials/PR-D.png b/res/images/materials/PR-D.png new file mode 100644 index 0000000..a175026 Binary files /dev/null and b/res/images/materials/PR-D.png differ