6 Commits
1.2.0 ... 1.2.1

Author SHA1 Message Date
a13203c477 use the current directory to store the config.xml and cached timetables
All checks were successful
continuous-integration/drone/push Build is passing
2020-01-15 13:42:40 +01:00
2bb6bc6534 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2020-01-07 16:00:24 +01:00
d0d5e4b6d1 removed Java legacy code
All checks were successful
continuous-integration/drone/push Build is passing
the minimum is now Java 11
2019-12-30 01:36:21 +01:00
16cb89ca38 update kotlin to 1.3.61
* update coroutines to 1.3.3
2019-12-13 14:06:08 +01:00
b428840df7 update to spring boot 2.1.11 2019-12-12 14:25:13 +01:00
4ca79e6540 removed invalid TODOs
All checks were successful
continuous-integration/drone/push Build is passing
2019-11-21 14:58:34 +01:00
14 changed files with 34 additions and 48 deletions

View File

@ -7,8 +7,3 @@ steps:
commands: commands:
- gradle test - gradle test
- name: test-jdk8
image: gradle:jdk8
commands:
- gradle test

6
.gitignore vendored
View File

@ -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/

View File

@ -1,4 +1,5 @@
[![Build Status](https://drone.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://drone.mosad.xyz/Seil0/TheCitadelofRicks) [![Build Status](https://drone.mosad.xyz/api/badges/Seil0/TheCitadelofRicks/status.svg)](https://drone.mosad.xyz/Seil0/TheCitadelofRicks)
[![Release](https://img.shields.io/badge/dynamic/json.svg?label=release&url=https://git.mosad.xyz/api/v1/repos/Seil0/TheCitadelofRicks/releases&query=$[0].tag_name)](https://git.mosad.xyz/Seil0/TheCitadelofRicks/releases)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
# TheCitadelofRicks # TheCitadelofRicks

View File

@ -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'

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()
} }

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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