api-datamanager/Company/Basic/Branch/BranchObj.py

38 lines
1.3 KiB
Python
Raw Normal View History

2022-08-31 14:58:06 +08:00
from Utils.ObjUtil import SpecObject
from Utils.ValidateUtil import ValidateAttr, Validate
class BranchList(SpecObject):
"""分支列表"""
cid = ValidateAttr(field='cid', type=str, default=None)
cname = ValidateAttr(field='cname', type=str)
leader = ValidateAttr(field='leader', type=str)
establishment_date = ValidateAttr(field='establishment_date', fun=Validate.date_format)
status = ValidateAttr(field='status', type=str)
province = ValidateAttr(field='province', type=str)
city = ValidateAttr(field='city', type=str, default=None)
fields_map = {
"cid": "企业ID",
"cname": "企业名称",
"leader": "负责人",
"establishment_date": "成立日期",
"status": "企业状态",
"province": "所属省份",
"city": "所属地市"
}
2022-09-09 13:42:02 +08:00
class BranchObj(SpecObject):
"""分支列表"""
2022-08-31 14:58:06 +08:00
cid = ValidateAttr(field='cid', type=str, length=8)
2022-09-09 13:42:02 +08:00
cname = ValidateAttr(field='cname', type=str)
2022-08-31 14:58:06 +08:00
branch_list = ValidateAttr(field='branch_list', instance_list=BranchList)
update_time = ValidateAttr(field='update_time', func=Validate.time_format)
fields_map = {
"cid": "企业ID",
2022-09-09 13:42:02 +08:00
"cname": "企业名称",
2022-08-31 14:58:06 +08:00
"branch_list": "分支列表",
"update_time": "更新时间"
}