This commit is contained in:
aaron 2025-03-01 22:14:04 +08:00
parent 22fb08795a
commit 6254ed804e
2 changed files with 11 additions and 9 deletions

View File

@ -96,7 +96,7 @@ async def apply_partner(
wecom_bot = WecomBot() wecom_bot = WecomBot()
message = f"""📢 新的合伙人申请 message = f"""📢 新的合伙人申请
> 申请类型: {apply_data.type} > 申请类型: {apply_data.type_display}
> 申请人: {apply_data.name} > 申请人: {apply_data.name}
> 联系电话: {apply_data.phone} > 联系电话: {apply_data.phone}
> 服务对象/区域: {apply_data.service_target} > 服务对象/区域: {apply_data.service_target}

View File

@ -30,6 +30,7 @@ class FeedbackPartnerApplyDB(Base):
create_time = Column(DateTime(timezone=True), server_default=func.now()) create_time = Column(DateTime(timezone=True), server_default=func.now())
update_time = Column(DateTime(timezone=True), onupdate=func.now()) update_time = Column(DateTime(timezone=True), onupdate=func.now())
# Pydantic 模型 # Pydantic 模型
class CommunityApplyCreate(BaseModel): class CommunityApplyCreate(BaseModel):
user_id: int = Field(..., description="用户ID") user_id: int = Field(..., description="用户ID")
@ -54,6 +55,15 @@ class PartnerApplyCreate(BaseModel):
type: str = Field(..., max_length=50, description="合伙人类型") type: str = Field(..., max_length=50, description="合伙人类型")
service_target: str = Field(..., max_length=200, description="服务对象/区域") service_target: str = Field(..., max_length=200, description="服务对象/区域")
@property
def type_display(self):
if self.type == "community":
return "社区合伙人"
elif self.type == "city":
return "城市合伙人"
else:
return self.type
class PartnerApplyInfo(BaseModel): class PartnerApplyInfo(BaseModel):
id: int id: int
user_id: int user_id: int
@ -64,13 +74,5 @@ class PartnerApplyInfo(BaseModel):
create_time: datetime create_time: datetime
update_time: Optional[datetime] = None update_time: Optional[datetime] = None
@property
def type_display(self):
if self.type == "community":
return "社区合伙人"
elif self.type == "city":
return "城市合伙人"
else:
return self.type
class Config: class Config:
from_attributes = True from_attributes = True