Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
a13203c477
|
|||
2bb6bc6534 | |||
d0d5e4b6d1
|
|||
16cb89ca38
|
|||
b428840df7
|
|||
4ca79e6540
|
@ -7,8 +7,3 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- gradle test
|
- gradle test
|
||||||
|
|
||||||
- name: test-jdk8
|
|
||||||
image: gradle:jdk8
|
|
||||||
commands:
|
|
||||||
- gradle test
|
|
||||||
|
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -35,6 +35,7 @@ captures/
|
|||||||
|
|
||||||
# Intellij
|
# Intellij
|
||||||
*.iml
|
*.iml
|
||||||
|
.idea/
|
||||||
.idea/workspace.xml
|
.idea/workspace.xml
|
||||||
.idea/tasks.xml
|
.idea/tasks.xml
|
||||||
.idea/gradle.xml
|
.idea/gradle.xml
|
||||||
@ -55,6 +56,9 @@ freeline.py
|
|||||||
freeline/
|
freeline/
|
||||||
freeline_project_description.json
|
freeline_project_description.json
|
||||||
|
|
||||||
|
# KDE
|
||||||
.directory
|
.directory
|
||||||
.idea/
|
|
||||||
|
# tcor
|
||||||
|
tcor/
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
[](https://drone.mosad.xyz/Seil0/TheCitadelofRicks)
|
[](https://drone.mosad.xyz/Seil0/TheCitadelofRicks)
|
||||||
|
[](https://git.mosad.xyz/Seil0/TheCitadelofRicks/releases)
|
||||||
[](https://www.gnu.org/licenses/gpl-3.0)
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
||||||
# TheCitadelofRicks
|
# TheCitadelofRicks
|
||||||
|
|
||||||
|
12
build.gradle
12
build.gradle
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.60'
|
ext.kotlin_version = '1.3.61'
|
||||||
ext.spring_boot_version = '2.1.10.RELEASE'
|
ext.spring_boot_version = '2.1.11.RELEASE'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
@ -33,7 +33,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3"
|
||||||
implementation "org.jsoup:jsoup:1.12.1"
|
implementation "org.jsoup:jsoup:1.12.1"
|
||||||
implementation "org.springframework.boot:spring-boot-starter-web"
|
implementation "org.springframework.boot:spring-boot-starter-web"
|
||||||
implementation "com.google.code.gson:gson:2.8.6"
|
implementation "com.google.code.gson:gson:2.8.6"
|
||||||
@ -42,11 +42,11 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "11"
|
||||||
}
|
}
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "11"
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'org.mosad'
|
group 'org.mosad'
|
||||||
version '1.2.0'
|
version '1.2.1'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -48,7 +48,7 @@ class APIController {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val apiVersion = "1.1.4"
|
const val apiVersion = "1.1.4"
|
||||||
const val softwareVersion = "1.2.0"
|
const val softwareVersion = "1.2.1"
|
||||||
val startTime = System.currentTimeMillis() / 1000
|
val startTime = System.currentTimeMillis() / 1000
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class APIController {
|
|||||||
CacheController()
|
CacheController()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove this with API version 1.2.0
|
// TODO remove this with API version 2.0.0
|
||||||
@Deprecated("courses is replaced by courseList", replaceWith = ReplaceWith("courseList()"))
|
@Deprecated("courses is replaced by courseList", replaceWith = ReplaceWith("courseList()"))
|
||||||
@RequestMapping("/courses")
|
@RequestMapping("/courses")
|
||||||
fun courses(): CourseList {
|
fun courses(): CourseList {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -116,7 +116,7 @@ class CacheController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get every explicit lesson in a week
|
* get every lesson of a subject in a week
|
||||||
* @param courseName the name of the course to be requested
|
* @param courseName the name of the course to be requested
|
||||||
* @param lessonSubject the lesson subject to be requested
|
* @param lessonSubject the lesson subject to be requested
|
||||||
* @param weekIndex request week number (current week = 0)
|
* @param weekIndex request week number (current week = 0)
|
||||||
@ -128,14 +128,7 @@ class CacheController {
|
|||||||
// get all lessons from the weeks timetable
|
// get all lessons from the weeks timetable
|
||||||
val flatMap = getTimetable(courseName, weekIndex).timetable.days.flatMap { it.timeslots.asIterable() }
|
val flatMap = getTimetable(courseName, weekIndex).timetable.days.flatMap { it.timeslots.asIterable() }
|
||||||
flatMap.forEach {
|
flatMap.forEach {
|
||||||
// TODO Java 11
|
it.stream().filter { x -> x.lessonSubject.contains(lessonSubject) }.findAny().ifPresent { x -> lessonList.add(x) }
|
||||||
//it.stream().filter { x -> x.lessonSubject.contains(lessonSubject) }.findAny().ifPresent { x -> println("${x.lessonSubject}, ${x.lessonTeacher}") }
|
|
||||||
|
|
||||||
it.forEach { lesson ->
|
|
||||||
if(lesson.lessonSubject.contains(lessonSubject)) {
|
|
||||||
lessonList.add(lesson)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return lessonList
|
return lessonList
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,8 +35,8 @@ class StartupController {
|
|||||||
private val logger: Logger = LoggerFactory.getLogger(CacheController::class.java)
|
private val logger: Logger = LoggerFactory.getLogger(CacheController::class.java)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val userHome: String = System.getProperty("user.home")
|
val userHome: String = System.getProperty("user.dir")
|
||||||
val tcorHome = "$userHome/.tcor"
|
val tcorHome = "$userHome/tcor"
|
||||||
val dirTcorHome = File(tcorHome)
|
val dirTcorHome = File(tcorHome)
|
||||||
val dirTcorCache = File("$tcorHome/cache")
|
val dirTcorCache = File("$tcorHome/cache")
|
||||||
val fileConfig = File("$tcorHome/config.xml")
|
val fileConfig = File("$tcorHome/config.xml")
|
||||||
@ -66,7 +66,7 @@ class StartupController {
|
|||||||
createConfig()
|
createConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO read cached timetable files, as they are not initially cached
|
// read cached timetable files, as they are not initially cached
|
||||||
readCachedTimetables()
|
readCachedTimetables()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -56,18 +56,11 @@ class StatusController {
|
|||||||
* if a timetable is requested update the request counter
|
* if a timetable is requested update the request counter
|
||||||
*/
|
*/
|
||||||
fun updateTimetableRequests(courseName: String) {
|
fun updateTimetableRequests(courseName: String) {
|
||||||
when (timetableRequests.stream().filter { x -> x.courseName == courseName }.findAny().orElse(null)) {
|
timetableRequests.stream().filter { it.courseName == courseName }.findFirst().ifPresentOrElse({
|
||||||
null -> timetableRequests.add(TimetableCounter(courseName, 0))
|
it.requests++
|
||||||
}
|
}, {
|
||||||
timetableRequests.stream().filter { x -> x.courseName == courseName }.findFirst()
|
timetableRequests.add(TimetableCounter(courseName, 1))
|
||||||
.ifPresent { x -> x.requests++ }
|
})
|
||||||
|
|
||||||
// TODO Java 11
|
|
||||||
// timetableRequests.stream().filter { it.courseName == courseName }.findFirst().ifPresentOrElse({
|
|
||||||
// it.requests++
|
|
||||||
// }, {
|
|
||||||
//
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getTotalRequests(): Int {
|
fun getTotalRequests(): Int {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* TheCitadelofRicks
|
* TheCitadelofRicks
|
||||||
*
|
*
|
||||||
* Copyright 2019 <seil0@mosad.xyz>
|
* Copyright 2019-2020 <seil0@mosad.xyz>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
Reference in New Issue
Block a user