-
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.
Merge pull request #4 from pingpingy1/main
[feat] 변수명 통일 (wiwName, sdName, localId, metroId, gender)
- Loading branch information
Showing
5 changed files
with
79 additions
and
104 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 |
---|---|---|
@@ -1,101 +1,64 @@ | ||
from pydantic import BaseModel | ||
from typing import TypeVar, Generic | ||
|
||
|
||
class LocalInfo(BaseModel): | ||
name : str | ||
id : int | ||
name: str | ||
id: int | ||
|
||
|
||
class RegionInfo(BaseModel): | ||
name : str | ||
id : int | ||
name: str | ||
id: int | ||
local: list[LocalInfo] | ||
|
||
class PartyInfo(BaseModel): | ||
name : str | ||
color : int | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"name": "정상이당", | ||
"count": 10 | ||
} | ||
} | ||
} | ||
class PartyInfo(BaseModel): | ||
name: str | ||
color: int | ||
|
||
model_config = {"json_schema_extra": {"example": {"name": "정상이당", "count": 10}}} | ||
|
||
|
||
class Diversity(BaseModel): | ||
action_type : str | ||
value : float | ||
action_type: str | ||
value: float | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"action_type": "sex", | ||
"value": 0.5 | ||
} | ||
} | ||
"json_schema_extra": {"example": {"action_type": "gender", "value": 0.5}} | ||
} | ||
|
||
|
||
|
||
class AgeInfo(BaseModel): | ||
minAge: int | ||
maxAge: int | ||
count: int | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"minAge": 10, | ||
"maxAge": 20, | ||
"count": 10 | ||
} | ||
} | ||
"json_schema_extra": {"example": {"minAge": 10, "maxAge": 20, "count": 10}} | ||
} | ||
|
||
|
||
class PartyInfo(BaseModel): | ||
party : str | ||
count : int | ||
party: str | ||
count: int | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"party": "숭구리당당", | ||
"count": 10 | ||
} | ||
} | ||
} | ||
model_config = {"json_schema_extra": {"example": {"party": "숭구리당당", "count": 10}}} | ||
|
||
class SexInfo(BaseModel): | ||
sex: str | ||
|
||
class GenderInfo(BaseModel): | ||
gender: str | ||
count: int | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"sex": "male", | ||
"count": 10 | ||
} | ||
} | ||
} | ||
model_config = {"json_schema_extra": {"example": {"gender": "male", "count": 10}}} | ||
|
||
|
||
T = TypeVar("T", GenderInfo, PartyInfo, AgeInfo) | ||
|
||
T = TypeVar("T", SexInfo, PartyInfo, AgeInfo) | ||
|
||
class ChartResponse(BaseModel, Generic[T]): | ||
data : list[T] | ||
data: list[T] | ||
|
||
model_config = { | ||
"json_schema_extra": { | ||
"example" : { | ||
"data": [ | ||
{ | ||
"sex": "male", | ||
"count": 10 | ||
} | ||
] | ||
} | ||
} | ||
"json_schema_extra": {"example": {"data": [{"gender": "male", "count": 10}]}} | ||
} |
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
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