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

Commit 560f1263 by 李景熙

添加选择分片后端

parent 12fe970a
......@@ -35,10 +35,10 @@ def create_relation(slice_id, user_id, data_id):
Slice.add_annotation(slice_id)
relation = Relation(slice_id=slice_id, user_id=user_id, data_id=data_id)
relation.save()
except:
return 0
except Exception:
return Result(0, "create failed", {})
else:
return 1
return Result(1, "create success", {})
# 根据用户id找寻标注关系
......@@ -46,9 +46,9 @@ def find_relationbyuserid(user_id):
try:
p = Relation.get(Relation.user_id == user_id)
except Exception:
print(0)
return Result(0, "find failed", {})
else:
print(p.email)
return Result(1, "find success", p.email)
# 根据数据id找标注关系
......@@ -58,9 +58,9 @@ def find_relationbydataid(data_id):
try:
p = Relation.get(Relation.data_id == data_id)
except Exception:
print(0)
return Result(0, "find failed", {})
else:
print(p.email)
return Result(1, "find success", p.email)
if __name__ == '__main__':
......
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