add delete project api

This commit is contained in:
xgdyp 2021-07-14 20:33:58 +08:00
parent e8c2c06dd6
commit e73e573dd5
10 changed files with 23 additions and 2 deletions

View File

@ -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()

View File

@ -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}]

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -0,0 +1 @@
这是一个新增文件

View File

@ -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:项目名|jsonerrcode表示是否成功|