This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
titama-backend/lib/server/titamaapi.dart

35 lines
620 B
Dart

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;
}
}