def add_links_from_json_file(): # FIXME need test file = request.files['json_file'] action_result = UserManager.add_user_batch(file) resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def get_user_by_id(): param = UserQueryByIdParam() if param.validate_on_submit(): action_result = UserManager.get_user_by_id(param.user_id.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def user_update(): param = UserUpdateParam() if param.validate_on_submit(): action_result = UserManager.update_user(param.user_info.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def user_del(): post = UserDeleteParam() if post.validate_on_submit(): action_result = UserManager.del_users_by_ids(post.user_ids.data) else: action_result = post.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def user_add(): post = UserAddParam() if post.validate_on_submit(): action_result = UserManager.add_user(post.user_info.data) else: action_result = post.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def get_users_by_page(): param = UserQueryParam() if param.validate_on_submit(): action_result = UserManager.get_users_by_page(param.page.data, param.page_size.data, param.conditions.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp