Skip to content

Commit b53415a

Browse files
committed
DTO classes to exchange events between webhook & evaluator lambdas
1 parent 89ed7e5 commit b53415a

File tree

6 files changed

+39
-0
lines changed

6 files changed

+39
-0
lines changed

eval/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44

55
dependencies {
66
api(project.projects.core)
7+
api(project.projects.eval.dto)
78
api(libs.tgbotapi.core)
89
implementation(project.projects.votes.tgbotapiExtensions)
910
implementation(libs.tgbotapi.extensions.api)

eval/dto/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins {
2+
kotlin("jvm")
3+
kotlin("plugin.serialization")
4+
}
5+
6+
dependencies {
7+
implementation(libs.kotlinx.serialization.core)
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package by.jprof.telegram.bot.eval.dto
2+
3+
import kotlinx.serialization.Serializable
4+
5+
@Serializable
6+
data class EvalEvent(
7+
val code: String,
8+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package by.jprof.telegram.bot.eval.dto
2+
3+
import kotlinx.serialization.Serializable
4+
5+
@Serializable
6+
data class EvalResponse(
7+
val language: Language,
8+
val stdout: String? = null,
9+
val stderr: String? = null,
10+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package by.jprof.telegram.bot.eval.dto
2+
3+
enum class Language {
4+
UNKNOWN,
5+
KOTLIN,
6+
JAVA,
7+
JAVASCRIPT,
8+
TYPESCRIPT,
9+
PYTHON,
10+
GO,
11+
}

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ include(":kotlin:dynamodb")
2121
include(":quizoji")
2222
include(":quizoji:dynamodb")
2323
include(":eval")
24+
include(":eval:dto")
2425
include(":runners:lambda")

0 commit comments

Comments
 (0)