适配新成就模板 (#540)

*  完善Achievement模型

*  添加一些alias

*  更新模板 schemas

* 🐛 修复类型错误
This commit is contained in:
呵呵です
2025-05-07 23:51:13 +08:00
committed by GitHub
parent 13f005179f
commit 56fe45efcf
3 changed files with 111 additions and 14 deletions

View File

@@ -3,6 +3,8 @@ from typing import Literal
from pydantic import BaseModel
from .......games.tetrio.api.schemas.summaries.achievements import ArType, RankType
from .......games.tetrio.api.schemas.summaries.achievements import Rank as AchievementRank
from .......games.tetrio.api.typedefs import Rank
from ......typedefs import Number
from ....base import Avatar, Base, HistoryData
@@ -15,6 +17,18 @@ class Badge(BaseModel):
receive_at: datetime | None
class Achievement(BaseModel):
key: int
rank_type: RankType
ar_type: ArType
stub: bool | None
rank: AchievementRank | None
achieved_score: float | None
pos: int | None
progress: float | None
total: int | None
class User(BaseModel):
id: str
name: str
@@ -37,7 +51,7 @@ class User(BaseModel):
xp: Number
ar: Number
achievements: list[int]
achievements: list[Achievement]
playtime: str | None
join_at: datetime | None