102 lines
3.0 KiB
Python
102 lines
3.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
# @Author: Owl
|
|
# @Date: 2025/10/20 10:27
|
|
# @Description:
|
|
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
from flask import Flask, request, jsonify, redirect
|
|
from flask_cors import CORS
|
|
from flask_caching import Cache
|
|
from flask_compress import Compress
|
|
from werkzeug.exceptions import UnsupportedMediaType
|
|
|
|
from app.cross_evaluate_worker import *
|
|
from app.phasetable_worker import phase_cross_list
|
|
|
|
app = Flask(__name__)
|
|
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
|
|
CORS(app, resources={r"/api/*": {"origins": "*"}})
|
|
cache_keys = ['userid']
|
|
Compress(app)
|
|
|
|
# @app.before_request
|
|
# def middleware_manage():
|
|
# nodeid = request.args.get('nodeid')
|
|
# area_id = request.args.get('area_id')
|
|
# try:
|
|
# if not nodeid:
|
|
# nodeid = request.json.get('nodeid')
|
|
# if not area_id:
|
|
# area_id = request.json.get('area_id')
|
|
# except UnsupportedMediaType:
|
|
# if not nodeid:
|
|
# nodeid = request.form.get('nodeid')
|
|
# if not area_id:
|
|
# area_id = request.form.get('area_id')
|
|
# if (not nodeid or nodeid not in g_config['nodeid_list']) or (not area_id or area_id not in g_config['area_id_list']):
|
|
# return json.dumps(make_common_res(400, '辖区id异常'), ensure_ascii=False), 200
|
|
#
|
|
# g.nodeid = nodeid
|
|
# g.area_id = area_id
|
|
|
|
|
|
@app.route('/', methods=['GET'])
|
|
def server_info():
|
|
res = make_common_res(0, 'this is cross doctor backend server')
|
|
return json.dumps(res)
|
|
|
|
|
|
@app.route('/api/query_cross_list', methods=['GET'])
|
|
def query_cross_list_api():
|
|
return query_cross_list(dict(request.args))
|
|
|
|
|
|
@app.route('/api/query_cross_usable_date', methods=['GET'])
|
|
def query_cross_usable_date_api():
|
|
return query_cross_usable_date(dict(request.args))
|
|
|
|
|
|
@app.route('/api/query_cross_delay_info', methods=['POST'])
|
|
def query_cross_delay_info_api():
|
|
return query_cross_delay_info_controller(request.json)
|
|
|
|
|
|
@app.route('/api/query_cross_index_trend', methods=['POST'])
|
|
def query_cross_index_trend_api():
|
|
return query_cross_index_trend_controller(request.json)
|
|
|
|
|
|
@app.route('/api/cross_problems', methods=['POST'])
|
|
def cross_problems_api():
|
|
return query_cross_problems(request.json)
|
|
|
|
|
|
@app.route('/api/crosslist', methods=['GET'])
|
|
def phase_cross_list_router():
|
|
return phase_cross_list(dict(request.args))
|
|
|
|
|
|
@app.route('/api/cross_examine_records', methods=['POST'])
|
|
def cross_problems_detail_api():
|
|
return query_cross_examine_records_detail(request.json)
|
|
|
|
|
|
@app.route('/api/update_cross_examine_state', methods=['POST'])
|
|
def update_cross_examine_record_state_api():
|
|
return update_cross_examine_record_state(request.json)
|
|
|
|
|
|
@app.route('/api/explode_cross_problem_detail', methods=['GET'])
|
|
def explode_cross_problem_detail_api():
|
|
return explode_cross_problem_detail(dict(request.args))
|
|
|
|
|
|
from app.user_views import *
|
|
from app.views_task import *
|
|
from app.views_workstation import *
|
|
from app.monitor_views import *
|
|
from app.compare_views import *
|
|
from app.flow_views import *
|
|
|
|
if __name__ == '__main__':
|
|
pass |