Dieser Commit ist enthalten in:
Ursprung
39f23c22dd
Commit
76f7d7b5ca
@ -45,6 +45,7 @@ val config = Json.decodeFromStream<Config>(File("config.json").inputStream())
|
||||
|
||||
fun main() {
|
||||
SchematicType.Normal.name().length
|
||||
SteamwarUser.get("Chaoscaot").setPassword("testtest")
|
||||
Thread {
|
||||
while (true) {
|
||||
Thread.sleep(1000 * 10)
|
||||
|
@ -54,8 +54,8 @@ fun Route.configureModRoutes() {
|
||||
val platform = call.parameters["platform"]
|
||||
val modName = call.parameters["mod"]
|
||||
val update = call.receiveNullable<UpdateMod>()
|
||||
if (platform == null || !Mod.Platform.values().map { it.name }
|
||||
.contains(platform) || modName == null || update == null || !Mod.ModType.values().map { it.name }
|
||||
if (platform == null || !Mod.Platform.entries.map { it.name }
|
||||
.contains(platform) || modName == null || update == null || !Mod.ModType.entries.map { it.name }
|
||||
.contains(update.modType)) {
|
||||
call.respond(HttpStatusCode.BadRequest, ResponseError("Invalid something"))
|
||||
return@put
|
||||
|
@ -156,26 +156,14 @@ fun Route.configurePage() {
|
||||
contentType(ContentType.Application.Json)
|
||||
setBody(CreateGiteaBranchRequest(branch, "master"))
|
||||
}
|
||||
call.respond(res.status)
|
||||
}
|
||||
post("branch/merge") {
|
||||
|
||||
|
||||
@Serializable
|
||||
data class CreateGiteaMergeRequest(val base: String, val head: String, val title: String)
|
||||
|
||||
val data = call.receive<MergeBranchRequest>()
|
||||
val createRes = client.post("repos/SteamWar/Website/pulls") {
|
||||
client.post("repos/SteamWar/Website/pulls") {
|
||||
contentType(ContentType.Application.Json)
|
||||
setBody(CreateGiteaMergeRequest("master", data.branch, data.message))
|
||||
}
|
||||
|
||||
val id = Json.parseToJsonElement(createRes.bodyAsText()).jsonObject["number"]?.jsonPrimitive?.int!!
|
||||
|
||||
@Serializable
|
||||
data class MergeGiteaMergeRequest(val Do: String)
|
||||
|
||||
val res = client.post("repos/SteamWar/Website/pulls/$id/merge") {
|
||||
contentType(ContentType.Application.Json)
|
||||
setBody(MergeGiteaMergeRequest("merge"))
|
||||
setBody(CreateGiteaMergeRequest("master", branch, "Merge branch $branch"))
|
||||
}
|
||||
|
||||
call.respond(res.status)
|
||||
|
@ -48,7 +48,7 @@ fun Route.configureUserPerms() {
|
||||
get {
|
||||
val perms = mutableListOf<String>()
|
||||
val prefixes = mutableMapOf<String, RespondPrefix>()
|
||||
UserPerm.values().forEach {
|
||||
UserPerm.entries.forEach {
|
||||
if (it.name.startsWith("PREFIX_")) {
|
||||
val prefix = UserPerm.prefixes[it]!!
|
||||
prefixes[it.name] = RespondPrefix(it.name, prefix.colorCode, prefix.chatPrefix)
|
||||
|
@ -1,3 +1,6 @@
|
||||
build:
|
||||
- "JAVA_HOME='/usr/lib/jvm/java-17-openjdk-amd64' ./gradlew buildFatJar"
|
||||
- "./gradlew --stop"
|
||||
|
||||
artifacts:
|
||||
"/binarys/website-api.jar": "build/libs/api.jar"
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren