forked from Cookies_Github_mirror/AquaDX
[O] Rewrite map area condition
This commit is contained in:
@@ -271,4 +271,40 @@ fun ChusanServletController.init() {
|
||||
"GetGameEvent" static { db.gameEvent.findByEnable(true).let { mapOf("type" to 1, "length" to it.size, "gameEventList" to it) } }
|
||||
"GetGameCharge" static { db.gameCharge.findAll().let { mapOf("length" to it.size, "gameChargeList" to it) } }
|
||||
"GetGameGacha" static { db.gameGacha.findAll().let { mapOf("length" to it.size, "gameGachaList" to it, "registIdList" to empty) } }
|
||||
"GetGameMapAreaCondition" static {
|
||||
mapOf(
|
||||
"gameMapAreaConditionList" to listOf(
|
||||
mapOf("mapAreaId" to 2206201, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 3, "conditionId" to 6832, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 2206203, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 3, "conditionId" to 6833, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 2206204, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 3, "conditionId" to 6834, "logicalOpe" to 1),
|
||||
mapOf("type" to 3, "conditionId" to 6835, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 2206205, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 3, "conditionId" to 6837, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 2206206, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 3, "conditionId" to 6838, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 2206207, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 2, "conditionId" to 2206201, "logicalOpe" to 1),
|
||||
mapOf("type" to 2, "conditionId" to 2206202, "logicalOpe" to 1),
|
||||
mapOf("type" to 2, "conditionId" to 2206203, "logicalOpe" to 1),
|
||||
mapOf("type" to 2, "conditionId" to 2206204, "logicalOpe" to 1),
|
||||
mapOf("type" to 2, "conditionId" to 2206205, "logicalOpe" to 1),
|
||||
mapOf("type" to 2, "conditionId" to 2206206, "logicalOpe" to 1)
|
||||
)),
|
||||
mapOf("mapAreaId" to 3229301, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 1, "conditionId" to 3020701, "logicalOpe" to 2)
|
||||
)),
|
||||
mapOf("mapAreaId" to 3229302, "mapAreaConditionList" to listOf(
|
||||
mapOf("type" to 1, "conditionId" to 3020701, "logicalOpe" to 1)
|
||||
))
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.chusan.handler
|
||||
|
||||
import ext.logger
|
||||
import icu.samnyan.aqua.sega.chusan.model.Chu3UserMapRepo
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
/**
|
||||
* Handle GetUserMap request
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("ChusanGetUserMapAreaHandler")
|
||||
class GetUserMapAreaHandler(
|
||||
private val mapper: StringMapper,
|
||||
private val userMapRepo: Chu3UserMapRepo
|
||||
) : BaseHandler {
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun handle(request: Map<String, Any>): String {
|
||||
val userId = request["userId"] as String?
|
||||
val maps = (request["mapAreaIdList"] as List<Map<String, String>>)
|
||||
.mapNotNull { it["mapAreaId"]?.toIntOrNull() }
|
||||
|
||||
val resultMap = mapOf(
|
||||
"userId" to userId,
|
||||
"userMapAreaList" to userMapRepo.findAllByUserCardExtIdAndMapAreaIdIn(userId?.toLong() ?: return "{}", maps)
|
||||
)
|
||||
|
||||
val json = mapper.write(resultMap)
|
||||
logger.info("Response: $json")
|
||||
return json
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = logger()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user