文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit ffe4e5d4 by 李景熙

添加获取文件列表的接口

parent 5c668a0c
...@@ -46,6 +46,27 @@ def find_data(id): ...@@ -46,6 +46,27 @@ def find_data(id):
return Result(1, "find success", data.url) return Result(1, "find success", data.url)
# 查找某分片下的文件
def find_data_by_slice(slice_id):
try:
find = Data.select(Data.data_id, Data.name).where(
Data.slice_id == slice_id)
index = 0
list = []
while index < len(find):
list.append(
{
'id': find[index].data_id,
'name': find[index].name
}
)
index += 1
except:
return Result(0, "find failed", {})
else:
return Result(1, "find success", list)
if __name__ == '__main__': if __name__ == '__main__':
Data.drop_table() Data.drop_table()
Data.create_table() Data.create_table()
...@@ -5,6 +5,7 @@ from views.uploadDownload import uploadDownload ...@@ -5,6 +5,7 @@ from views.uploadDownload import uploadDownload
from views.user import user from views.user import user
from views.task import task from views.task import task
from views.slice import slice from views.slice import slice
from views.file import data
# from views.imageAnnotation import image # from views.imageAnnotation import image
from config.config import DevelopmentConfig from config.config import DevelopmentConfig
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment