Merge branch 'to' into 'master'

update 新增应用端查询esg报告/证书接口

See merge request root/tfse_app_api!3
This commit is contained in:
FECR-IBD 2022-03-21 07:38:30 +00:00
commit 07b58b8847
3 changed files with 65 additions and 1 deletions

View File

@ -23,3 +23,27 @@ def company_general_rating_certification_by_fid(fid):
""" """
filestream = find_file('评价证书', fid) filestream = find_file('评价证书', fid)
return filestream return filestream
def company_esg_rating_report_by_fid(fid):
"""
根据fid返回文件
Args:
fid:
Returns:
filestream
"""
filestream = find_file('esg报告', fid)
return filestream
def company_esg_rating_certification_by_fid(fid):
"""
根据fid返回文件
Args:
fid:
Returns:
filestream
"""
filestream = find_file('ESG评价证书', fid)
return filestream

View File

@ -1,4 +1,4 @@
from file.file_impl import company_general_rating_report_by_fid, company_general_rating_certification_by_fid from file.file_impl import *
class TfseFile: class TfseFile:
@ -11,3 +11,9 @@ class TfseFile:
def get_general_certification(self): def get_general_certification(self):
return company_general_rating_certification_by_fid(self.fid) return company_general_rating_certification_by_fid(self.fid)
def get_esg_report(self):
return company_esg_rating_report_by_fid(self.fid)
def get_esg_certification(self):
return company_esg_rating_certification_by_fid(self.fid)

View File

@ -38,3 +38,37 @@ def get_certification_route(**kwargs):
tfse_file.fid = request.args.get('file_id') tfse_file.fid = request.args.get('file_id')
response = Response(tfse_file.get_general_certification(), content_type='application/pdf') response = Response(tfse_file.get_general_certification(), content_type='application/pdf')
return response return response
@file_route.route('/get_company_esg_report', methods=['GET'])
@verify_token
@verify_report_view_auth
def get_esg_company_report(**kwargs):
"""
查看公司ESG评价报告
Parameters:
-
Returns:
response pdf二进制文件流
"""
tfse_file = TfseFile()
tfse_file.fid = request.args.get('file_id')
response = Response(tfse_file.get_esg_report(), content_type='application/pdf')
return response
@file_route.route('/get_esg_certification', methods=['GET'])
@verify_token
@verify_report_view_auth
def get_esg_certification_route(**kwargs):
"""
查看公司评价结果证书
Parameters:
-
Returns:
response pdf二进制文件流
"""
tfse_file = TfseFile()
tfse_file.fid = request.args.get('file_id')
response = Response(tfse_file.get_esg_certification(), content_type='application/pdf')
return response