tfse-app-api-v0.2/company/company_obj.py

36 lines
968 B
Python

from company.company_impl import find_company_data_scripts, find_financial_index_detail_scripts, get_head_info_impl, \
industry_analysis_impl
class CompanyIndex:
"""
企业主页
"""
def __init__(self):
self.cid = None
self.tab = None
self.industry = None
def get_head_info(self):
result = get_head_info_impl(self.cid)
return "查询成功", result
def get_company_data_obj(self):
result = find_company_data_scripts(self.tab, self.cid)
if result:
result[0].pop('企业ID')
return "查询成功", result[0]
else:
return "无数据", {}
def get_index_detail_obj(self):
result = find_financial_index_detail_scripts(self.tab, self.cid)
if result:
return '查询成功', result
else:
return '无数据', {}
def industry_analysis(self):
industry_analysis_impl(self.industry)