2、前台判断用户是管理人,左下角显示团队管理 3、团队管理可以看到团队的人员、分配人员积分、人员的积分情况的功能 4、团队管理还可以邀请用户,比如生成个链接,未注册需要注册绑定团队,已注册用户访问弹窗是否加入这个团队,然后都需要管理同意才可以加入团队
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
from pydantic import BaseModel, Field
|
|
|
|
from app.schemas.common import NaiveDatetime
|
|
|
|
|
|
class SetManagerRequest(BaseModel):
|
|
user_id: str | None = Field(None, description="设为管理人的前台用户ID;传 null 表示取消管理人")
|
|
|
|
|
|
class TeamMemberOut(BaseModel):
|
|
id: str
|
|
username: str
|
|
phone: str | None = None
|
|
credits: float
|
|
is_active: bool = True
|
|
joined_at: NaiveDatetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ManagerTransferRequest(BaseModel):
|
|
target_user_id: str = Field(..., description="接收积分的成员用户ID")
|
|
amount: float = Field(gt=0, description="转账积分数量(正数)")
|
|
description: str | None = Field(None, max_length=256, description="转账说明")
|
|
|
|
|
|
class ManagedTeamOut(BaseModel):
|
|
id: str
|
|
name: str
|
|
code: str | None = None
|
|
description: str | None = None
|
|
status: str
|
|
member_count: int = 0
|
|
manager_id: str | None = None
|
|
manager_name: str | None = None
|
|
|
|
model_config = {"from_attributes": True}
|