tfse-admin-api-v0.2/Manage/industry/industry_routes.py

26 lines
739 B
Python
Raw Normal View History

2022-02-10 16:26:56 +08:00
from flask import Blueprint, request
2022-02-09 17:34:10 +08:00
2022-02-10 16:26:56 +08:00
from Manage.industry.industry_obj import PrimaryIndustry
2022-02-09 17:34:10 +08:00
2022-02-10 16:26:56 +08:00
industry_route = Blueprint('/manage/industry', __name__)
2022-02-09 17:34:10 +08:00
2022-02-10 16:26:56 +08:00
@industry_route.route('/create_primary_industry', methods=['POST'])
def create_primary_industry_routes(**kwargs):
body = request.json
pi = PrimaryIndustry()
pi.name = body['行业']
pi.introduction = body['行业简介']
pi.positive_factors = body['正面因素']
pi.negative_factors = body['负面因素']
pi.increase_trend = body['增长趋势']
pi.scale_distribution = body['规模分布']
res = pi.update_analysis_data()
if res is True:
return {"info": "操作成功"}, 200
else:
return {"info": "操作失败"}, 200