PamGram/modules/wiki/models/material.py

36 lines
646 B
Python
Raw Normal View History

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