PamGram/modules/wiki/models/material.py
2024-03-27 10:45:20 +08:00

36 lines
646 B
Python

# 材料
from typing import List, Optional
from pydantic import BaseModel
class MaterialSource(BaseModel):
description: str
class MaterialMType(BaseModel):
id: int
name: str
class YattaMaterial(BaseModel):
id: int
"""材料ID"""
name: str
"""名称"""
description: str
"""描述"""
story: Optional[str] = None
"""故事"""
rank: int
"""稀有度"""
source: List[MaterialSource]
"""来源"""
type: Optional[MaterialMType] = None
"""类型"""
route: str
@property
def icon(self) -> str:
return f"https://api.yatta.top/hsr/assets/UI/item/{self.id}.png"