@user_required
def put(self, user):
    schema = {'type': 'array', 'items': {'type': 'string'}, 'uniqueItems': True}
    try:
        body = request.json
        validate(instance=body, schema=schema)
        (wordok, not_has, wnot_has) = models.WordList.check_word(*body)
        defines = models.Word.search_words(*wordok)
        return {'defines': {w['word']: w for w in json.loads(defines.to_json())}, 'not_dict': wnot_has, 'not_sentence': not_has}
    except Exception as err:
        return ({'message': 'invalid request body', 'error': str(err)}, 422)
@user_required
def put(self, user):
    schema = {'type': 'array', 'items': {'type': 'string'}, 'uniqueItems': True}
    try:
        body = request.json
        validate(instance=body, schema=schema)
        (wordok, not_has, wnot_has) = models.WordList.check_word(*body)
        defines = models.Word.search_words(*wordok)
        return {'defines': {w['word']: w for w in json.loads(defines.to_json())}, 'not_dict': wnot_has, 'not_sentence': not_has}
    except Exception as err:
        return ({'message': 'invalid request body', 'error': str(err)}, 422)