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
dd0dbd3a
Commit
dd0dbd3a
authored
Jul 18, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
再返回文件列表时同时返回对应标注关系id
parent
cd11ed22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
Data.py
DAPlatform/dao/Data.py
+5
-1
Relation.py
DAPlatform/dao/Relation.py
+9
-0
No files found.
DAPlatform/dao/Data.py
View file @
dd0dbd3a
...
...
@@ -60,12 +60,14 @@ def find_data_by_slice(slice_id):
index
=
0
list
=
[]
while
index
<
len
(
find
):
rid
=
Relation
.
get_relation_id
(
executor
,
find
[
index
]
.
data_id
)
list
.
append
(
{
'id'
:
find
[
index
]
.
data_id
,
'name'
:
find
[
index
]
.
name
,
'size'
:
find
[
index
]
.
size
,
'url'
:
find
[
index
]
.
url
,
'relation_id'
:
rid
}
)
index
+=
1
...
...
@@ -84,13 +86,15 @@ def find_data_by_slice_state(slice_id, executor):
list
=
[]
while
index
<
len
(
find
):
state
=
Relation
.
get_state
(
executor
,
find
[
index
]
.
data_id
)
rid
=
Relation
.
get_relation_id
(
executor
,
find
[
index
]
.
data_id
)
list
.
append
(
{
'id'
:
find
[
index
]
.
data_id
,
'name'
:
find
[
index
]
.
name
,
'size'
:
find
[
index
]
.
size
,
'url'
:
find
[
index
]
.
url
,
'state'
:
int
(
state
)
'state'
:
int
(
state
),
'relation_id'
:
rid
}
)
index
+=
1
...
...
DAPlatform/dao/Relation.py
View file @
dd0dbd3a
...
...
@@ -159,6 +159,15 @@ def get_executors(data_id):
return
Result
(
1
,
"ok"
,
list
)
def
get_relation_id
(
uid
,
did
):
try
:
r
=
Relation
.
get
(
Relation
.
user_id
==
uid
,
Relation
.
data_id
==
did
)
except
:
return
0
else
:
return
r
.
relation_id
if
__name__
==
'__main__'
:
Relation
.
drop_table
()
Relation
.
create_table
()
...
...
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