add delete project api
This commit is contained in:
parent
e8c2c06dd6
commit
e73e573dd5
|
@ -66,7 +66,7 @@ def query_file():
|
|||
def get_json():
|
||||
ret_info = ReturnInfo()
|
||||
try:
|
||||
|
||||
|
||||
project_name = request.args.get("projectName")
|
||||
download_json = []
|
||||
anno_data = read_json_file(PROJECT_PATH.format(project_name)+'/anno.json')
|
||||
|
|
|
@ -16,7 +16,21 @@ from ...entities.entities import AnnoContents
|
|||
|
||||
api = RedPrint('project')
|
||||
|
||||
@api.route('/delete_program', methods=['GET'])
|
||||
def delete_program():
|
||||
ret_info = ReturnInfo()
|
||||
try:
|
||||
project_name = request.args.get('projectName')
|
||||
project_path = PROJECT_PATH.format(project_name)
|
||||
|
||||
shutil.rmtree(project_path)
|
||||
print("ok")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
ret_info.errCode = 404
|
||||
ret_info.errMsg = str(e)
|
||||
|
||||
return json.dumps(ret_info, default=lambda o: o.__dict__)
|
||||
@api.route('/get_zipped_data', methods=['POST'])
|
||||
def get_zipped_data():
|
||||
ret_info = ReturnInfo()
|
||||
|
|
|
@ -1 +1 @@
|
|||
[{"fileName": "first.txt", "annoDetails": [{"name": "是一个测", "type": "test1", "start": 1, "end": 5, "isSmall": false}, {"name": "测", "type": "test2", "start": 4, "end": 5, "isSmall": true}, {"name": "文", "type": "test2", "start": 6, "end": 7}], "isAnno": true}]
|
||||
[{"fileName": "first.txt", "annoDetails": [{"name": "是一个测", "type": "test1", "start": 1, "end": 5, "isSmall": false}, {"name": "测", "type": "test2", "start": 4, "end": 5, "isSmall": true}, {"name": "文", "type": "test2", "start": 6, "end": 7}], "isAnno": true}, {"fileName": "second.txt", "annoDetails": [{"name": "点亮", "type": "test1", "start": 2, "end": 4}], "isAnno": true}, {"fileName": "test.txt", "annoDetails": [{"name": "一种信", "type": "test1", "start": 3, "end": 6}], "isAnno": true}, {"fileName": "txt.txt", "annoDetails": [{"name": "试文件", "type": "test1", "start": 5, "end": 8}], "isAnno": true}]
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -0,0 +1 @@
|
|||
这是一个新增文件
|
|
@ -4,4 +4,5 @@
|
|||
| -------------------------- | ------- | -------------------------------------------------------- | -------------------------------- |
|
||||
| v1/project/get_zipped_data | POST | projectName:项目名 file:数据集文件(目前只支持.zip格式) | json :errcode表示是否成功导入 |
|
||||
| v1/files/get_json | GET | projectName:项目名 | file(.json格式的数据集标注结果) |
|
||||
|v1/project/delete_program |GET |projectName:项目名|json:errcode表示是否成功|
|
||||
|
||||
|
|
Loading…
Reference in New Issue