def one(id): if request.method == 'PUT': return admin_service.update_bangumi(id, json.loads(request.get_data(True, as_text=True))) elif request.method == 'GET': return admin_service.get_bangumi(id) else: return admin_service.delete_bangumi(id)
def update_bangumi(id): data = json.loads(request.get_data(True, as_text=True)) data['dmhy'] = utils.empty_to_none(data, 'dmhy') data['acg_rip'] = utils.empty_to_none(data, 'acg_rip') data['libyk_so'] = utils.empty_to_none(data, 'libyk_so') data['bangumi_moe'] = utils.empty_to_none(data, 'bangumi_moe') data['nyaa'] = utils.empty_to_none(data, 'nyaa') return admin_service.update_bangumi(id, data)
def update_bangumi(id): return admin_service.update_bangumi(id, json.loads(request.get_data(True, as_text=True)))