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

Commit 1c436d5b by wyy

模板bug修改

parent b46ce1eb
......@@ -179,17 +179,18 @@ def insertDocument():
return json.dumps(return_dict, ensure_ascii=False)
templateId = get_Data.get('templateId', None)
creatorId = get_Data.get('creatorId', None)
annotatorId = get_Data.get('annotatorId', None)
fileId = get_Data.get('fileId', None)
textUrl = get_Data.get('textUrl', None)
type = get_Data.get('type', None)
if templateId is None or annotatorId is None or fileId is None or textUrl is None or type is None:
if templateId is None or creatorId is None or annotatorId is None or fileId is None or textUrl is None or type is None:
return_dict['return_code'] = '201'
return_dict['return_info'] = '请求参数有误'
return json.dumps(return_dict, ensure_ascii=False)
result = mongodbApi.findOne(collectionTest, {"templateId": templateId, "annotatorId": annotatorId, "fileId": fileId,
result = mongodbApi.findOne(collectionTest, {"templateId": templateId, "creatorId": creatorId, "annotatorId": annotatorId, "fileId": fileId,
"textUrl": textUrl, "type": type})
if result is not None:
......@@ -198,7 +199,7 @@ def insertDocument():
documentId = str(uuid.uuid1()).replace('-', '')
result = mongodbApi.insert(collectionTest, {"documentId": documentId, "templateId": templateId,
result = mongodbApi.insert(collectionTest, {"documentId": documentId, "templateId": templateId, "creatorId": creatorId,
"annotatorId": annotatorId, "fileId": fileId, "textUrl": textUrl, "state": "0",
"type": type, "tokenList": []})
......@@ -330,13 +331,14 @@ def getOneTemplate():
return json.dumps(return_dict, ensure_ascii=False)
templateId = get_Data.get('templateId', None)
creatorId = get_Data.get('creatorId', None)
if templateId is None:
if templateId is None or creatorId is None:
return_dict['return_code'] = '201'
return_dict['return_info'] = '请求参数有误'
return json.dumps(return_dict, ensure_ascii=False)
result = mongodbApi.findOneTemplate(collectionTemplate, {"templateId": templateId})
result = mongodbApi.findOneTemplate(collectionTemplate, {"templateId": templateId, "creatorId": creatorId})
if result is None:
return_dict['return_code'] = '201'
......@@ -362,13 +364,14 @@ def deleteTemplate():
return json.dumps(return_dict, ensure_ascii=False)
templateId = get_Data.get('templateId', None)
creatorId = get_Data.get('creatorId', None)
if templateId is None:
return_dict['return_code'] = '201'
return_dict['return_info'] = '请求参数有误'
return json.dumps(return_dict, ensure_ascii=False)
result = mongodbApi.deleteTemplate(collectionTemplate, {"templateId": templateId})
result = mongodbApi.deleteTemplate(collectionTemplate, {"templateId": templateId, "creatorId": creatorId})
if result is None:
return_dict['return_code'] = '208'
......
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