import time import random from datetime import datetime from pydantic import BaseModel def get_id(): return hex(int(time.time() * 10 ** 7) + random.randint(0, 10000))[2:] # 报表分组模板 class InsertTables(BaseModel): table_id: str = get_id() # 报表唯一id mode_id: str # 模版id table_data: dict = {} # 报表其他数据 mode_time: datetime = datetime.now() # 修改时间 # 查询报表 class FindTables(BaseModel): mode_id: str # 模板所属hr的uid where: dict = {} # 其他条件 # 更新报表 class UpdateTables(BaseModel): table_id: str # 模板唯一id update_data: dict # 更新的数据