feat: 添加掉落物的url查询API

This commit is contained in:
DLmaster361
2025-09-01 21:26:40 +08:00
parent ee8075e4b8
commit 88006ec5f4
100 changed files with 31 additions and 1 deletions

View File

@@ -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):
"""获取脚本下拉框信息"""