diff --git a/company/company_impl.py b/company/company_impl.py index 1d985cc..9de9ffe 100644 --- a/company/company_impl.py +++ b/company/company_impl.py @@ -59,18 +59,17 @@ def get_industry_analysis_impl(cid): return data -def esg_analysis_impl(cid): +def get_esg_rating_impl(cid): """ ESG要素分析数据 - Parameters: - cid: str 企业ID + cid: str 企业ID Returns: - Case Success: - data: dict ESG分析数据 - Case Fail: - data: dict 空字典 + Case Success: + data: dict ESG分析数据 + Case Fail: + data: dict 空字典 """ - data = FIND_DATA_IN_COMPANY('ESG要素分析', {"企业ID": cid}) + data = FIND_SINGLE_DATA_BY_REQ('企业数据', 'ESG评价分析', {"企业ID": cid}, ["更新日期", "ESG评级", "维度得分情况", "实质性议题得分情况", "实质性议题"]) if data is False: return {} diff --git a/company/company_obj.py b/company/company_obj.py index be1e242..8d2110f 100644 --- a/company/company_obj.py +++ b/company/company_obj.py @@ -1,4 +1,4 @@ -from company.company_impl import get_head_info_impl, get_industry_analysis_impl, esg_analysis_impl, get_cc_rating_impl, \ +from company.company_impl import get_head_info_impl, get_industry_analysis_impl, get_esg_rating_impl, get_cc_rating_impl, \ get_basic_info_impl @@ -24,5 +24,5 @@ class CompanyIndex: def get_cc_rating(self): return get_cc_rating_impl(self.cid) - def esg_analysis(self): - return esg_analysis_impl(self.cid) + def get_esg_rating(self): + return get_esg_rating_impl(self.cid) diff --git a/company/company_routes.py b/company/company_routes.py index 7ab0f6c..493a7c2 100644 --- a/company/company_routes.py +++ b/company/company_routes.py @@ -37,7 +37,7 @@ def cc_rating_route(**kwargs): @verify_token def industry_analysis_route(**kwargs): """ - 宏观行业分析 + 行业分析 """ company_index = CompanyIndex() company_index.cid = kwargs['cid'] @@ -45,9 +45,9 @@ def industry_analysis_route(**kwargs): return {"info": "查询结果", "result": result} -@company_route.route('/esg_analysis', methods=['GET']) +@company_route.route('/esg_rating', methods=['GET']) @verify_token -def esg_analysis_route(**kwargs): +def esg_rating_route(**kwargs): """ ESG分析数据 Parameters: @@ -55,7 +55,7 @@ def esg_analysis_route(**kwargs): Returns: res: desc """ - ci = CompanyIndex() - ci.cid = kwargs['cid'] - result = ci.esg_analysis() - return {"info": "查询成功", "result": result} + company_index = CompanyIndex() + company_index.cid = kwargs['cid'] + result = company_index.get_esg_rating() + return {"info": "查询结果", "result": result}