mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
✨ 将处理过程中的 dataclass 换成 pydantic
This commit is contained in:
24
nonebot_plugin_tetris_stats/game_data_processor/schemas.py
Normal file
24
nonebot_plugin_tetris_stats/game_data_processor/schemas.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Self
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class BaseUser(ABC, BaseModel):
|
||||
"""游戏用户"""
|
||||
|
||||
def __eq__(self, __value: Self) -> bool:
|
||||
return self.unique_identifier == __value.unique_identifier
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def unique_identifier(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class BaseRawResponse(BaseModel):
|
||||
"""原始请求数据"""
|
||||
|
||||
|
||||
class BaseProcessedData(BaseModel):
|
||||
"""处理/验证后的数据"""
|
||||
Reference in New Issue
Block a user