def edit_verification_gate(): request_url = None if request.method == 'GET': request_url = request.args elif request.method == 'POST': request_url = request.form id = request_url.get('id', '') verification_gate = request_url.get('verification_gate', '') _ret = {'code': 200, 'status': 'success', 'errmsg': ''} if id == '': _ret['code'] = 400 _ret['status'] = 'failed' _ret['errmsg'] = '缺少参数 id' return json.dumps(_ret) result = MysqlClass().edit_verification_gate(id, verification_gate) if result[0] == 200: return json.dumps(_ret) else: _ret['code'] = 500 _ret['status'] = 'failed' _ret['errmsg'] = result[1] return json.dumps(_ret)
def edit_alert_data(): request_url = None if request.method == 'GET': request_url = request.args elif request.method == 'POST': request_url = request.form id = request_url.get('id', '') color = request_url.get('color', '') alert_data = request_url.get('alert_data', '') _ret = {'code': 200, 'status': 'success', 'errmsg': ''} # # if str(color) == '3' and alert_data == '': # _ret['code'] = 400 # _ret['status'] = 'failed' # _ret['errmsg'] = '缺少参数 alert_data' # return json.dumps(_ret) if id == '': _ret['code'] = 400 _ret['status'] = 'failed' _ret['errmsg'] = '缺少参数 id' return json.dumps(_ret) result = MysqlClass().edit_alert_data(id, color, alert_data) if result[0] == 200: return json.dumps(_ret) else: _ret['code'] = 500 _ret['status'] = 'failed' _ret['errmsg'] = result[1] return json.dumps(_ret)
def get_all_data(): _ret = {'code': 200, 'message': '获取全部信息成功', 'data': {}} result = MysqlClass().get_all_data() if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)
def get_drop_list_data(): batch = request.args.get('batch', '') _ret = {'code': 200, 'message': '获取成功', 'data': {}} result = MysqlClass().get_drop_list_data(batch) if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)
def get_drop_id_name(): _ret = {'code': 200, 'status': 'success', 'data': '', 'errmsg': ''} result = MysqlClass().get_drop_id_name() if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['status'] = 'failed' _ret['errmsg'] = result[1] return json.dumps(_ret)
def edit_all_data(): all_batch_num = request.args.get('all_batch_num', '') all_batch_speed = request.args.get('all_batch_speed', '') _ret = {'code': 200, 'message': '修改全部信息成功', 'data': {}} result = MysqlClass().edit_all_data(all_batch_num, all_batch_speed) if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)
def delete_drop_data(): id = request.args.get('id', '') _ret = {'code': 200, 'message': '删除点位信息成功', 'data': {}} result = MysqlClass().mysql_delete_drop_data(id) if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)
def add_drop_data(): drop_name = request.args.get('drop_name', '') batch = request.args.get('batch', 1) site = request.args.get('site', '') color = request.args.get('color', '') state = request.args.get('state', '') drop_radiation_speed = request.args.get('drop_radiation_speed', '') _ret = {'code': 200, 'message': '添加点位信息成功', 'data': {}} result = MysqlClass().mysql_add_drop_data(drop_name, batch, site, color, drop_radiation_speed, state) if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)
def update_drop_data(): id = request.args.get('id', 1) drop_name = request.args.get('drop_name', '') site = request.args.get('site', '') color = request.args.get('color', '') state = request.args.get('state', '') batch = request.args.get('batch', '') drop_radiation_speed = request.args.get('drop_radiation_speed', '') # 放射线速度 _ret = {'code': 200, 'message': '修改点位信息成功', 'data': {}} result = MysqlClass().mysql_update_drop_data(id, site, color, batch, drop_radiation_speed, state, drop_name) if result[0] == 200: _ret['data'] = result[1] return json.dumps(_ret) else: _ret['code'] = 500 _ret['message'] = result[1] return json.dumps(_ret)