<s> """<STR_LIT>""" <EOL> from flask import Blueprint , g , request <EOL> import bombolone . core . rank <EOL> from bombolone . core . utils import jsonify , set_message <EOL> from bombolone . decorators import authentication , check_rank , get_hash <EOL> api_rank = Blueprint ( '<STR_LIT>' , __name__ ) <EOL> @ api_rank . route ( '<STR_LIT>' ) <EOL> @ authentication <EOL> @ get_hash ( '<STR_LIT>' ) <EOL> def show ( ) : <EOL> """<STR_LIT:U+0020>""" <EOL> rank_id = request . args . get ( "<STR_LIT>" , None ) <EOL> data = core . rank . show ( rank_id = rank_id ) <EOL> data = set_message ( data ) <EOL> return jsonify ( data ) <EOL> @ api_rank . route ( '<STR_LIT>' , methods = [ '<STR_LIT:POST>' ] ) <EOL> @ authentication <EOL> @ check_rank ( <NUM_LIT:10> ) <EOL> @ get_hash ( '<STR_LIT>' ) <EOL> def create ( ) : <EOL> """<STR_LIT:U+0020>""" <EOL> name = request . json . get ( "<STR_LIT:name>" , None ) <EOL> rank = request . json . get ( "<STR_LIT>" , None ) <EOL> data = core . rank . create ( name = name , rank = rank ) <EOL> data = set_message ( data ) <EOL> return jsonify ( data ) <EOL> @ api_rank . route ( '<STR_LIT>' , methods = [ '<STR_LIT:POST>' ] ) <EOL> @ authentication <EOL> @ check_rank ( <NUM_LIT:10> ) <EOL> @ get_hash ( '<STR_LIT>' ) <EOL> def update ( ) : <EOL> """<STR_LIT:U+0020>""" <EOL> rank_id = request . json . get ( "<STR_LIT>" , None ) <EOL> name = request . json . get ( "<STR_LIT:name>" , None ) <EOL> rank = request . json . get ( "<STR_LIT>" , None ) <EOL> data = core . rank . update ( rank_id = rank_id , name = name , rank = rank ) <EOL> data = set_message ( data ) <EOL> return jsonify ( data ) <EOL> @ api_rank . route ( '<STR_LIT>' , methods = [ '<STR_LIT>' ] ) <EOL> @ authentication <EOL> @ check_rank ( <NUM_LIT:10> ) <EOL> @ get_hash ( '<STR_LIT>' ) <EOL> def remove ( ) : <EOL> """<STR_LIT:U+0020>""" <EOL> rank_id = request . args . get ( "<STR_LIT>" , None ) <EOL> data = core . rank . remove ( rank_id = rank_id , my_rank = g . my [ '<STR_LIT>' ] ) <EOL> data = set_message ( data ) <EOL> return jsonify ( data ) </s>
