2019-03-11 20:12:49 +01:00
/ * *
* TheCitadelofRicks
*
2020-01-15 13:42:40 +01:00
* Copyright 2019 - 2020 < seil0 @mosad . xyz >
2019-03-11 20:12:49 +01:00
*
* 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
2019-03-13 15:13:53 +01:00
import java.time.LocalDateTime
import java.util.*
2020-06-05 18:23:15 +02:00
import kotlin.collections.HashMap
2019-03-13 15:13:53 +01:00
2019-03-12 22:06:04 +01:00
// data classes for the course part
data class Course ( val courseName : String , val courseLink : String )
2019-03-11 20:12:49 +01:00
2020-06-06 23:07:23 +02:00
data class CoursesMeta ( val updateTime : Long = 0 , val totalCourses : Int = 0 )
2019-03-11 20:12:49 +01:00
2020-08-16 19:56:13 +02:00
data class CoursesList ( val meta : CoursesMeta = CoursesMeta ( ) , val courses : SortedMap < String , Course > )
2020-06-11 17:22:31 +02:00
data class CoursesListRet ( val meta : CoursesMeta = CoursesMeta ( ) , val courses : ArrayList < Course > = ArrayList ( ) )
2019-03-12 22:06:04 +01:00
// data classes for the Mensa part
2019-03-11 20:12:49 +01:00
data class Meal ( val day : String , val heading : String , val parts : ArrayList < String > , val additives : String )
2019-03-12 22:06:04 +01:00
data class Meals ( val meals : ArrayList < Meal > )
2019-03-13 15:13:53 +01:00
data class MensaWeek ( val days : Array < Meals > = Array ( 7 ) { Meals ( ArrayList ( ) ) } )
2019-03-12 22:06:04 +01:00
2019-03-16 00:00:34 +01:00
data class MensaMeta ( val updateTime : Long , val mensaName : String )
2019-03-12 22:06:04 +01:00
2019-06-02 19:04:20 +02:00
data class MensaMenu ( val meta : MensaMeta , val currentWeek : MensaWeek , val nextWeek : MensaWeek )
2019-03-12 22:06:04 +01:00
// data classes for the timetable part
2021-10-23 23:39:18 +02:00
data class CalendarWeek ( val week : Int , val year : Int )
2019-03-13 19:12:05 +01:00
data class Lesson (
val lessonID : String ,
val lessonSubject : String ,
val lessonTeacher : String ,
val lessonRoom : String ,
val lessonRemark : String
)
2019-03-12 22:06:04 +01:00
2019-03-13 19:12:05 +01:00
data class TimetableDay ( val timeslots : Array < ArrayList < Lesson > > = Array ( 6 ) { ArrayList < Lesson > ( ) } )
2019-03-11 20:12:49 +01:00
2019-03-12 22:06:04 +01:00
data class TimetableWeek ( val days : Array < TimetableDay > = Array ( 6 ) { TimetableDay ( ) } )
2019-03-11 20:12:49 +01:00
2023-01-13 20:21:15 +01:00
data class TimetableCourseMeta ( var updateTime : Long = 0 , val courseName : String = " " , val weekIndex : Int = 0 , var weekNumberYear : Int = 0 , var year : Int = 0 , val link : String = " " )
2019-03-11 20:12:49 +01:00
2019-11-14 18:43:00 +01:00
data class TimetableCourseWeek ( val meta : TimetableCourseMeta = TimetableCourseMeta ( ) , var timetable : TimetableWeek = TimetableWeek ( ) )
2019-03-13 15:13:53 +01:00
// data classes for the status part
2019-10-05 17:17:26 +02:00
2019-03-13 19:12:05 +01:00
data class Status (
val time : LocalDateTime ,
val uptime : String ,
val apiVersion : String ,
2019-03-18 16:13:13 +01:00
val softwareVersion : String ,
2020-02-27 17:42:19 +01:00
val totalRequests : Int ,
2019-10-05 17:17:26 +02:00
val mensaMenuRequests : Int ,
2020-02-27 17:42:19 +01:00
val courseListRequests : Int ,
2020-06-05 18:23:15 +02:00
val timetableRequests : HashMap < String , Int > ,
2019-06-03 12:20:01 +02:00
val timetableListSize : Int ,
2019-03-13 19:12:05 +01:00
val coursesLastUpdate : Date ,
val mensaLastUpdate : Date ,
val hsoResponseCode : Int ,
val swfrResponseCode : Int
)