-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b7579d
commit 5cea864
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from pydantic import BaseModel | ||
from typing import TypeVar, Generic | ||
|
||
class LocalInfo(BaseModel): | ||
name : str | ||
id : int | ||
|
||
class RegionInfo(BaseModel): | ||
name : str | ||
id : int | ||
local: list[LocalInfo] | ||
|
||
class PartyInfo(BaseModel): | ||
name : str | ||
color : int | ||
|
||
class Diversity(BaseModel): | ||
action_type : str | ||
value : float | ||
|
||
class AgeInfo(BaseModel): | ||
minAge: int | ||
maxAge: int | ||
count: int | ||
|
||
class PartyInfo(BaseModel): | ||
party : str | ||
count : int | ||
|
||
class SexInfo(BaseModel): | ||
sex: str | ||
count: int | ||
|
||
T = TypeVar("T", SexInfo, PartyInfo, AgeInfo) | ||
|
||
class ChartResponse(BaseModel, Generic[T]): | ||
data : list[T] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters