Seil0
6a687eb297
Some checks failed
continuous-integration/drone/push Build is failing
* updated spring boot 2.1.8 -> 2.1.9 * closes #7
80 lines
2.6 KiB
Kotlin
80 lines
2.6 KiB
Kotlin
/**
|
|
* 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 CourseMeta(val updateTime: Long, val totalCourses: Int)
|
|
|
|
data class CourseList(val meta: CourseMeta, 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 MensaMenu(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 weekIndex: Int, val weekNumberYear: Int, val link: String)
|
|
|
|
data class TimetableCourseWeek(val meta: TimetableCourseMeta, var timetable: TimetableWeek)
|
|
|
|
|
|
// data classes for the status part
|
|
data class TimetableCounter(var courseName: String, var requests: Int)
|
|
|
|
data class Status(
|
|
val time: LocalDateTime,
|
|
val uptime: String,
|
|
val apiVersion: String,
|
|
val softwareVersion: String,
|
|
val requestCount: Int,
|
|
val mensaMenuRequests: Int,
|
|
val timetableRequests: ArrayList<TimetableCounter>,
|
|
val timetableListSize: Int,
|
|
val coursesLastUpdate: Date,
|
|
val mensaLastUpdate: Date,
|
|
val hsoResponseCode: Int,
|
|
val swfrResponseCode: Int
|
|
) |