- Add AdminUser role field (admin/submitter) - User management in admin panel - Public joke submission API (no auth required) - Document submission methods for external workers Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
506 B
Python
26 lines
506 B
Python
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class UserCreate(BaseModel):
|
|
"""创建用户"""
|
|
username: str
|
|
password: str
|
|
role: str = "submitter" # admin=管理员, submitter=提交者
|
|
|
|
|
|
class UserResponse(BaseModel):
|
|
"""用户信息"""
|
|
id: int
|
|
username: str
|
|
role: str
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class UserRegister(BaseModel):
|
|
"""公开注册(仅限提交者)"""
|
|
username: str
|
|
password: str |