The API backend for https://git.mosad.xyz/Seil0/ProjectLaogai
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.4 KiB
75 lines
2.4 KiB
/** |
|
* TheCitadelofRicks |
|
* |
|
* Copyright 2019 <seil0@mosad.xyz> |
|
* |
|
* This program is free software; you can redistribute it and/or modify |
|
* it under the terms of the GNU General Public License as published by |
|
* the Free Software Foundation; either version 3 of the License, or |
|
* (at your option) any later version. |
|
* |
|
* This program is distributed in the hope that it will be useful, |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
* GNU General Public License for more details. |
|
* |
|
* You should have received a copy of the GNU General Public License |
|
* along with this program; if not, write to the Free Software |
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
* MA 02110-1301, USA. |
|
* |
|
*/ |
|
|
|
package org.mosad.thecitadelofricks |
|
|
|
import java.time.LocalDateTime |
|
import java.util.* |
|
|
|
// data classes for the course part |
|
data class Course(val courseName: String, val courseLink: String) |
|
|
|
data class CoursesMeta(val updateTime: Long, val totalCourses: Int) |
|
|
|
data class CoursesList(val meta: CoursesMeta, val courses: ArrayList<Course>) |
|
|
|
// data classes for the Mensa part |
|
data class Meal(val day: String, val heading: String, val parts: ArrayList<String>, val additives: String) |
|
|
|
data class Meals(val meals: ArrayList<Meal>) |
|
|
|
data class MensaWeek(val days: Array<Meals> = Array(7) { Meals(ArrayList()) }) |
|
|
|
data class MensaMeta(val updateTime: Long, val mensaName: String) |
|
|
|
data class Mensa(val meta: MensaMeta, val currentWeek: MensaWeek, val nextWeek: MensaWeek) |
|
|
|
// data classes for the timetable part |
|
data class Lesson( |
|
val lessonID: String, |
|
val lessonSubject: String, |
|
val lessonTeacher: String, |
|
val lessonRoom: String, |
|
val lessonRemark: String |
|
) |
|
|
|
data class TimetableDay(val timeslots: Array<ArrayList<Lesson>> = Array(6) { ArrayList<Lesson>() }) |
|
|
|
data class TimetableWeek(val days: Array<TimetableDay> = Array(6) { TimetableDay() }) |
|
|
|
data class TimetableCourseMeta(var updateTime: Long, val courseName: String, val week: Int, val link: String) |
|
|
|
data class TimetableCourseWeek(val meta: TimetableCourseMeta, var timetable: TimetableWeek) |
|
|
|
|
|
// data classes for the status part |
|
data class Status( |
|
val time: LocalDateTime, |
|
val uptime: String, |
|
val apiVersion: String, |
|
val softwareVersion: String, |
|
val requestCount: Int, |
|
val coursesLastUpdate: Date, |
|
val mensaLastUpdate: Date, |
|
val hsoResponseCode: Int, |
|
val swfrResponseCode: Int |
|
) |