mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🔥 删除旧 API 的 user_records 模型
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
from .player import Player
|
from .player import Player
|
||||||
from .schemas.user import User
|
from .schemas.user import User
|
||||||
from .schemas.user_info import UserInfoSuccess
|
from .schemas.user_info import UserInfoSuccess
|
||||||
from .schemas.user_records import UserRecordsSuccess
|
|
||||||
from .tetra_league import full_export as tetra_league_full_export
|
from .tetra_league import full_export as tetra_league_full_export
|
||||||
|
|
||||||
__all__ = ['Player', 'User', 'UserInfoSuccess', 'UserRecordsSuccess', 'tetra_league_full_export']
|
__all__ = ['Player', 'User', 'UserInfoSuccess', 'tetra_league_full_export']
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
|
||||||
|
|
||||||
from .....utils.typing import Number
|
|
||||||
from .base import FailedModel
|
|
||||||
from .base import SuccessModel as BaseSuccessModel
|
|
||||||
|
|
||||||
|
|
||||||
class Time(BaseModel):
|
|
||||||
start: int
|
|
||||||
zero: bool
|
|
||||||
locked: bool
|
|
||||||
prev: int
|
|
||||||
frameoffset: int | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class Clears(BaseModel):
|
|
||||||
singles: int
|
|
||||||
doubles: int
|
|
||||||
triples: int
|
|
||||||
quads: int
|
|
||||||
pentas: int | None = None
|
|
||||||
realtspins: int
|
|
||||||
minitspins: int
|
|
||||||
minitspinsingles: int
|
|
||||||
tspinsingles: int
|
|
||||||
minitspindoubles: int
|
|
||||||
tspindoubles: int
|
|
||||||
tspintriples: int
|
|
||||||
tspinquads: int
|
|
||||||
allclear: int
|
|
||||||
|
|
||||||
|
|
||||||
class Garbage(BaseModel):
|
|
||||||
sent: int
|
|
||||||
received: int
|
|
||||||
attack: int | None = None
|
|
||||||
cleared: int | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class Finesse(BaseModel):
|
|
||||||
combo: int
|
|
||||||
faults: int
|
|
||||||
perfectpieces: int
|
|
||||||
|
|
||||||
|
|
||||||
class EndContext(BaseModel):
|
|
||||||
seed: Number
|
|
||||||
lines: int
|
|
||||||
level_lines: int
|
|
||||||
level_lines_needed: int
|
|
||||||
inputs: int
|
|
||||||
holds: int | None = None
|
|
||||||
time: Time
|
|
||||||
score: int
|
|
||||||
zenlevel: int | None = None
|
|
||||||
zenprogress: int | None = None
|
|
||||||
level: int
|
|
||||||
combo: int
|
|
||||||
currentcombopower: int | None = None # WTF
|
|
||||||
topcombo: int
|
|
||||||
btb: int
|
|
||||||
topbtb: int
|
|
||||||
currentbtbchainpower: int | None = None # WTF * 2
|
|
||||||
tspins: int
|
|
||||||
piecesplaced: int
|
|
||||||
clears: Clears
|
|
||||||
garbage: Garbage
|
|
||||||
kills: int
|
|
||||||
finesse: Finesse
|
|
||||||
final_time: float = Field(..., alias='finalTime')
|
|
||||||
gametype: str
|
|
||||||
|
|
||||||
|
|
||||||
class _User(BaseModel):
|
|
||||||
id: str = Field(..., alias='_id')
|
|
||||||
username: str
|
|
||||||
|
|
||||||
|
|
||||||
class _Record(BaseModel):
|
|
||||||
id: str = Field(..., alias='_id')
|
|
||||||
stream: str
|
|
||||||
replayid: str
|
|
||||||
user: _User
|
|
||||||
ts: datetime
|
|
||||||
ismulti: bool | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class SoloRecord(_Record):
|
|
||||||
endcontext: EndContext
|
|
||||||
|
|
||||||
|
|
||||||
class MultiRecord(_Record):
|
|
||||||
endcontext: list[EndContext]
|
|
||||||
|
|
||||||
|
|
||||||
class SoloModeRecord(BaseModel):
|
|
||||||
record: SoloRecord | None = None
|
|
||||||
rank: int | None = None
|
|
||||||
|
|
||||||
|
|
||||||
class Records(BaseModel):
|
|
||||||
sprint: SoloModeRecord = Field(..., alias='40l')
|
|
||||||
blitz: SoloModeRecord
|
|
||||||
|
|
||||||
|
|
||||||
class Zen(BaseModel):
|
|
||||||
level: int
|
|
||||||
score: int
|
|
||||||
|
|
||||||
|
|
||||||
class Data(BaseModel):
|
|
||||||
records: Records
|
|
||||||
zen: Zen
|
|
||||||
|
|
||||||
|
|
||||||
class UserRecordsSuccess(BaseSuccessModel):
|
|
||||||
data: Data
|
|
||||||
|
|
||||||
|
|
||||||
UserRecords = UserRecordsSuccess | FailedModel
|
|
||||||
@@ -3,7 +3,6 @@ from typing import Literal
|
|||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from ......games.tetrio.api.schemas.user_records import Zen
|
|
||||||
from ......games.tetrio.api.typing import Rank, ValidRank
|
from ......games.tetrio.api.typing import Rank, ValidRank
|
||||||
from .....typing import Number
|
from .....typing import Number
|
||||||
from ...base import Avatar
|
from ...base import Avatar
|
||||||
@@ -91,6 +90,11 @@ class Blitz(BaseModel):
|
|||||||
play_at: datetime
|
play_at: datetime
|
||||||
|
|
||||||
|
|
||||||
|
class Zen(BaseModel):
|
||||||
|
level: int
|
||||||
|
score: int
|
||||||
|
|
||||||
|
|
||||||
class Info(BaseModel):
|
class Info(BaseModel):
|
||||||
user: User
|
user: User
|
||||||
tetra_league: TetraLeague | None
|
tetra_league: TetraLeague | None
|
||||||
|
|||||||
Reference in New Issue
Block a user