Files
wecom-wnzs-adapter/service/wecom/schemas/departments.py
2026-01-15 17:34:22 +08:00

59 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from typing import AnyStr, List
from wecom.schemas.base import BaseSchema
class CreateDepartmentParams(BaseSchema):
"""
创建部门
@param name: 部门名称。长度限制为1~32个字节字符不能包括\:?”<>
@param name_en: 英文名称
@param parentid: 父部门id。根部门id为1
@param order: 在父部门中的次序值。order值小的排序靠前。
@param id: 部门id整型。指定时必须大于1不指定时则自动生成
"""
name: str
name_en: str | None = None
parentid: int
order: int | None = None
id: int | None = None
class UpdateDepartmentParams(CreateDepartmentParams): ...
class UpdateDepartmentInfo(BaseSchema):
errcode: int
errmsg: AnyStr
class CreateDepartmentInfo(BaseSchema):
errcode: int
errmsg: AnyStr
id: int
class DepartmentInfo(BaseSchema):
"""
部门单体响应数据
"""
id: int
name: AnyStr
name_en: AnyStr | None = None
department_leader: List[str] | None = None
parentid: int | None = None
order: int | None = None
class DepartmentInfo(BaseSchema):
"""
部门整体响应数据
"""
errcode: int
errmsg: AnyStr
department: List[DepartmentInfo]