Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-28 01:42:15 +08:00
co-authored by Copilot
parent a5d22d3b88
commit 5dfdc9da10
5 changed files with 26 additions and 24 deletions
+4 -4
View File
@@ -58,19 +58,19 @@ async def get_character_info(request: Request, state: AltersDep, redis: RedisDep
@router.get('/info/oath/{suitId}/{skillId}')
async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, redis: RedisDep):
async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, lv: int, redis: RedisDep):
def get_info():
skill = None
version = state.equVersion
equ = get_equipment(version)
oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity), None)
oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity and str(x.level) == str(lv)), None)
if oath is not None:
oathSkill = next((x for x in oath.skills if x.skillId == skillId), None)
if oathSkill is not None:
skill = {**oathSkill.__dict__, 'point': oath.points, 'imageUrl': oath.imageUrl}
skill = {**oathSkill.__dict__, 'point': oath.points.split(',')[lv - 1], 'imageUrl': oath.imageUrl}
return skill
info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{skillId}', get_info)
info = get_redis_info(redis, f'dcalc:oath:{suitId}:{rarity}:{lv}:{skillId}', get_info)
return response(data=info)
Binary file not shown.