-
Notifications
You must be signed in to change notification settings - Fork 1
/
WebServiceInterface
46 lines (37 loc) · 2.9 KB
/
WebServiceInterface
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
WebService Interfaces:
This document describes the WebService Interface used in StudentLife. The Mapping Rules together with the according methods will be presented
Mappings:
Always have to provide all ID's for accessing lower items because of AppEngine(e.g. for accessing a university you have to provide id's for country, state and city)
"/app/$controller/$action?/$id?"
"/"(controller: "application")
Controllers with their methods
Application:
/ -> Calls Index Method and sets up session.user for later requests; Has to be called before all other calls (for session to be created)
Country:
/app/country/add -> Create Country; "name" parameter given via POST request -> Returns Long id of new country
/app/country/list -> List all countries -> Returns [{"id":2,"name":"Name"}]
State:
/app/state/list/5 -> List States from Country with ID 5 -> Returns [{"id":95,"name":"Name"}]
/app/state/add/5 -> Add State to Country with ID 5; "name" parameter via POST request
City:
/app/city/list/5 -> List cities from State with ID 5 -> Returns [{"id":96,"name":"Name"}]
/app/city/add/5 -> Add a City to State; "name" parameter from POST request
University:
/app/university/list/5/ -> List universities from City with id 5 -> Returns [{"id":97,"name":"Name"}]
/app/city/add/5/ -> Add University to City; "name" parameter from POST request
Course:
/app/course/list/5 -> List Courses from University with id 5 -> Returns [{"id":98,"name":"Name","professor":"Baron","identificator":"123","type":"Type","points":3}]
/app/course/add/5 -> Add Course to University; "name, professor, identificator, type, points" parameter from POST request
/app/course/update/5 -> Update Course; "name, professor, identificator, type, points" parameter from POST request
/app/course/addEvent/5 -> Add Event to Course; "description, date (long in UTC), duration(long in minutes)" parameters from post request
/app/course/addTodo/5 -> Add Todo to Course; "description, date (long in UTC)" parameters from post request
/app/course/addLink/5 -> Add Link to Course; "description, link" parameters from post request
/app/course/listEvents/5 -> Show all Events of the Course -> [{"id":148,"description":"descriptin","date":123456,"duration":1}]
/app/course/listTodos/5 -> Show all Todos of the Course -> [{"id":149,"description":"descriptin","date":123456}]
/app/course/listLinks/5 -> Show all Links of the Course -> Returns [{"id":150,"description":"descriptin","link":"Link"}]
/app/course/colleagues/5 -> JSON list of Colleagues -> [{"name":"Name", "facebookId":"123456"}]
User:
/app/user/addUniversity/5 -> Add University to User
/app/user/addCourse/5/ -> Add Course to User; User has to have the University added the Course is held at
/app/user/listUniversities/ -> List all Universities the User has added -> [{"id":1, "name":"Name"}]
/app/user/listCourses/ -> List all Courses the User has added -> [{"id":98,"name":"Name","professor":"Baron","identificator":"123","type":"Type","points":3}]