Commit f64db092 by dong

fix20230223

parent ce10148e
......@@ -517,11 +517,44 @@ def collection_carrier():
return jsonify(code=RET.DBERR, msg='收藏失败。')
# 收藏列表
@api_xiaocx.route('/CollectionList', methods=['POST'])
# 收藏载体
@api_xiaocx.route('/CollectionCarrier', methods=['POST'])
# @login_required
def collection_list():
def collection_carrier():
req_dict = request.get_json()
id_list = req_dict.get("id_list")
flag = req_dict.get("flag") # 1地块,2楼宇,3厂房,4园区,5项目,6企业
token = request.headers["token"]
user_obj = verify_token(token)
try:
for _id in id_list:
if flag == 1:
user_obj.user_land.pop(_id)
elif flag == 2:
user_obj.user_build.pop(_id)
elif flag == 3:
user_obj.user_factory.pop(_id)
elif flag == 4:
user_obj.user_zone.pop(_id)
elif flag == 5:
user_obj.user_project.pop(_id)
elif flag == 6:
user_obj.user_company.pop(_id)
else:
pass
user_obj.commit()
return jsonify(code=RET.OK, msg='取消收藏成功。')
except Exception as e:
return jsonify(code=RET.DBERR, msg='取消收藏失败。')
# 取消收藏
@api_xiaocx.route('/CancelCollection', methods=['POST'])
# @login_required
def cancel_collection():
req_dict = request.get_json()
id_list = req_dict.get("id_list")
flag = req_dict.get("flag") # 1地块,2楼宇,3厂房,4园区,5项目,6企业
token = request.headers["token"]
......
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