mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-07 02:37:26 +08:00
[maimai2] Add Festival support
This commit is contained in:
@@ -51,6 +51,8 @@ public class Maimai2ServletController {
|
||||
private final GetUserCardPrintErrorHandler getUserCardPrintErrorHandler;
|
||||
private final CMGetUserCharacterHandler cmGetUserCharacterHandler;
|
||||
private final UpsertUserPrintHandler upsertUserPrintHandler;
|
||||
private final GetUserRecommendRateMusicHandler getUserRecommendRateMusicHandler;
|
||||
private final GetUserRecommendSelectMusicHandler getUserRecommendSelectMusicHandler;
|
||||
|
||||
public Maimai2ServletController(GetGameSettingHandler getGameSettingHandler, GetGameEventHandler getGameEventHandler, GetGameRankingHandler getGameRankingHandler, GetGameTournamentInfoHandler getGameTournamentInfoHandler,
|
||||
GetTransferFriendHandler getTransferFriendHandler, GetUserActivityHandler getUserActivityHandler, UserLoginHandler userLoginHandler, UserLogoutHandler userLogoutHandler,
|
||||
@@ -61,7 +63,7 @@ public class Maimai2ServletController {
|
||||
GetGameChargeHandler getGameChargeHandler, GetUserChargeHandler getUserChargeHandler, GetUserCourseHandler getUserCourseHandler, UploadUserPhotoHandler uploadUserPhotoHandler,
|
||||
UploadUserPlaylogHandler uploadUserPlaylogHandler, UploadUserPortraitHandler uploadUserPortraitHandler, GetGameNgMusicIdHandler getGameNgMusicIdHandler,GetUserPortraitHandler getUserPortraitHandler, GetUserFriendSeasonRankingHandler getUserFriendSeasonRankingHandler,
|
||||
CMGetUserPreviewHandler cmGetUserPreviewHandler, CMGetSellingCardHandler cmGetSellingCardHandler, GetUserCardPrintErrorHandler getUserCardPrintErrorHandler, CMGetUserCharacterHandler cmGetUserCharacterHandler,
|
||||
UpsertUserPrintHandler upsertUserPrintHandler) {
|
||||
UpsertUserPrintHandler upsertUserPrintHandler, GetUserRecommendRateMusicHandler getUserRecommendRateMusicHandler, GetUserRecommendSelectMusicHandler getUserRecommendSelectMusicHandler) {
|
||||
this.getGameSettingHandler = getGameSettingHandler;
|
||||
this.getGameEventHandler = getGameEventHandler;
|
||||
this.getGameRankingHandler = getGameRankingHandler;
|
||||
@@ -99,6 +101,8 @@ public class Maimai2ServletController {
|
||||
this.getUserCardPrintErrorHandler = getUserCardPrintErrorHandler;
|
||||
this.cmGetUserCharacterHandler = cmGetUserCharacterHandler;
|
||||
this.upsertUserPrintHandler = upsertUserPrintHandler;
|
||||
this.getUserRecommendRateMusicHandler = getUserRecommendRateMusicHandler;
|
||||
this.getUserRecommendSelectMusicHandler = getUserRecommendSelectMusicHandler;
|
||||
}
|
||||
|
||||
// Mandatory for boot
|
||||
@@ -279,9 +283,9 @@ public class Maimai2ServletController {
|
||||
return getUserChargeHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UploadUserChargelogApi")
|
||||
public String uploadUserChargelog(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserChargelogApi\"}";
|
||||
@PostMapping("UpsertUserChargelogApi")
|
||||
public String upsertUserChargelog(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertUserChargelogApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("GetUserCourseApi")
|
||||
@@ -305,6 +309,27 @@ public class Maimai2ServletController {
|
||||
return "{\"returnCode\":\"1\"}";
|
||||
}
|
||||
|
||||
// Festival APIs
|
||||
@PostMapping("CreateTokenApi")
|
||||
String createTokenHandler(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"Bearer\":\"AQUATOKEN\"}";
|
||||
}
|
||||
|
||||
@PostMapping("RemoveTokenApi")
|
||||
String removeTokenHandler(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":\"1\"}";
|
||||
}
|
||||
|
||||
@PostMapping("GetUserRecommendRateMusicApi")
|
||||
public String getUserRecommendRateMusicHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserRecommendRateMusicHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserRecommendSelectMusicApi")
|
||||
public String getUserRecommendSelectMusicHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserRecommendSelectMusicHandler.handle(request);
|
||||
}
|
||||
|
||||
// CardMaker APIs
|
||||
@PostMapping("CMGetSellingCardApi")
|
||||
String cmGetSellingCard(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
|
||||
@@ -35,8 +35,7 @@ public class GetUserFriendSeasonRankingHandler implements BaseHandler {
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
int nextIndexVal = ((Number) request.get("nextIndex")).intValue();
|
||||
|
||||
int maxCount = 20;
|
||||
int maxCount = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
int pageNum = nextIndexVal / maxCount;
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserRecommendRateMusicHandler")
|
||||
public class GetUserRecommendRateMusicHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserRecommendRateMusicHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<Object> userRecommendRateMusicIdList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userRecommendRateMusicIdList", userRecommendRateMusicIdList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserRecommendSelectMusicHandler")
|
||||
public class GetUserRecommendSelectMusicHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserRecommendSelectMusicHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<Object> userRecommendSelectionMusicIdList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userRecommendSelectionMusicIdList", userRecommendSelectionMusicIdList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,5 @@ public class UserLoginResp {
|
||||
public int loginCount = 1;
|
||||
public int consecutiveLoginCount = 0;
|
||||
public int loginId = 1; // What is this?
|
||||
public String Bearer = "AQUATOKEN";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package icu.samnyan.aqua.sega.maimai2.model.response.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserRecommendRateMusic {
|
||||
private int musicId;
|
||||
private int level;
|
||||
private int averageAchievement;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@JsonPropertyOrder({"selectMusicId", "selectDifficultyId", "categoryIndex", "musicIndex",
|
||||
"extraFlag", "selectScoreType", "extendContentBit", "isPhotoAgree", "isGotoCodeRead",
|
||||
"selectResultDetails", "sortCategorySetting", "sortMusicSetting", "selectedCardList", "encountMapNpcList"})
|
||||
"selectResultDetails", "sortCategorySetting", "sortMusicSetting", "playStatusSetting", "selectedCardList", "encountMapNpcList"})
|
||||
public class UserExtend implements Serializable {
|
||||
|
||||
@Id
|
||||
@@ -52,6 +52,7 @@ public class UserExtend implements Serializable {
|
||||
private boolean selectResultDetails;
|
||||
private int sortCategorySetting; //enum SortTabID
|
||||
private int sortMusicSetting; //enum SortMusicID
|
||||
private int playStatusSetting; //enum PlaystatusTabID
|
||||
|
||||
@Convert(converter = IntegerListConverter.class)
|
||||
private List<Integer> selectedCardList;
|
||||
|
||||
@@ -38,6 +38,7 @@ public class UserMusicDetail implements Serializable {
|
||||
private int syncStatus;
|
||||
private int deluxscoreMax;
|
||||
private int scoreRank;
|
||||
private int extNum1;
|
||||
|
||||
public UserMusicDetail(UserDetail user) {
|
||||
this.user = user;
|
||||
|
||||
@@ -62,6 +62,7 @@ public class UserOption implements Serializable {
|
||||
private int ansVolume;
|
||||
private int tapHoldVolume;
|
||||
private int criticalSe;
|
||||
private int tapSe;
|
||||
private int breakSe;
|
||||
private int breakVolume;
|
||||
private int exSe;
|
||||
|
||||
Reference in New Issue
Block a user