-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from dres-dev/dev
V2.0.0-RC2
- Loading branch information
Showing
10 changed files
with
234 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiClientEvaluationInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package dev.dres.api.rest.types.evaluation | ||
|
||
import dev.dres.data.model.run.ApiRunProperties | ||
import dev.dres.run.InteractiveAsynchronousRunManager | ||
import dev.dres.run.InteractiveSynchronousRunManager | ||
import dev.dres.run.NonInteractiveRunManager | ||
import dev.dres.run.RunManager | ||
|
||
/** | ||
* Contains the basic and most importantly static information about a [RunManager] that is relevant to a participant. | ||
* | ||
*/ | ||
data class ApiClientEvaluationInfo( | ||
val id: String, | ||
val name: String, | ||
val type: ApiEvaluationType, | ||
val status: ApiEvaluationStatus, | ||
val templateId: String, | ||
val templateDescription: String?, | ||
val teams: List<String>, | ||
val taskTemplates: List<ApiClientTaskTemplateInfo>, | ||
) { | ||
constructor(manager: RunManager): this( | ||
manager.id, | ||
manager.name, | ||
when(manager) { | ||
is InteractiveSynchronousRunManager -> ApiEvaluationType.SYNCHRONOUS | ||
is InteractiveAsynchronousRunManager -> ApiEvaluationType.ASYNCHRONOUS | ||
is NonInteractiveRunManager -> ApiEvaluationType.NON_INTERACTIVE | ||
else -> throw IllegalStateException("Incompatible type of run manager.") | ||
}, | ||
manager.status.toApi(), | ||
manager.template.id, | ||
manager.template.description, | ||
manager.template.teams.asSequence().map { team -> team.name ?: "" }.toList(), | ||
manager.template.tasks.map { task -> ApiClientTaskTemplateInfo(task) }.toList() | ||
) | ||
} |
21 changes: 21 additions & 0 deletions
21
backend/src/main/kotlin/dev/dres/api/rest/types/evaluation/ApiClientTaskTemplateInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package dev.dres.api.rest.types.evaluation | ||
|
||
import dev.dres.api.rest.types.template.tasks.ApiTaskTemplate | ||
import dev.dres.data.model.template.task.DbTaskTemplate | ||
|
||
/** | ||
* Basic and most importantly static information about a [DbTaskTemplate] relevant to the participant. | ||
*/ | ||
data class ApiClientTaskTemplateInfo( | ||
val name: String, | ||
val taskGroup: String, | ||
val taskType: String, | ||
val duration: Long | ||
) { | ||
constructor(task: ApiTaskTemplate) : this( | ||
task.name, | ||
task.taskGroup, | ||
task.taskType, | ||
task.duration | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.