tfse-app-api-v0.2/ObjectsCommon/Industry/FECRIndustry.py

95 lines
3.2 KiB
Python

from Utils.ObjUtil import SpecObject
from Utils.ValidateUtil import Validate, ValidateAttr
class IndustryAnalysis(SpecObject):
"""行业分析"""
class PositiveFactor(SpecObject):
"""正面因素"""
tag = ValidateAttr(field='tag', type=str, mark='正面因素-标签')
analysis = ValidateAttr(field='analysis', type=str, mark='正面因素-分析')
fields_map = {
"tag": "标签",
"analysis": "分析"
}
class NegativeFactor(SpecObject):
"""负面因素"""
tag = ValidateAttr(field='tag', type=str, mark='负面因素-标签')
analysis = ValidateAttr(field='analysis', type=str, mark='负面因素-分析')
fields_map = {
"tag": "标签",
"analysis": "分析"
}
class IncreaseTrend(SpecObject):
"""增长趋势"""
class DataItem(SpecObject):
"""数据"""
year = ValidateAttr(field='year', type=str, mark='增长趋势-年度')
data = ValidateAttr(field='data', type=str, mark='增长趋势-数据-数据')
fields_map = {
"year": "年度",
"data": "数据"
}
title = ValidateAttr(field='title', type=str, mark='增长趋势-标题')
unit = ValidateAttr(field='unit', type=str, mark='增长趋势-单位')
data = ValidateAttr(field='data', instance_list=DataItem, mark='增长趋势-数据')
fields_map = {
"title": "标题",
"unit": "单位",
"data": "数据"
}
class IndustrySize(SpecObject):
"""规模分布"""
class DataItem(SpecObject):
"""数据"""
sub_industry = ValidateAttr(field='sub_industry', type=str, mark='规模分布-子行业')
data = ValidateAttr(field='data', type=str, mark='规模分布-数据-数据')
fields_map = {
"sub_industry": "年度",
"data": "数据"
}
title = ValidateAttr(field='title', type=str, mark='规模分布-标题')
unit = ValidateAttr(field='unit', type=str, mark='规模分布-单位')
data = ValidateAttr(field='data', instance_list=DataItem, mark='规模分布-数据')
fields_map = {
"title": "标题",
"unit": "单位",
"data": "数据"
}
name = ValidateAttr(field='name', type=str)
introduction = ValidateAttr(field='introduction', type=str)
update_time = ValidateAttr(field='update_time', func=Validate.time_format)
positive_factor = ValidateAttr(field='positive_factor', instance_list=PositiveFactor)
negative_factor = ValidateAttr(field='negative_factor', instance_list=NegativeFactor)
increase_trend = ValidateAttr(field='increase_trend', type=IncreaseTrend)
industry_size = ValidateAttr(field='industry_size', type=IndustrySize)
fields_map = {
"name": "行业",
"introduction": "行业简介",
"update_time": "更新时间",
"positive_factor": "正面因素",
"negative_factor": "负面因素",
"increase_trend": "增长趋势",
"industry_size": "规模分布"
}