Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
d7c6ee91
Commit
d7c6ee91
authored
Jul 22, 2020
by
wyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文本导出后端
parent
d653226e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
uploadDownload.py
DAPlatform/views/uploadDownload.py
+15
-6
No files found.
DAPlatform/views/uploadDownload.py
View file @
d7c6ee91
...
@@ -126,12 +126,6 @@ def get_image_file(imageName):
...
@@ -126,12 +126,6 @@ def get_image_file(imageName):
return
jsonify
({
"code"
:
0
,
"errmsg"
:
repr
(
e
)})
return
jsonify
({
"code"
:
0
,
"errmsg"
:
repr
(
e
)})
# 根据图片名称返回图片文件
# def export_image(imageName):
# image = Image.objects(relationId__in=relation_list)
# return False
# documentId获取文本内容
# documentId获取文本内容
@uploadDownload.route
(
'/getFileContent'
,
methods
=
[
'POST'
])
@uploadDownload.route
(
'/getFileContent'
,
methods
=
[
'POST'
])
def
getFileContent
():
def
getFileContent
():
...
@@ -230,3 +224,18 @@ def getExcelContent():
...
@@ -230,3 +224,18 @@ def getExcelContent():
data
.
update
({
"content"
:
statement
})
data
.
update
({
"content"
:
statement
})
return_dict
[
"result"
]
=
data
return_dict
[
"result"
]
=
data
return
json
.
dumps
(
return_dict
,
ensure_ascii
=
False
)
return
json
.
dumps
(
return_dict
,
ensure_ascii
=
False
)
# 下载文本
@uploadDownload.route
(
'/downloadContent'
,
methods
=
[
'POST'
])
def
downloadContent
():
get_Data
=
request
.
get_data
()
get_Data
=
json
.
loads
(
get_Data
)
documentId
=
get_Data
.
get
(
'documentId'
)
result
=
mongodbApi
.
findOne
(
collectionTest
,
{
"documentId"
:
documentId
})
url
=
result
.
get
(
'textUrl'
)
file_dir
=
os
.
path
.
join
(
basedir
,
UPLOAD_FOLDER
,
url
)
return
send_file
(
file_dir
,
as_attachment
=
True
,
attachment_filename
=
url
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment