def get_best_tags_of_category(request): param = extract_parameter_from_request(request, url_param_type['CATEGORY'], url_param_type['COUNT']) if param and param[url_param_type['CATEGORY']]: return interpreter.pack_up_list( clerk.get_best_tags_list_of_category( param[url_param_type['CATEGORY']], param[url_param_type['COUNT']]), response_list_type['TAGLIST']) else: return json_response(server_status_code['BADREQUEST'])
def get_best_comment(request): param = extract_parameter_from_request(request, url_param_type['POST'], url_param_type['COUNT']) if param and param[url_param_type['POST']]: return interpreter.pack_up_list( clerk.get_best_comment_list(param[url_param_type['POST']], param[url_param_type['COUNT']]), response_list_type['COMMENTLIST']) else: return json_response(server_status_code['BADREQUEST'])
def get_best_of_best_posts(request): param = extract_parameter_from_request(request, url_param_type['COUNT'], url_param_type['THPOST']) if param: #베스트 리스트를 불러오고, 에러가 없다면 결과를 반환한다(error인 경우 result가 false) return interpreter.pack_up_list( clerk.get_best_of_best_post_list(param[url_param_type['COUNT']], param[url_param_type['THPOST']]), response_list_type['POSTLIST']) else: return json_response(server_status_code['BADREQUEST'])
def get_recent_posts_of_tag(request): param = extract_parameter_from_request(request, url_param_type['TAG'], url_param_type['COUNT'], url_param_type['THPOST']) if param and param[url_param_type['TAG']]: return interpreter.pack_up_list( clerk.get_recent_post_list_in_tag(param[url_param_type['TAG']], param[url_param_type['COUNT']], param[url_param_type['THPOST']]), response_list_type['POSTLIST']) else: return json_response(server_status_code['BADREQUEST'])
def get_user_post_collection(request): param = extract_parameter_from_request(request, url_param_type['USER'], url_param_type['COUNT'], url_param_type['THPOST']) if param and param[url_param_type['USER']]: return interpreter.pack_up_list( clerk.get_user_post_collection(param[url_param_type['USER']], param[url_param_type['COUNT']], param[url_param_type['THPOST']]), response_list_type['USERCOLLECTION']) else: return json_response(server_status_code['BADREQUEST'])
def get_user_upload_posts(request, access_token=None): param = extract_parameter_from_request(request, url_param_type['USER'], url_param_type['COUNT'], url_param_type['THPOST']) if param and param[url_param_type['USER']]: request_user_id = gate_keeper.extract_user_id_from_access_token( access_token) if access_token else None return interpreter.pack_up_list( clerk.get_user_upload_posts(param[url_param_type['USER']], param[url_param_type['COUNT']], param[url_param_type['THPOST']], request_user_id), response_list_type['POSTLIST']) else: return json_response(server_status_code['BADREQUEST'])
def auto_complete_contents(request): param = extract_parameter_from_request(request, url_param_type['NICKNAME'], url_param_type['TAG'], url_param_type['COUNT']) if param: target_id, target_type = interpreter.get_target_content_info(param) if target_id and target_type: if param[url_param_type['NICKNAME']]: list_type = response_list_type['USERLIST'] else: list_type = response_list_type['TAGLIST'] return interpreter.pack_up_list( clerk.auto_complete_contents(target_id, param[url_param_type['COUNT']], target_type), list_type) return json_response(server_status_code['BADREQUEST'])
def get_category_list(request): #카테고리를 불러온 뒤에, 에러가 없다면 결과를 반환한다 return interpreter.pack_up_list(clerk.get_category_list(), response_list_type['CATEGORYLIST'])