订单需管理员审核后才开通节点,并更新登录页文案。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-10 23:04:24 +08:00
parent 8b55b9cf55
commit f329f647c7
22 changed files with 583 additions and 81 deletions
+28 -1
View File
@@ -8,7 +8,7 @@ from typing import Annotated
from pydantic import BaseModel, ConfigDict, Field, PlainSerializer
from app.models import NodeStatus, TaskStatus, UserRole, WithdrawalStatus, YieldStatus
from app.models import NodeStatus, OrderStatus, TaskStatus, UserRole, WithdrawalStatus, YieldStatus
SN = Annotated[str, Field(min_length=4, max_length=64, pattern=r"^[A-Za-z0-9_-]+$")]
WALLET = Annotated[str, Field(min_length=4, max_length=128, pattern=r"^[A-Za-z0-9:_-]+$")]
@@ -86,10 +86,13 @@ class NodeView(NodeOut):
wallet_address: str
online_rate: MoneyText = Decimal("0")
today_points: MoneyText = Decimal("0")
node_token: str | None = None
activated: bool = False
class HeartbeatIn(APIModel):
sn: SN
token: str | None = Field(default=None, max_length=128)
class HeartbeatOut(APIModel):
@@ -113,6 +116,7 @@ class TaskReportIn(APIModel):
task_id: str = Field(min_length=36, max_length=36)
success: bool
nonce: str = Field(min_length=8, max_length=128)
token: str | None = Field(default=None, max_length=128)
class ContributionOut(APIModel):
@@ -180,6 +184,26 @@ class MeNodeCreate(APIModel):
callback_url: str | None = None
class OrderCreate(APIModel):
tx_id: str = Field(min_length=6, max_length=128, pattern=r"^[A-Za-z0-9]+$")
class OrderOut(APIModel):
id: int
user_id: int
amount: MoneyText
asset_symbol: str
status: OrderStatus
tx_id: str
created_at: datetime
reviewed_at: datetime | None = None
sn: str | None = None
class OrderView(OrderOut):
wallet_address: str
class WithdrawalConfirm(APIModel):
tx_hash: str = Field(min_length=6, max_length=128, pattern=r"^[A-Za-z0-9]+$")
@@ -227,5 +251,8 @@ class DashboardOut(APIModel):
available_points: MoneyText
settled_points: MoneyText
today_points: MoneyText
license_price: MoneyText
license_asset: str
nodes: list[NodeView]
orders: list[OrderOut]
withdrawals: list[WithdrawalOut]