2021-12-21 11:06:58 +08:00
|
|
|
from flask import Blueprint, request
|
2021-12-13 16:04:10 +08:00
|
|
|
|
|
|
|
from common.auth import verify_token
|
2022-01-26 17:34:59 +08:00
|
|
|
from company.company_obj import CompanyIndex
|
2021-12-13 16:04:10 +08:00
|
|
|
|
|
|
|
company_route = Blueprint('company', __name__)
|
|
|
|
|
|
|
|
|
2022-01-27 17:01:38 +08:00
|
|
|
@company_route.route('/head_info', methods=['GET'])
|
|
|
|
@verify_token
|
|
|
|
def head_info_route(**kwargs):
|
|
|
|
company = CompanyIndex()
|
|
|
|
company.cid = kwargs['cid']
|
|
|
|
info, result = company.get_head_info()
|
|
|
|
return {"info": info, "result": result}, 200
|
|
|
|
|
|
|
|
|
2021-12-21 11:06:58 +08:00
|
|
|
@company_route.route('/company_index', methods=['POST'])
|
2021-12-13 16:04:10 +08:00
|
|
|
@verify_token
|
2022-01-27 17:01:38 +08:00
|
|
|
def company_index_route(**kwargs):
|
2021-12-17 17:15:20 +08:00
|
|
|
"""
|
2022-01-26 17:34:59 +08:00
|
|
|
企业主页接口
|
2021-12-17 17:15:20 +08:00
|
|
|
Parameters:
|
|
|
|
param desc
|
|
|
|
Returns:
|
|
|
|
res: desc
|
|
|
|
"""
|
|
|
|
company_index = CompanyIndex()
|
|
|
|
company_index.cid = kwargs['cid']
|
2022-01-27 17:01:38 +08:00
|
|
|
company_index.tab = request.json['table']
|
2022-01-26 17:34:59 +08:00
|
|
|
|
2022-01-27 17:01:38 +08:00
|
|
|
if company_index.tab != '指标明细':
|
2021-12-24 15:24:26 +08:00
|
|
|
info, result = company_index.get_company_data_obj()
|
2022-01-27 17:01:38 +08:00
|
|
|
elif company_index.tab == '综合评价分析':
|
2021-12-27 16:36:42 +08:00
|
|
|
info, result = company_index.get_index_detail_obj()
|
|
|
|
result.pop('企业名称')
|
|
|
|
result.pop('综合信用等级')
|
2021-12-24 15:24:26 +08:00
|
|
|
else:
|
|
|
|
info, result = company_index.get_index_detail_obj()
|
2021-12-27 16:30:57 +08:00
|
|
|
return {"info": info, "result": result}, 200
|
2022-02-09 17:34:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
@company_route.route('/industry_analysis', methods=['GET'])
|
|
|
|
@verify_token
|
|
|
|
def industry_analysis_route(**kwargs):
|
|
|
|
"""
|
|
|
|
宏观行业分析
|
|
|
|
"""
|
|
|
|
ci = CompanyIndex()
|
|
|
|
ci.cid = kwargs['cid']
|