From 868b7fad8aabc1a28126941f5df9705f7f49eeb2 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Wed, 24 Jun 2015 00:50:59 +0300 Subject: [PATCH] some organizing --- SE_API/CampusRoutes.py | 22 ++++++++++++++++++++-- SE_API/CourseRoutes.py | 8 +++++--- SE_API/ProjectRoutes.py | 24 +++++++++++++++++++++--- SE_API/TaskRoutes.py | 26 +++++++++++++++++++++++--- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/SE_API/CampusRoutes.py b/SE_API/CampusRoutes.py index ebfa72a..3c25394 100644 --- a/SE_API/CampusRoutes.py +++ b/SE_API/CampusRoutes.py @@ -22,11 +22,14 @@ from SE_API.Validation_Utils import * from SE_API.Respones_Utils import * from SE_API.Email_Utils import * - - campus_routes = Blueprint("campus_routes", __name__) auto = Autodoc() + +#---------------------------------------------------------- +# POST +#---------------------------------------------------------- + @campus_routes.route('/api/campuses/create/', methods=['POST']) @auto.doc() def create_campus(token): @@ -85,6 +88,13 @@ def create_campus(token): +#---------------------------------------------------------- +# PUT +#---------------------------------------------------------- + +#---------------------------------------------------------- +# GET +#---------------------------------------------------------- @campus_routes.route('/api/campuses/getAll/', methods=['GET']) @auto.doc() @@ -141,6 +151,10 @@ def get_campuses(token): return forbidden("Invalid Token") +#---------------------------------------------------------- +# DELETE +#---------------------------------------------------------- + @campus_routes.route('/api/campuses/deleteCampus//', methods=['DELETE']) @auto.doc() @@ -191,6 +205,10 @@ def deleteCampus(token,campusid): +#---------------------------------------------------------- +# DOCUMENTATION +#---------------------------------------------------------- + @campus_routes.route('/api/campuses/help') def documentation(): return auto.html() diff --git a/SE_API/CourseRoutes.py b/SE_API/CourseRoutes.py index b7af470..972b047 100644 --- a/SE_API/CourseRoutes.py +++ b/SE_API/CourseRoutes.py @@ -279,9 +279,6 @@ def getMessagesByCourseName(name): - - - @course_routes.route('/api/courses/deleteCourse//', methods=['DELETE']) @auto.doc() def deleteCourse(token,courseid): @@ -390,6 +387,11 @@ def deleteCoursesByCampus(token,campusName): return no_content() + +#---------------------------------------------------------- +# DOCUMENTATION +#---------------------------------------------------------- + @course_routes.route('/api/courses/help') def documentation(): return auto.html() \ No newline at end of file diff --git a/SE_API/ProjectRoutes.py b/SE_API/ProjectRoutes.py index 175a3a7..bf9d76a 100644 --- a/SE_API/ProjectRoutes.py +++ b/SE_API/ProjectRoutes.py @@ -21,11 +21,13 @@ from models.Project import Project from SE_API.Validation_Utils import * from SE_API.Respones_Utils import * - - project_routes = Blueprint("project_routes", __name__) auto = Autodoc() +#---------------------------------------------------------- +# POST +#---------------------------------------------------------- + @project_routes.route('/api/projects/create/', methods=['POST']) @auto.doc() def create_project(token): @@ -78,9 +80,14 @@ def create_project(token): status=201, mimetype="application/json") +#---------------------------------------------------------- +# PUT +#---------------------------------------------------------- - +#---------------------------------------------------------- +# GET +#---------------------------------------------------------- @project_routes.route('/api/projects/getProjectsByCourseName/', methods=["GET"]) @auto.doc() @@ -131,6 +138,12 @@ def getProjectsByCourseName(name): +#---------------------------------------------------------- +# DELETE +#---------------------------------------------------------- + + + @project_routes.route('/api/projects/deleteProject//', methods=['DELETE']) @auto.doc() def deleteProject(token,projectid): @@ -179,6 +192,11 @@ def deleteProject(token,projectid): + +#---------------------------------------------------------- +# DOCUMENTATION +#---------------------------------------------------------- + @project_routes.route('/api/projects/help') def documentation(): return auto.html() \ No newline at end of file diff --git a/SE_API/TaskRoutes.py b/SE_API/TaskRoutes.py index ad3b990..ab36b2e 100644 --- a/SE_API/TaskRoutes.py +++ b/SE_API/TaskRoutes.py @@ -25,11 +25,15 @@ from SE_API.Validation_Utils import * from SE_API.Respones_Utils import * - - task_routes = Blueprint("task_routes", __name__) auto = Autodoc() + + +#---------------------------------------------------------- +# POST +#---------------------------------------------------------- + @task_routes.route('/api/tasks/create/', methods=['POST']) @auto.doc() def create_task(token): @@ -140,8 +144,13 @@ def create_task(token): return created() +#---------------------------------------------------------- +# PUT +#---------------------------------------------------------- - +#---------------------------------------------------------- +# GET +#---------------------------------------------------------- @task_routes.route('/api/tasks/getAllTasks/', methods=["GET"]) @@ -321,6 +330,12 @@ def getTaskComponents(taskId): +#---------------------------------------------------------- +# DELETE +#---------------------------------------------------------- + + + @task_routes.route('/api/tasks/deleteTask//', methods=['DELETE']) @auto.doc() def deleteTask(token,taskid): @@ -422,6 +437,11 @@ def deleteTaskComponents(token,taskid): + +#---------------------------------------------------------- +# DOCUMENTATION +#---------------------------------------------------------- + @task_routes.route('/api/tasks/help') def documentation(): return auto.html()