Basic structure and courses api
This commit is contained in:
parent
1c60f68c62
commit
9f4eb7f79a
5 changed files with 71 additions and 0 deletions
34
lib/server/titamaapi.dart
Normal file
34
lib/server/titamaapi.dart
Normal file
|
@ -0,0 +1,34 @@
|
|||
library titama.server;
|
||||
|
||||
import 'package:rpc/rpc.dart';
|
||||
|
||||
import '../common/messages.dart';
|
||||
|
||||
@ApiClass(version: 'v1')
|
||||
class TitamaApi {
|
||||
|
||||
final List<Course> _courses = new List<Course>();
|
||||
|
||||
TitamaApi() {
|
||||
// example course, to remove once the database connection is implemented
|
||||
Course course = new Course();
|
||||
course
|
||||
..title = "UlmAPI"
|
||||
..time = "18:00"
|
||||
..day = "Monday"
|
||||
..id = 0
|
||||
..kind = "Lab"
|
||||
..place = "O27/343"
|
||||
..prof = ""
|
||||
..turnin = "";
|
||||
_courses.add(course);
|
||||
}
|
||||
|
||||
@ApiMethod(path: 'courses')
|
||||
List<Course> listCourses() {
|
||||
return _courses;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Reference in a new issue