Files
wecom-wnzs-adapter/service/wecom/schemas/departments.py
Tordor 39b6180fb8 Refactor lifespan with ChainBuilder for initialization tasks
- Replace manual initialization sequence with ChainBuilder pattern
- Add ChainBuilder class supporting both sync and async task chaining
- Rename test_init() to data_base_init() for clarity
- Fix string formatting in log messages (remove f-string where
  unnecessary)
- Fix escape sequence in department schema documentation
- Convert CheckinType to Enum for better type safety
2026-01-16 11:34:31 +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 List
from service.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: str
class CreateDepartmentInfo(BaseSchema):
errcode: int
errmsg: str
id: int
class DepartmentInfoItem(BaseSchema):
"""
部门单体响应数据
"""
id: int
name: str
name_en: str | None = None
department_leader: List[str] | None = None
parentid: int | None = None
order: int | None = None
class DepartmentInfo(BaseSchema):
"""
部门整体响应数据
"""
errcode: int
errmsg: str
department: List[DepartmentInfoItem]