update
This commit is contained in:
parent
22fb08795a
commit
6254ed804e
@ -96,7 +96,7 @@ async def apply_partner(
|
||||
wecom_bot = WecomBot()
|
||||
message = f"""📢 新的合伙人申请
|
||||
|
||||
> 申请类型: {apply_data.type}
|
||||
> 申请类型: {apply_data.type_display}
|
||||
> 申请人: {apply_data.name}
|
||||
> 联系电话: {apply_data.phone}
|
||||
> 服务对象/区域: {apply_data.service_target}
|
||||
|
||||
@ -30,6 +30,7 @@ class FeedbackPartnerApplyDB(Base):
|
||||
create_time = Column(DateTime(timezone=True), server_default=func.now())
|
||||
update_time = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
# Pydantic 模型
|
||||
class CommunityApplyCreate(BaseModel):
|
||||
user_id: int = Field(..., description="用户ID")
|
||||
@ -54,6 +55,15 @@ class PartnerApplyCreate(BaseModel):
|
||||
type: str = Field(..., max_length=50, 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):
|
||||
id: int
|
||||
user_id: int
|
||||
@ -64,13 +74,5 @@ class PartnerApplyInfo(BaseModel):
|
||||
create_time: datetime
|
||||
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:
|
||||
from_attributes = True
|
||||
Loading…
Reference in New Issue
Block a user