def get_worthy_links(): param = WorthyQueryParam() if param.validate_on_submit(): action_result = LinkRecommendManager.get_link_from_worthy_table( 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
def update_primary_link(): param = WorthyUpdateParam() if param.validate_on_submit(): action_result = LinkRecommendManager.update_primary_link( param.worthy_info.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def del_worthy_link(): param = WorthyDeleteParam() if param.validate_on_submit(): action_result = LinkRecommendManager.delete_link_from_worthy_table( param.worthy_ids.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
def add_primary_link(): param = WorthyAddParam() if param.validate_on_submit(): action_result = LinkRecommendManager.add_link_to_primary_table( param.link_ids.data) else: action_result = param.check_result resp = jsonify(action_result.pack()) resp.headers['Access-Control-Allow-Origin'] = '*' return resp