some organizing

This commit is contained in:
Aran Zaiger 2015-06-24 00:50:59 +03:00
parent 3c8c262fe6
commit 868b7fad8a
4 changed files with 69 additions and 11 deletions

View file

@ -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/<string:token>', methods=['POST'])
@auto.doc()
def create_campus(token):
@ -85,6 +88,13 @@ def create_campus(token):
#----------------------------------------------------------
# PUT
#----------------------------------------------------------
#----------------------------------------------------------
# GET
#----------------------------------------------------------
@campus_routes.route('/api/campuses/getAll/<string:token>', methods=['GET'])
@auto.doc()
@ -141,6 +151,10 @@ def get_campuses(token):
return forbidden("Invalid Token")
#----------------------------------------------------------
# DELETE
#----------------------------------------------------------
@campus_routes.route('/api/campuses/deleteCampus/<string:token>/<string:campusid>', methods=['DELETE'])
@auto.doc()
@ -191,6 +205,10 @@ def deleteCampus(token,campusid):
#----------------------------------------------------------
# DOCUMENTATION
#----------------------------------------------------------
@campus_routes.route('/api/campuses/help')
def documentation():
return auto.html()

View file

@ -279,9 +279,6 @@ def getMessagesByCourseName(name):
@course_routes.route('/api/courses/deleteCourse/<string:token>/<string:courseid>', 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()

View file

@ -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/<string:token>', 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/<string:name>', methods=["GET"])
@auto.doc()
@ -131,6 +138,12 @@ def getProjectsByCourseName(name):
#----------------------------------------------------------
# DELETE
#----------------------------------------------------------
@project_routes.route('/api/projects/deleteProject/<string:token>/<string:projectid>', 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()

View file

@ -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/<string:token>', 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/<string:courseName>', methods=["GET"])
@ -321,6 +330,12 @@ def getTaskComponents(taskId):
#----------------------------------------------------------
# DELETE
#----------------------------------------------------------
@task_routes.route('/api/tasks/deleteTask/<string:token>/<string:taskid>', 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()