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