mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-26 04:22:38 +00:00
[-] BaseHandler
This commit is contained in:
parent
8d48ab0d3f
commit
419e22cc49
@ -1,5 +1,6 @@
|
|||||||
package icu.samnyan.aqua.sega.diva
|
package icu.samnyan.aqua.sega.diva
|
||||||
|
|
||||||
|
import ext.JDict
|
||||||
import ext.MutJDict
|
import ext.MutJDict
|
||||||
import ext.logger
|
import ext.logger
|
||||||
import icu.samnyan.aqua.sega.diva.handler.AttendHandler
|
import icu.samnyan.aqua.sega.diva.handler.AttendHandler
|
||||||
@ -84,6 +85,10 @@ class DivaController(
|
|||||||
val logger = logger()
|
val logger = logger()
|
||||||
val mapper = DivaMapper()
|
val mapper = DivaMapper()
|
||||||
|
|
||||||
|
fun buildResultMap(map: JDict) =
|
||||||
|
map.filterValues { it != null && !(it is String && it == "") }
|
||||||
|
.map { (k, v) -> "$k=$v" }.joinToString("&")
|
||||||
|
|
||||||
@PostMapping(value = ["/"], consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE])
|
@PostMapping(value = ["/"], consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE])
|
||||||
fun formRequest(request: HttpServletRequest): String? {
|
fun formRequest(request: HttpServletRequest): String? {
|
||||||
val bodyStr = String(request.inputStream.readAllBytes())
|
val bodyStr = String(request.inputStream.readAllBytes())
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
package icu.samnyan.aqua.sega.diva.handler
|
|
||||||
|
|
||||||
import ext.JDict
|
|
||||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper
|
|
||||||
import org.springframework.stereotype.Component
|
|
||||||
|
|
||||||
fun buildResultMap(map: JDict) =
|
|
||||||
map.filterValues { it != null && !(it is String && it == "") }
|
|
||||||
.map { (k, v) -> "$k=$v" }.joinToString("&")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author samnyan (privateamusement@protonmail.com)
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
class BaseHandler {
|
|
||||||
@JvmField
|
|
||||||
final var mapper = DivaMapper()
|
|
||||||
|
|
||||||
fun build(map: JDict) = buildResultMap(map)
|
|
||||||
}
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package icu.samnyan.aqua.sega.diva.handler
|
package icu.samnyan.aqua.sega.diva.handler
|
||||||
|
|
||||||
import ext.logger
|
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.attend.DispersalParameter
|
import icu.samnyan.aqua.sega.diva.model.common.attend.DispersalParameter
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.attend.EtcParameter
|
import icu.samnyan.aqua.sega.diva.model.common.attend.EtcParameter
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.attend.GameBalanceParameter
|
import icu.samnyan.aqua.sega.diva.model.common.attend.GameBalanceParameter
|
||||||
@ -41,9 +40,7 @@ class AttendHandler {
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PingHandler(val rp: PropertyEntryRepository) : BaseHandler() {
|
class PingHandler(val rp: PropertyEntryRepository) {
|
||||||
val logger = logger()
|
|
||||||
|
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
val news: PropertyEntry = rp.findByPropertyKey("diva_news") ?: PropertyEntry("diva_news", "xxx")
|
val news: PropertyEntry = rp.findByPropertyKey("diva_news") ?: PropertyEntry("diva_news", "xxx")
|
||||||
val warning: PropertyEntry = rp.findByPropertyKey("diva_warning") ?: PropertyEntry("diva_warning", "xxx")
|
val warning: PropertyEntry = rp.findByPropertyKey("diva_warning") ?: PropertyEntry("diva_warning", "xxx")
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class BannerDataHandler : BaseHandler() {
|
class BannerDataHandler {
|
||||||
fun handle(request: BannerDataRequest) = BannerDataResponse(
|
fun handle(request: BannerDataRequest) = BannerDataResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class BannerInfoHandler : BaseHandler() {
|
class BannerInfoHandler {
|
||||||
fun handle(request: BaseRequest) = BannerInfoResponse(
|
fun handle(request: BaseRequest) = BannerInfoResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class CmPlyInfoHandler : BaseHandler() {
|
class CmPlyInfoHandler {
|
||||||
fun handle(request: BaseRequest) = BaseResponse(
|
fun handle(request: BaseRequest) = BaseResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import kotlin.math.max
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class ContestInfoHandler(private val contestRepository: ContestRepository) : BaseHandler() {
|
class ContestInfoHandler(private val contestRepository: ContestRepository) {
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
val contestList = contestRepository.findTop8ByEnable(true)
|
val contestList = contestRepository.findTop8ByEnable(true)
|
||||||
var ci_str = "***"
|
var ci_str = "***"
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class CstmzItmCtlgHandler(private val customizeRepository: DivaCustomizeRepository) : BaseHandler() {
|
class CstmzItmCtlgHandler(private val customizeRepository: DivaCustomizeRepository) {
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
val customizeList = customizeRepository.findAll()
|
val customizeList = customizeRepository.findAll()
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class CstmzItmNgMdlListHandler : BaseHandler() {
|
class CstmzItmNgMdlListHandler {
|
||||||
fun handle(request: BaseRequest) = CstmzItmNgMdlListResponse(
|
fun handle(request: BaseRequest) = CstmzItmNgMdlListResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import org.springframework.stereotype.Component
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class FestaInfoHandler(private val festaRepository: FestaRepository) : BaseHandler() {
|
class FestaInfoHandler(private val festaRepository: FestaRepository) {
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
val festaList = festaRepository.findTop2ByEnableOrderByCreateDateDesc(true)
|
val festaList = festaRepository.findTop2ByEnableOrderByCreateDateDesc(true)
|
||||||
val collection = FestaCollection(festaList)
|
val collection = FestaCollection(festaList)
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class NgWordHandler : BaseHandler() {
|
class NgWordHandler {
|
||||||
fun handle(request: BaseRequest) = BaseResponse(
|
fun handle(request: BaseRequest) = BaseResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Component
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class NvRankingHandler : BaseHandler() {
|
class NvRankingHandler {
|
||||||
fun handle(request: BaseRequest) = NvRankingResponse(
|
fun handle(request: BaseRequest) = NvRankingResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import java.util.stream.Collectors
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PsRankingHandler(private val playerPvRecordRepository: PlayerPvRecordRepository) : BaseHandler() {
|
class PsRankingHandler(private val playerPvRecordRepository: PlayerPvRecordRepository) {
|
||||||
fun handle(request: PsRankingRequest): Any {
|
fun handle(request: PsRankingRequest): Any {
|
||||||
var edition = Edition.ORIGINAL
|
var edition = Edition.ORIGINAL
|
||||||
var difficulty = Difficulty.HARD
|
var difficulty = Difficulty.HARD
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PstdHCtrlHandler : BaseHandler() {
|
class PstdHCtrlHandler {
|
||||||
fun handle(request: BaseRequest) = PstdHCtrlResponse(
|
fun handle(request: BaseRequest) = PstdHCtrlResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PstdItemNgLstHandler : BaseHandler() {
|
class PstdItemNgLstHandler {
|
||||||
fun handle(request: BaseRequest) = PstdItemNgLstResponse(
|
fun handle(request: BaseRequest) = PstdItemNgLstResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PvDefChrLstHandler : BaseHandler() {
|
class PvDefChrLstHandler {
|
||||||
fun handle(request: BaseRequest) = PvDefChrLstResponse(
|
fun handle(request: BaseRequest) = PvDefChrLstResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import java.util.function.Consumer
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PvListHandler(private val pvEntryRepository: PvEntryRepository) : BaseHandler() {
|
class PvListHandler(private val pvEntryRepository: PvEntryRepository) {
|
||||||
private val df: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
private val df: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
||||||
|
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class PvNgMdlLstHandler : BaseHandler() {
|
class PvNgMdlLstHandler {
|
||||||
fun handle(request: BaseRequest) = PvNgMdlLstResponse(
|
fun handle(request: BaseRequest) = PvNgMdlLstResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class QstInfHandler : BaseHandler() {
|
class QstInfHandler {
|
||||||
fun handle(request: BaseRequest) = QstInfResponse(
|
fun handle(request: BaseRequest) = QstInfResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class RmtWpLstHandler : BaseHandler() {
|
class RmtWpLstHandler {
|
||||||
fun handle(request: BaseRequest) = RmtWpLstResponse(
|
fun handle(request: BaseRequest) = RmtWpLstResponse(
|
||||||
request.cmd,
|
request.cmd,
|
||||||
request.req_id,
|
request.req_id,
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import java.time.LocalDateTime
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class ShopCatalogHandler(private val moduleRepository: DivaModuleRepository) : BaseHandler() {
|
class ShopCatalogHandler(private val moduleRepository: DivaModuleRepository) {
|
||||||
fun handle(request: BaseRequest): Any {
|
fun handle(request: BaseRequest): Any {
|
||||||
val moduleList = moduleRepository.findAll()
|
val moduleList = moduleRepository.findAll()
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class BuyCstmzItmHandler(
|
|||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val playerCustomizeService: PlayerCustomizeService,
|
private val playerCustomizeService: PlayerCustomizeService,
|
||||||
private val gameSessionRepository: GameSessionRepository
|
private val gameSessionRepository: GameSessionRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: BuyCstmzItmRequest): Any {
|
fun handle(request: BuyCstmzItmRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class BuyModuleHandler(
|
|||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val playerModuleService: PlayerModuleService,
|
private val playerModuleService: PlayerModuleService,
|
||||||
private val gameSessionRepository: GameSessionRepository
|
private val gameSessionRepository: GameSessionRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: BuyModuleRequest): Any {
|
fun handle(request: BuyModuleRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class GetPvPdHandler(
|
|||||||
private val pvRecordRepository: PlayerPvRecordRepository,
|
private val pvRecordRepository: PlayerPvRecordRepository,
|
||||||
private val pvCustomizeRepository: PlayerPvCustomizeRepository,
|
private val pvCustomizeRepository: PlayerPvCustomizeRepository,
|
||||||
private val playerProfileService: PlayerProfileService
|
private val playerProfileService: PlayerProfileService
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: GetPvPdRequest): Any {
|
fun handle(request: GetPvPdRequest): Any {
|
||||||
val profileO = playerProfileService.findByPdId(request.pd_id)
|
val profileO = playerProfileService.findByPdId(request.pd_id)
|
||||||
val pd = StringBuilder()
|
val pd = StringBuilder()
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import java.util.function.Supplier
|
|||||||
class ShopExitHandler(
|
class ShopExitHandler(
|
||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val pvCustomizeRepository: PlayerPvCustomizeRepository
|
private val pvCustomizeRepository: PlayerPvCustomizeRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: ShopExitRequest): Any {
|
fun handle(request: ShopExitRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class StageResultHandler(
|
|||||||
private val playerCustomizeRepository: PlayerCustomizeRepository,
|
private val playerCustomizeRepository: PlayerCustomizeRepository,
|
||||||
private val playerInventoryRepository: PlayerInventoryRepository,
|
private val playerInventoryRepository: PlayerInventoryRepository,
|
||||||
private val divaCalculator: DivaCalculator
|
private val divaCalculator: DivaCalculator
|
||||||
) : BaseHandler() {
|
) {
|
||||||
private var currentProfile: PlayerProfile? = null
|
private var currentProfile: PlayerProfile? = null
|
||||||
val logger = logger()
|
val logger = logger()
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import java.util.function.Supplier
|
|||||||
class StageStartHandler(
|
class StageStartHandler(
|
||||||
private val gameSessionRepository: GameSessionRepository,
|
private val gameSessionRepository: GameSessionRepository,
|
||||||
private val playerProfileService: PlayerProfileService
|
private val playerProfileService: PlayerProfileService
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: StageStartRequest): Any {
|
fun handle(request: StageStartRequest): Any {
|
||||||
if (request.getPd_id() != -1L) {
|
if (request.getPd_id() != -1L) {
|
||||||
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException?>(
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import java.util.function.Supplier
|
|||||||
class StoreSsHandler(
|
class StoreSsHandler(
|
||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val screenShotRepository: PlayerScreenShotRepository
|
private val screenShotRepository: PlayerScreenShotRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
val logger = logger()
|
val logger = logger()
|
||||||
fun handle(request: StoreSsRequest, file: MultipartFile): Any {
|
fun handle(request: StoreSsRequest, file: MultipartFile): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class EndHandler(
|
|||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val playerContestRepository: PlayerContestRepository,
|
private val playerContestRepository: PlayerContestRepository,
|
||||||
private val gameSessionRepository: GameSessionRepository
|
private val gameSessionRepository: GameSessionRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: StageResultRequest): Any {
|
fun handle(request: StageResultRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException?>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import java.util.function.Supplier
|
|||||||
class PdUnlockHandler(
|
class PdUnlockHandler(
|
||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val gameSessionRepository: GameSessionRepository
|
private val gameSessionRepository: GameSessionRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: PdUnlockRequest): Any {
|
fun handle(request: PdUnlockRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import java.util.concurrent.ThreadLocalRandom
|
|||||||
class PreStartHandler(
|
class PreStartHandler(
|
||||||
private val playerProfileService: PlayerProfileService,
|
private val playerProfileService: PlayerProfileService,
|
||||||
private val gameSessionRepository: GameSessionRepository
|
private val gameSessionRepository: GameSessionRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
var logger = logger()
|
var logger = logger()
|
||||||
fun handle(request: PreStartRequest): Any {
|
fun handle(request: PreStartRequest): Any {
|
||||||
val profileOptional = playerProfileService.findByPdId(request.aime_id)
|
val profileOptional = playerProfileService.findByPdId(request.aime_id)
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import java.util.function.Supplier
|
|||||||
* @author samnyan (privateamusement@protonmail.com)
|
* @author samnyan (privateamusement@protonmail.com)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class SpendCreditHandler(private val playerProfileService: PlayerProfileService) : BaseHandler() {
|
class SpendCreditHandler(private val playerProfileService: PlayerProfileService) {
|
||||||
fun handle(request: SpendCreditRequest): Any {
|
fun handle(request: SpendCreditRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
val profile = playerProfileService.findByPdId(request.pd_id).orElseThrow<ProfileNotFoundException?>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
package icu.samnyan.aqua.sega.diva.handler.user
|
package icu.samnyan.aqua.sega.diva.handler.user
|
||||||
|
|
||||||
import icu.samnyan.aqua.sega.diva.*
|
import icu.samnyan.aqua.sega.diva.GameSessionRepository
|
||||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler
|
import icu.samnyan.aqua.sega.diva.PlayerContestRepository
|
||||||
|
import icu.samnyan.aqua.sega.diva.PlayerPvRecordRepository
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.*
|
import icu.samnyan.aqua.sega.diva.model.common.*
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.collection.ClearSet
|
import icu.samnyan.aqua.sega.diva.model.common.collection.ClearSet
|
||||||
import icu.samnyan.aqua.sega.diva.model.common.collection.ClearTally
|
import icu.samnyan.aqua.sega.diva.model.common.collection.ClearTally
|
||||||
@ -35,7 +36,7 @@ class StartHandler(
|
|||||||
private val playerModuleService: PlayerModuleService,
|
private val playerModuleService: PlayerModuleService,
|
||||||
private val playerPvRecordRepository: PlayerPvRecordRepository,
|
private val playerPvRecordRepository: PlayerPvRecordRepository,
|
||||||
private val playerContestRepository: PlayerContestRepository
|
private val playerContestRepository: PlayerContestRepository
|
||||||
) : BaseHandler() {
|
) {
|
||||||
fun handle(request: StartRequest): Any {
|
fun handle(request: StartRequest): Any {
|
||||||
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException>(
|
val profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow<ProfileNotFoundException>(
|
||||||
Supplier { ProfileNotFoundException() })
|
Supplier { ProfileNotFoundException() })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user