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
42813969
Commit
42813969
authored
Jul 05, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改删除任务功能,使其同时删除保存的文件
parent
d7250f00
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
20 deletions
+32
-20
package-lock.json
DAPlatform-front/package-lock.json
+16
-16
Data.py
DAPlatform/Dao/Data.py
+16
-4
slice.py
DAPlatform/views/slice.py
+0
-0
No files found.
DAPlatform-front/package-lock.json
View file @
42813969
...
...
@@ -2222,8 +2222,8 @@
},
"complex.js"
:
{
"version"
:
"2.0.11"
,
"resolved"
:
"https://registry.npm
.taobao.org/complex.js/download
/complex.js-2.0.11.tgz"
,
"integrity"
:
"sha
1-Cahz+/Ff/YwYycIgHM70JcMri/E
="
"resolved"
:
"https://registry.npm
js.org/complex.js/-
/complex.js-2.0.11.tgz"
,
"integrity"
:
"sha
512-6IArJLApNtdg1P1dFtn3dnyzoZBEF0MwMnrfF1exSBRpZYoy4yieMkpZhQDC0uwctw48vii0CFVyHfpgZ/DfGw=
="
},
"component-emitter"
:
{
"version"
:
"1.3.0"
,
...
...
@@ -3538,8 +3538,8 @@
},
"decimal.js"
:
{
"version"
:
"10.2.0"
,
"resolved"
:
"https://registry.npm
.taobao.org/decimal.js/download
/decimal.js-10.2.0.tgz"
,
"integrity"
:
"sha
1-OUZhE6ngNhEdAvgkibX9awte0jE
="
"resolved"
:
"https://registry.npm
js.org/decimal.js/-
/decimal.js-10.2.0.tgz"
,
"integrity"
:
"sha
512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw=
="
},
"decode-uri-component"
:
{
"version"
:
"0.2.0"
,
...
...
@@ -4103,8 +4103,8 @@
},
"escape-latex"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npm
.taobao.org/escape-latex/download
/escape-latex-1.2.0.tgz"
,
"integrity"
:
"sha
1-B8A4GM99rCUMzlF/T9obAB7yvKE
="
"resolved"
:
"https://registry.npm
js.org/escape-latex/-
/escape-latex-1.2.0.tgz"
,
"integrity"
:
"sha
512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=
="
},
"escape-string-regexp"
:
{
"version"
:
"1.0.5"
,
...
...
@@ -4998,8 +4998,8 @@
},
"fraction.js"
:
{
"version"
:
"4.0.12"
,
"resolved"
:
"https://registry.npm
.taobao.org/fraction.js/download
/fraction.js-4.0.12.tgz"
,
"integrity"
:
"sha
1-BSbUfGWl+0hU33i8d/e+xwjXuMM
="
"resolved"
:
"https://registry.npm
js.org/fraction.js/-
/fraction.js-4.0.12.tgz"
,
"integrity"
:
"sha
512-8Z1K0VTG4hzYY7kA/1sj4/r1/RWLBD3xwReT/RCrUCbzPszjNQCCsy3ktkU/eaEqX3MYa4pY37a52eiBlPMlhA=
="
},
"fragment-cache"
:
{
"version"
:
"0.2.1"
,
...
...
@@ -6704,7 +6704,7 @@
},
"javascript-natural-sort"
:
{
"version"
:
"0.7.1"
,
"resolved"
:
"https://registry.npm
.taobao.org/javascript-natural-sort/download
/javascript-natural-sort-0.7.1.tgz"
,
"resolved"
:
"https://registry.npm
js.org/javascript-natural-sort/-
/javascript-natural-sort-0.7.1.tgz"
,
"integrity"
:
"sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k="
},
"js-base64"
:
{
...
...
@@ -7069,8 +7069,8 @@
},
"mathjs"
:
{
"version"
:
"7.0.2"
,
"resolved"
:
"https://registry.npm
.taobao.org/mathjs/download/mathjs-7.0.2.tgz?cache=0&sync_timestamp=1592989416336&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmathjs%2Fdownload%2F
mathjs-7.0.2.tgz"
,
"integrity"
:
"sha
1-8X6uKJqjpd5UPCLAXOMnFWBFRIA
="
,
"resolved"
:
"https://registry.npm
js.org/mathjs/-/
mathjs-7.0.2.tgz"
,
"integrity"
:
"sha
512-+/HTkdie4Sek66mjcclk2cgTyVgFfykutk5PGspbtZHUBbS3lOeiM8/Ax7P6nQlz1KoellFAU/kGO4q7Yv1sZA=
="
,
"requires"
:
{
"complex.js"
:
"^2.0.11"
,
"decimal.js"
:
"^10.2.0"
,
...
...
@@ -11389,7 +11389,7 @@
},
"seed-random"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npm
.taobao.org/seed-random/download
/seed-random-2.2.0.tgz"
,
"resolved"
:
"https://registry.npm
js.org/seed-random/-
/seed-random-2.2.0.tgz"
,
"integrity"
:
"sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ="
},
"select-hose"
:
{
...
...
@@ -12359,8 +12359,8 @@
},
"tiny-emitter"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npm
.taobao.org/tiny-emitter/download
/tiny-emitter-2.1.0.tgz"
,
"integrity"
:
"sha
1-HRpW7fxRxD6GPLtTgqcjMONVVCM
="
"resolved"
:
"https://registry.npm
js.org/tiny-emitter/-
/tiny-emitter-2.1.0.tgz"
,
"integrity"
:
"sha
512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=
="
},
"tmp"
:
{
"version"
:
"0.0.33"
,
...
...
@@ -12506,8 +12506,8 @@
},
"typed-function"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npm
.taobao.org/typed-function/download/typed-function-1.1.1.tgz?cache=0&sync_timestamp=1593755771661&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftyped-function%2Fdownload%2F
typed-function-1.1.1.tgz"
,
"integrity"
:
"sha
1-oTFhh+w2KMniGbkcqWkYZgoQE44
="
"resolved"
:
"https://registry.npm
js.org/typed-function/-/
typed-function-1.1.1.tgz"
,
"integrity"
:
"sha
512-RbN7MaTQBZLJYzDENHPA0nUmWT0Ex80KHItprrgbTPufYhIlTePvCXZxyQK7wgn19FW5bnuaBIKcBb5mRWjB1Q=
="
},
"typedarray"
:
{
"version"
:
"0.0.6"
,
...
...
DAPlatform/Dao/Data.py
View file @
42813969
import
os
from
peewee
import
*
from
Dao.model
import
mysql
from
Dao
import
Slice
from
support
import
basedir
UPLOAD_FOLDER
=
'upload'
class
Result
:
...
...
@@ -47,7 +52,7 @@ def find_data(id):
return
Result
(
1
,
"find success"
,
data
.
url
)
# 查找某分片下的文件
# 查找某分片下的文件
(用于查看某分片下的文件信息)
def
find_data_by_slice
(
slice_id
):
try
:
find
=
Data
.
select
(
Data
.
data_id
,
Data
.
name
,
Data
.
size
,
Data
.
url
)
.
where
(
...
...
@@ -71,7 +76,7 @@ def find_data_by_slice(slice_id):
return
Result
(
1
,
"find success"
,
list
)
# 查找分片下的文件
url列表
# 查找分片下的文件
列表(用于修改任务时传回文件信息)
def
find_url_by_slice
(
slice_id
):
try
:
find
=
Data
.
select
(
Data
.
url
,
Data
.
name
,
Data
.
size
)
.
where
(
...
...
@@ -94,6 +99,13 @@ def find_url_by_slice(slice_id):
# 删除某分片下的文件
def
delete_data_by_slice
(
slice_id
):
try
:
find
=
Data
.
select
(
Data
.
url
)
.
where
(
Data
.
slice_id
==
slice_id
)
index
=
0
while
index
<
len
(
find
):
file_dir
=
os
.
path
.
join
(
basedir
,
UPLOAD_FOLDER
,
find
[
index
]
.
url
)
if
os
.
path
.
exists
(
file_dir
):
os
.
remove
(
file_dir
)
index
+=
1
Data
.
delete
()
.
where
(
Data
.
slice_id
==
slice_id
)
.
execute
()
except
:
return
Result
(
0
,
"delete failed"
,
{})
...
...
@@ -102,4 +114,4 @@ def delete_data_by_slice(slice_id):
if
__name__
==
'__main__'
:
Data
.
create_table
()
\ No newline at end of file
delete_data_by_slice
(
10
)
\ No newline at end of file
DAPlatform/views/slice.py
View file @
42813969
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