Initial commit - cleaned repository
This commit is contained in:
31
services/users/backend/models.py
Normal file
31
services/users/backend/models.py
Normal file
@ -0,0 +1,31 @@
|
||||
from beanie import Document
|
||||
from pydantic import EmailStr, Field, HttpUrl
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class User(Document):
|
||||
username: str = Field(..., unique=True)
|
||||
email: EmailStr
|
||||
full_name: Optional[str] = None
|
||||
profile_picture: Optional[str] = Field(None, description="프로필 사진 URL")
|
||||
profile_picture_thumbnail: Optional[str] = Field(None, description="프로필 사진 썸네일 URL")
|
||||
bio: Optional[str] = Field(None, max_length=500, description="자기소개")
|
||||
location: Optional[str] = Field(None, description="위치")
|
||||
website: Optional[str] = Field(None, description="개인 웹사이트")
|
||||
is_email_verified: bool = Field(default=False, description="이메일 인증 여부")
|
||||
is_active: bool = Field(default=True, description="계정 활성화 상태")
|
||||
created_at: datetime = Field(default_factory=datetime.now)
|
||||
updated_at: datetime = Field(default_factory=datetime.now)
|
||||
|
||||
class Settings:
|
||||
collection = "users"
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"example": {
|
||||
"username": "john_doe",
|
||||
"email": "john@example.com",
|
||||
"full_name": "John Doe"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user