This reverts commit 68701dbb1d.
This commit is contained in:
jimmy-sketch
2025-07-24 20:23:26 +08:00
parent 68701dbb1d
commit 7b6f92593e
28 changed files with 1394 additions and 644 deletions

29
app/models/oauth.py Normal file
View File

@@ -0,0 +1,29 @@
# OAuth 相关模型
from __future__ import annotations
from pydantic import BaseModel
class TokenRequest(BaseModel):
grant_type: str
username: str | None = None
password: str | None = None
refresh_token: str | None = None
client_id: str
client_secret: str
scope: str = "*"
class TokenResponse(BaseModel):
access_token: str
token_type: str = "Bearer"
expires_in: int
refresh_token: str
scope: str = "*"
class UserCreate(BaseModel):
username: str
password: str
email: str
country_code: str = "CN"