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

36 lines
1.2 KiB
Python

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": "所属地市"
}
class ShareholderObj(SpecObject):
"""股东信息"""
cid = ValidateAttr(field='cid', type=str, length=8)
branch_list = ValidateAttr(field='branch_list', instance_list=BranchList)
update_time = ValidateAttr(field='update_time', func=Validate.time_format)
fields_map = {
"cid": "企业ID",
"branch_list": "分支列表",
"update_time": "更新时间"
}