Merge branch 'ps' into 'master'

update 更改pdf存储位置

See merge request root/tfse_rating!6
This commit is contained in:
王思川 2021-12-26 17:01:37 +00:00
commit e3066527f6
1 changed files with 4 additions and 4 deletions

View File

@ -21,8 +21,8 @@ def upload_pdf(name):
根据名称保存该企业报告
"""
path = get_gen_report_path(name=name)
database = '企业'
collection = 'PDF'
database = '评价'
collection = '综合信用报告'
fs = GridFS(client[database], collection)
content = open(path, 'rb').read()
pdf_id = fs.put(content, content_type='application/pdf', filename=name)
@ -34,8 +34,8 @@ def download_pdf(pdf_id):
"""
根据pdf_id查询pdf文件
"""
database = '企业'
collection = 'PDF'
database = '评价'
collection = '综合信用报告'
fs = GridFS(client[database], collection)
data = fs.get(ObjectId(pdf_id)).read()