| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- from pydantic import BaseModel
- from typing import Optional
- from datetime import datetime
- class LicenseCreate(BaseModel):
- """创建/更新 License 请求"""
- super_admin_id: int
- license_key: str
- expires_at: str # ISO 8601 string
- max_tenants: Optional[int] = None
- max_users_per_tenant: Optional[int] = None
- remark: Optional[str] = None
- class LicenseResponse(BaseModel):
- """单个 License 响应"""
- id: int
- super_admin_id: int
- super_admin_name: str
- license_key: str
- expires_at: str
- status: str
- max_tenants: Optional[int] = None
- max_users_per_tenant: Optional[int] = None
- remark: Optional[str] = None
- created_at: Optional[str] = None
- updated_at: Optional[str] = None
- domain: Optional[str] = None
- contact: Optional[dict] = None
- class LicenseStatusResponse(BaseModel):
- """License 状态查询响应"""
- id: int
- super_admin_id: int
- super_admin_name: str
- license_key: str
- expires_at: str
- status: str
- days_left: int
- max_tenants: Optional[int] = None
- max_users_per_tenant: Optional[int] = None
- remark: Optional[str] = None
- class SuperAdminOption(BaseModel):
- """超级管理员下拉选项"""
- id: int
- username: str
- nickname: Optional[str] = None
- remark: Optional[str] = None
- class LicenseListResponse(BaseModel):
- """License 列表响应"""
- total: int
- items: list[LicenseResponse]
- class LicenseUpdate(BaseModel):
- """更新 License 请求(仅更新指定字段)"""
- license_key: Optional[str] = None
- expires_at: Optional[str] = None
|