35 lines
841 B
Python
35 lines
841 B
Python
from pydantic import Field
|
|
|
|
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
# 라우터 폴더마다 protocol.py 를 두고 Req_/Res_ 를 정의한다 (protocol 규약).
|
|
class AuthProtocol(WebPacketProtocol):
|
|
pass
|
|
|
|
|
|
class Req_Login(AuthProtocol):
|
|
id: str = ""
|
|
pw: str = ""
|
|
|
|
|
|
class Res_Login(Res_WebPacketProtocol):
|
|
uid: int = Field(0, description="user uid", json_schema_extra={"format": "int64"})
|
|
nickname: str = ""
|
|
access_token: str = ""
|
|
refresh_token: str = ""
|
|
|
|
|
|
class Req_CreateAccount(AuthProtocol):
|
|
id: str = ""
|
|
pw: str = ""
|
|
nickname: str = ""
|
|
|
|
|
|
class Res_CreateAccount(Res_WebPacketProtocol):
|
|
uid: int = Field(0, description="생성된 user uid", json_schema_extra={"format": "int64"})
|
|
|
|
|
|
class Res_RefreshToken(Res_WebPacketProtocol):
|
|
access_token: str = ""
|