diff --git a/src/main/java/icu/samnyan/aqua/sega/maimai2/Maimai2Apis.kt b/src/main/java/icu/samnyan/aqua/sega/maimai2/Maimai2Apis.kt index d3f6cdb9..c0e60a70 100644 --- a/src/main/java/icu/samnyan/aqua/sega/maimai2/Maimai2Apis.kt +++ b/src/main/java/icu/samnyan/aqua/sega/maimai2/Maimai2Apis.kt @@ -60,20 +60,6 @@ fun Maimai2ServletController.initApis() { "GetGameEvent" static { mapOf("type" to 1, "gameEventList" to db.gameEvent.findByEnable(true)) } "GetGameCharge" static { db.gameCharge.findAll().let { mapOf("length" to it.size, "gameChargeList" to it) } } - "GetUserRivalData" { - val rivalId = parsing { data["rivalId"]!!.long } - - // rivalId should store and fetch with the id column of table rather than card_ext_id - // or user will be able to get others' ext_id by setting them as rival - mapOf( - "userId" to uid, - "userRivalData" to mapOf( - "rivalId" to rivalId, - "rivalName" to (db.userData.findById(rivalId)()?.userName ?: "") - ) - ) - } - "GetUserOption" { mapOf( "userId" to uid, "userOption" to (db.userOption.findSingleByUser_Card_ExtId(uid)() ?: (404 - "User not found")) @@ -155,10 +141,16 @@ fun Maimai2ServletController.initApis() { "GetUserRivalData" { val rivalId = parsing { data["rivalId"]!!.long } - mapOf("userId" to uid, "userRivalData" to mapOf( - "rivalId" to rivalId, - "rivalName" to (db.userData.findByCardExtId(rivalId)()?.userName ?: "") - )) + + // rivalId should store and fetch with the id column of table rather than card_ext_id + // or user will be able to get others' ext_id by setting them as rival + mapOf( + "userId" to uid, + "userRivalData" to mapOf( + "rivalId" to rivalId, + "rivalName" to (db.userData.findById(rivalId)()?.userName ?: "") + ) + ) } "GetUserRivalMusic" { diff --git a/src/main/resources/db/V1000_38__chusan_verse_event_121.sql b/src/main/resources/db/V1000_38__chusan_verse_event_121.sql index 7a7b57bd..b945c18a 100644 --- a/src/main/resources/db/V1000_38__chusan_verse_event_121.sql +++ b/src/main/resources/db/V1000_38__chusan_verse_event_121.sql @@ -69,7 +69,6 @@ INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (1 INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16023,2,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16015,2,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16012,2,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); -INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (2412,13,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16046,14,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16041,8,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true); INSERT INTO chusan_game_event (id, type, end_date, start_date, enable) VALUES (16048,12,'2029-01-01 00:00:00.000000','2019-01-01 00:00:00.000000',true);