Skip to content

Commit

Permalink
Change model classes to be data classes and remove unused annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jaakkonakaza committed Aug 23, 2024
1 parent 0558ff6 commit 22f3528
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/fi/aalto/cs/apluscourses/model/Course.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import io.ktor.http.*
* @param exerciseModules Mapping of exercise IDs to modules. The keys are exercise IDs, and the values are maps from language codes to module names. Note that some exercises use modules that are not in the course configuration file, so the modules may not be in [Course.getModules].
* @param resourceUrls URLs of resources related to the course. The keys are the names of the resources and the values are the URLs.
*/
class Course(
data class Course(
val id: Long,
val name: String,
val htmlUrl: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package fi.aalto.cs.apluscourses.model.exercise

import kotlinx.serialization.Serializable

@Serializable
data class SubmissionFileInfo(
val fileName: String,
val url: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package fi.aalto.cs.apluscourses.model.exercise

import fi.aalto.cs.apluscourses.api.APlusApi
import kotlinx.serialization.Serializable

@Serializable
data class SubmissionInfo(val files: Map<String, List<SubmittableFile>>) {
// private val files: Map<String, List<SubmittableFile>> = files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package fi.aalto.cs.apluscourses.model.exercise

import com.intellij.openapi.project.Project
import fi.aalto.cs.apluscourses.api.APlusApi
import kotlinx.serialization.Serializable

@Serializable
data class SubmissionResult(
val id: Long,
val url: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
package fi.aalto.cs.apluscourses.model.exercise

import kotlinx.serialization.Serializable

@Serializable
data class SubmittableFile(val key: String, val name: String)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle

class NewsItem(
data class NewsItem(
val id: Long,
val title: String,
val body: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fi.aalto.cs.apluscourses.model.news

class NewsList(val news: List<NewsItem> = emptyList()) {
data class NewsList(val news: List<NewsItem> = emptyList()) {
fun setAllRead() {
news.forEach { newsItem: NewsItem -> newsItem.isRead = true }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package fi.aalto.cs.apluscourses.model.people
* @property aplusId The A+ ID of the user.
* @property staffCourses List of course IDs that the user is a staff member of.
*/
class User(
data class User(
val userName: String,
val studentId: String,
val aplusId: Long,
Expand Down

0 comments on commit 22f3528

Please sign in to comment.