diff --git a/connector/Include/analytics.py b/connector/Include/analytics.py index 5c5fa729..56f0b3ce 100644 --- a/connector/Include/analytics.py +++ b/connector/Include/analytics.py @@ -79,7 +79,7 @@ def get_movie_rating_avg(movie_id): def get_user_ratings(user_id): cursor = conn.cursor() cursor.execute(""" - SELECT * + SELECT movie_ID, rating FROM ratings WHERE oauth_ID = %s; """, (user_id,)) @@ -111,6 +111,6 @@ if __name__ == "__main__": break cache.init_app(app) - app.run(host="0.0.0.0", port=8082, debug=True) + app.run(host="localhost", port=8082, debug=True) conn.close() diff --git a/test_scripts/Test.http b/test_scripts/Test.http index ce6174e1..af04531c 100644 --- a/test_scripts/Test.http +++ b/test_scripts/Test.http @@ -28,3 +28,5 @@ GET http://localhost:8082/api/get_users_number ### GET http://localhost:8082/api/get_movie_rating_avg/155 ### +GET http://localhost:8082/api/get_user_ratings/1234 +### \ No newline at end of file