示例#1
0
文件: app.py 项目: jackyhocs/htn-api
    def get(self):
        '''
        Returns a list of skills that match the parameters entered by the user
        :return:
        Failure - Error codes: 500
        Success - List: 200
        '''
        params = request.args.to_dict()
        user_model = UserModel()
        try:
            skills = user_model.find_skill_by_params(params)
        except (DatabaseError, IntegrityError) as e:
            return {"message": "Internal Server Error {}".format(e)}, 500
        except Exception as e:
            return {"message": "Exception : {}".format(str(e))}, 500

        return skills, 200