Exemplo n.º 1
0
def servant_edit_passive_skill(servant_id):
    data = request.json

    is_valid, validation_errors = PassiveSkill.validate(data)

    if not is_valid:
        return response_json(False, validation_errors)

    PassiveSkill.edit(data, servant_id)

    return response_json(True)
Exemplo n.º 2
0
def servant_edit_skill_lv(servant_id):
    data = request.json

    if type(data) is not list:
        data = [data]

    is_valid, validation_errors = SkillLv.validate(data)

    if not is_valid:
        return response_json(False, validation_errors)

    SkillLv.edit(data, servant_id)

    return response_json(True)
Exemplo n.º 3
0
def servant_edit_basic(servant_id):
    """

    :param servant_id:
    :return:
    """
    servant = Servant.query.get_or_404(servant_id)

    data = request.json

    is_valid, validation_errors = Servant.validate(data)

    if not is_valid:
        return response_json(False, validation_errors)

    servant.edit(data)

    return response_json(True)
Exemplo n.º 4
0
def servant_upload_icon(servant_id):
    """

    :param servant_id:
    :return:
    """
    servant = Servant.query.get_or_404(servant_id)

    icon = request.files['icon']

    is_valid, validation_errors = Servant.validate({'icon': icon})

    if not is_valid:
        return response_json(False, validation_errors)

    servant.update_icon(icon)

    return response_json(True, {'icon': servant.icon})
Exemplo n.º 5
0
def servant_delete_skill_effect(skill_effect_id):
    skill_effect = SkillEffect.query.get_or_404(skill_effect_id)

    skill_effect.delete()

    return response_json(True)
Exemplo n.º 6
0
def servant_delete_skill_lv(skill_lv_id):
    skill_lv = SkillLv.query.get_or_404(skill_lv_id)

    skill_lv.delete()

    return response_json(True)
Exemplo n.º 7
0
def servant_delete_stage_lv(stage_lv_id):
    stage_lv = StageLv.query.get_or_404(stage_lv_id)

    stage_lv.delete()

    return response_json(True)