Commit ec8dad25 by dong

fix20230104

parent 832d5bc7
...@@ -76,10 +76,21 @@ def find_up_thr(name_query, relation): ...@@ -76,10 +76,21 @@ def find_up_thr(name_query, relation):
@api_atlas.route('/industry/cluster', methods=['GET']) @api_atlas.route('/industry/cluster', methods=['GET'])
def get_cluster(): def get_cluster():
try: try:
# cluster_obj = IndustryChain.query.filter_by(industry_type=0, cluster_obj = IndustryChain.query.filter_by(industry_type=0,
# status=1).all() status=1).all()
cluster_obj = Industry.query.all() # cluster_obj = Industry.query.all()
# data = {
# "cluster": [
# {"id": i.nid, 'industry_level': 1,
# 'name': i.name,
# "subNodeList": [
# {'id': j.nid,
# 'industry_level': 2,
# "name": j.name
# } for j in Industry.query.filter_by(fid=i.nid)
# ]} for i in cluster_obj]
# }
data = { data = {
"cluster": [ "cluster": [
{"id": i.nid, 'industry_level': 1, {"id": i.nid, 'industry_level': 1,
...@@ -91,9 +102,7 @@ def get_cluster(): ...@@ -91,9 +102,7 @@ def get_cluster():
} for j in Industry.query.filter_by(fid=i.nid) } for j in Industry.query.filter_by(fid=i.nid)
]} for i in cluster_obj] ]} for i in cluster_obj]
} }
data = [{"id": i.id, 'name': i.industry_name} for i in cluster_obj] return jsonify(code=RET.OK, msg='产业集群名称获取成功!', data=data)
print('发起请求')
return jsonify(code=RET.OK, msg='产业名称获取成功!', data=data)
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
......
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