feat: 企微应用租户下拉选择 + corp_id 自动填入
All checks were successful
continuous-integration/drone/push Build is passing

- 租户表增加 corp_id 字段(企业微信企业ID)
- 租户管理页面支持配置 corp_id
- 企微应用页面租户从下拉选择
- 选择租户后自动填入 corp_id 并禁用编辑
- 提示用户如租户未配置 corp_id 需先去配置
This commit is contained in:
111
2026-01-24 10:20:02 +08:00
parent 0a799ee276
commit ab84f6b87d
4 changed files with 75 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ router = APIRouter(prefix="/tenants", tags=["租户管理"])
class TenantCreate(BaseModel):
code: str
name: str
corp_id: Optional[str] = None # 企业微信企业ID
contact_info: Optional[dict] = None
status: str = "active"
expired_at: Optional[date] = None
@@ -27,6 +28,7 @@ class TenantCreate(BaseModel):
class TenantUpdate(BaseModel):
name: Optional[str] = None
corp_id: Optional[str] = None # 企业微信企业ID
contact_info: Optional[dict] = None
status: Optional[str] = None
expired_at: Optional[date] = None
@@ -81,6 +83,7 @@ async def list_tenants(
"id": t.id,
"code": t.code,
"name": t.name,
"corp_id": t.corp_id,
"contact_info": t.contact_info,
"status": t.status,
"expired_at": t.expired_at,
@@ -120,6 +123,7 @@ async def get_tenant(
"id": tenant.id,
"code": tenant.code,
"name": tenant.name,
"corp_id": tenant.corp_id,
"contact_info": tenant.contact_info,
"status": tenant.status,
"expired_at": tenant.expired_at,
@@ -159,6 +163,7 @@ async def create_tenant(
tenant = Tenant(
code=data.code,
name=data.name,
corp_id=data.corp_id,
contact_info=data.contact_info,
status=data.status,
expired_at=data.expired_at