mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-07-01 20:26:27 +00:00
feat(db): export methods
This commit is contained in:
2
src/arcaea_offline/external/exports/__init__.py
vendored
Normal file
2
src/arcaea_offline/external/exports/__init__.py
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
from . import exporters
|
||||
from .types import ScoreExport
|
19
src/arcaea_offline/external/exports/exporters.py
vendored
Normal file
19
src/arcaea_offline/external/exports/exporters.py
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
from ...models import Score
|
||||
from .types import ScoreExport
|
||||
|
||||
|
||||
def score(score: Score) -> ScoreExport:
|
||||
return {
|
||||
"id": score.id,
|
||||
"song_id": score.song_id,
|
||||
"rating_class": score.rating_class,
|
||||
"score": score.score,
|
||||
"pure": score.pure,
|
||||
"far": score.far,
|
||||
"lost": score.lost,
|
||||
"date": score.date,
|
||||
"max_recall": score.max_recall,
|
||||
"modifier": score.modifier,
|
||||
"clear_type": score.clear_type,
|
||||
"comment": score.comment,
|
||||
}
|
16
src/arcaea_offline/external/exports/types.py
vendored
Normal file
16
src/arcaea_offline/external/exports/types.py
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ScoreExport(TypedDict):
|
||||
id: int
|
||||
song_id: str
|
||||
rating_class: int
|
||||
score: int
|
||||
pure: Optional[int]
|
||||
far: Optional[int]
|
||||
lost: Optional[int]
|
||||
date: Optional[int]
|
||||
max_recall: Optional[int]
|
||||
modifier: Optional[int]
|
||||
clear_type: Optional[int]
|
||||
comment: Optional[str]
|
Reference in New Issue
Block a user