mirror of https://github.com/hykilpikonna/AquaDX
[maimai2] Add dx support
parent
235939fba3
commit
9fa2d13c98
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
</parent>
|
||||
<groupId>icu.samnya</groupId>
|
||||
<artifactId>aqua</artifactId>
|
||||
<version>0.0.16-RELEASE</version>
|
||||
<version>0.0.17-RELEASE</version>
|
||||
<name>Aqua Server</name>
|
||||
<description>A multipurpose game server</description>
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package icu.samnyan.aqua;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.BeanNameGenerator;
|
||||
|
||||
public class AquaBeanNameGenerator implements BeanNameGenerator {
|
||||
|
||||
@Override
|
||||
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
|
||||
return definition.getBeanClassName();
|
||||
}
|
||||
|
||||
}
|
|
@ -4,13 +4,17 @@ import icu.samnyan.aqua.sega.aimedb.AimeDbServer;
|
|||
import icu.samnyan.aqua.spring.util.AutoChecker;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication()
|
||||
public class AquaServerApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ConfigurableApplicationContext ctx = SpringApplication.run(AquaServerApplication.class, args);
|
||||
final SpringApplicationBuilder builder = new SpringApplicationBuilder(AquaServerApplication.class);
|
||||
builder.beanNameGenerator(new AquaBeanNameGenerator());
|
||||
|
||||
ConfigurableApplicationContext ctx = builder.run(args);
|
||||
|
||||
final AimeDbServer aimeDbServer = ctx.getBean(AimeDbServer.class);
|
||||
aimeDbServer.start();
|
||||
|
|
|
@ -126,7 +126,10 @@ public class AllNetController {
|
|||
case "SDDT":
|
||||
return "http://" + HOST + ":" + PORT + "/OngekiServlet/";
|
||||
case "SDEY":
|
||||
return "http://" + HOST + ":" + PORT + "/";
|
||||
return "http://" + HOST + ":" + PORT + "/MaimaiServlet/";
|
||||
case "SDEZ":
|
||||
// This leads to http://HOST+PORT/Maimai2Servlet/
|
||||
return HOST + ":" + PORT + "/";
|
||||
default:
|
||||
return "http://" + HOST + ":" + PORT + "/";
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ public class CompressionFilter extends OncePerRequestFilter {
|
|||
filterList.add("/ChuniServlet");
|
||||
filterList.add("/OngekiServlet");
|
||||
filterList.add("/MaimaiServlet");
|
||||
filterList.add("/Maimai2Servlet");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,245 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.impl.*;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("Maimai2Servlet")
|
||||
public class Maimai2ServletController {
|
||||
|
||||
private final GetGameSettingHandler getGameSettingHandler;
|
||||
private final GetGameEventHandler getGameEventHandler;
|
||||
private final GetGameRankingHandler getGameRankingHandler;
|
||||
private final GetGameTournamentInfoHandler getGameTournamentInfoHandler;
|
||||
private final GetTransferFriendHandler getTransferFriendHandler;
|
||||
private final GetUserActivityHandler getUserActivityHandler;
|
||||
private final UserLoginHandler userLoginHandler;
|
||||
private final UserLogoutHandler userLogoutHandler;
|
||||
private final GetUserDataHandler getUserDataHandler;
|
||||
private final UpsertUserAllHandler upsertUserAllHandler;
|
||||
private final GetUserPreviewHandler getUserPreviewHandler;
|
||||
private final GetUserCharacterHandler getUserCharacterHandler;
|
||||
private final GetUserOptionHandler getUserOptionHandler;
|
||||
private final GetUserItemHandler getUserItemHandler;
|
||||
private final GetUserExtendHandler getUserExtendHandler;
|
||||
private final GetUserGhostHandler getUserGhostHandler;
|
||||
private final GetUserLoginBonusHandler getUserLoginBonusHandler;
|
||||
private final GetUserMapHandler getUserMapHandler;
|
||||
private final GetUserFavoriteHandler getUserFavoriteHandler;
|
||||
private final GetUserCardHandler getUserCardHandler;
|
||||
private final GetUserMusicHandler getUserMusicHandler;
|
||||
private final GetUserRatingHandler getUserRatingHandler;
|
||||
private final GetUserRegionHandler getUserRegionHandler;
|
||||
|
||||
public Maimai2ServletController(GetGameSettingHandler getGameSettingHandler, GetGameEventHandler getGameEventHandler, GetGameRankingHandler getGameRankingHandler, GetGameTournamentInfoHandler getGameTournamentInfoHandler,
|
||||
GetTransferFriendHandler getTransferFriendHandler, GetUserActivityHandler getUserActivityHandler, UserLoginHandler userLoginHandler, UserLogoutHandler userLogoutHandler,
|
||||
GetUserDataHandler getUserDataHandler, UpsertUserAllHandler upsertUserAllHandler, GetUserPreviewHandler getUserPreviewHandler, GetUserCharacterHandler getUserCharacterHandler,
|
||||
GetUserOptionHandler getUserOptionHandler, GetUserItemHandler getUserItemHandler, GetUserExtendHandler getUserExtendHandler, GetUserGhostHandler getUserGhostHandler,
|
||||
GetUserLoginBonusHandler getUserLoginBonusHandler, GetUserMapHandler getUserMapHandler, GetUserFavoriteHandler getUserFavoriteHandler,
|
||||
GetUserCardHandler getUserCardHandler, GetUserMusicHandler getUserMusicHandler, GetUserRatingHandler getUserRatingHandler, GetUserRegionHandler getUserRegionHandler) {
|
||||
this.getGameSettingHandler = getGameSettingHandler;
|
||||
this.getGameEventHandler = getGameEventHandler;
|
||||
this.getGameRankingHandler = getGameRankingHandler;
|
||||
this.getGameTournamentInfoHandler = getGameTournamentInfoHandler;
|
||||
this.getTransferFriendHandler = getTransferFriendHandler;
|
||||
this.getUserActivityHandler = getUserActivityHandler;
|
||||
this.userLoginHandler = userLoginHandler;
|
||||
this.userLogoutHandler = userLogoutHandler;
|
||||
this.getUserDataHandler = getUserDataHandler;
|
||||
this.upsertUserAllHandler = upsertUserAllHandler;
|
||||
this.getUserPreviewHandler = getUserPreviewHandler;
|
||||
this.getUserCharacterHandler = getUserCharacterHandler;
|
||||
this.getUserOptionHandler = getUserOptionHandler;
|
||||
this.getUserItemHandler = getUserItemHandler;
|
||||
this.getUserExtendHandler = getUserExtendHandler;
|
||||
this.getUserGhostHandler = getUserGhostHandler;
|
||||
this.getUserLoginBonusHandler = getUserLoginBonusHandler;
|
||||
this.getUserMapHandler = getUserMapHandler;
|
||||
this.getUserFavoriteHandler = getUserFavoriteHandler;
|
||||
this.getUserCardHandler = getUserCardHandler;
|
||||
this.getUserMusicHandler = getUserMusicHandler;
|
||||
this.getUserRatingHandler = getUserRatingHandler;
|
||||
this.getUserRegionHandler = getUserRegionHandler;
|
||||
}
|
||||
|
||||
// Mandatory for boot
|
||||
@PostMapping("GetGameEventApi")
|
||||
public String getGameEvent(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getGameEventHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetGameRankingApi")
|
||||
public String getGameRanking(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getGameRankingHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetGameSettingApi")
|
||||
public String getGameSetting(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getGameSettingHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetGameTournamentInfoApi")
|
||||
public String getGameTournamentInfoHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getGameTournamentInfoHandler.handle(request);
|
||||
}
|
||||
|
||||
// Gameplay
|
||||
@PostMapping("GetTransferFriendApi")
|
||||
public String getTransferFriendHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getTransferFriendHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserActivityApi")
|
||||
public String getUserActivityHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserActivityHandler.handle(request);
|
||||
}
|
||||
|
||||
// maybe releated DX Pass? return empty
|
||||
@PostMapping("GetUserCardApi")
|
||||
public String getUserCardHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserCardHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserCharacterApi")
|
||||
public String getUserCharacterHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserCharacterHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserDataApi")
|
||||
public String getUserDataHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserDataHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserExtendApi")
|
||||
public String getUserExtendHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserExtendHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserFavoriteApi")
|
||||
public String getUserFavoriteHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserFavoriteHandler.handle(request);
|
||||
}
|
||||
|
||||
// No support, return empty
|
||||
@PostMapping("GetUserGhostApi")
|
||||
public String getUserGhostHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserGhostHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserItemApi")
|
||||
public String getUserItemHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserItemHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserLoginBonusApi")
|
||||
public String getUserLoginBonusHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserLoginBonusHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserMapApi")
|
||||
public String getUserMapHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserMapHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserMusicApi")
|
||||
public String getUserMusicHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserMusicHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserOptionApi")
|
||||
public String getUserOptionHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserOptionHandler.handle(request);
|
||||
}
|
||||
|
||||
// No support
|
||||
@PostMapping("GetUserPortraitApi")
|
||||
public String getUserPortraitHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return "{\"length\":0,\"userPortraitList\":[]}";
|
||||
}
|
||||
|
||||
@PostMapping("GetUserPreviewApi")
|
||||
public String getUserPreviewHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserPreviewHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserRatingApi")
|
||||
public String getUserRatingHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserRatingHandler.handle(request);
|
||||
}
|
||||
|
||||
// I don't know what it is. return empty
|
||||
@PostMapping("GetUserRegionApi")
|
||||
public String getUserRegionHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserRegionHandler.handle(request);
|
||||
}
|
||||
|
||||
// Seems only used for tournament, No Support
|
||||
@PostMapping("GetUserScoreRankingApi")
|
||||
public String getUserScoreRankingHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return "{}";
|
||||
}
|
||||
|
||||
// No support
|
||||
@PostMapping("UploadUserPhotoApi")
|
||||
public String uploadUserPhotoHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPhotoApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UploadUserPlaylogApi")
|
||||
public String uploadUserPlaylogHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPlaylogApi\"}";
|
||||
}
|
||||
|
||||
// No support, return error code
|
||||
@PostMapping("UploadUserPortraitApi")
|
||||
public String uploadUserPortraitHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return "{\"returnCode\":-1,\"apiName\":\"com.sega.maimai2servlet.api.UploadUserPortraitApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UserLoginApi")
|
||||
public String userLoginHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return userLoginHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UserLogoutApi")
|
||||
public String userLogoutHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return userLogoutHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientBookkeepingApi")
|
||||
public String upsertClientBookkeeping(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertClientBookkeepingApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientSettingApi")
|
||||
public String upsertClientSetting(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertClientSettingApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientTestmodeApi")
|
||||
public String upsertClientTestmode(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertClientTestmodeApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientUploadApi")
|
||||
public String upsertClientUpload(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertClientUploadApi\"}";
|
||||
}
|
||||
|
||||
// Score saving
|
||||
@PostMapping("UpsertUserAllApi")
|
||||
public String upsertUserAllHandler(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return upsertUserAllHandler.handle(request);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@RestControllerAdvice(basePackages = "icu.samnyan.aqua.sega.maimai2")
|
||||
public class Maimai2ServletControllerAdvice {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(Maimai2ServletControllerAdvice.class);
|
||||
|
||||
/**
|
||||
* Get the map object from json string
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
*/
|
||||
@ModelAttribute
|
||||
public Map<String, Object> preHandle(HttpServletRequest request) throws IOException {
|
||||
byte[] src = request.getInputStream().readAllBytes();
|
||||
String outputString = new String(src, StandardCharsets.UTF_8).trim();
|
||||
logger.info("Request {} : {}", request.getRequestURI(), outputString);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
return mapper.readValue(outputString, new TypeReference<>() {
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.MapEncountNpc;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2MapEncountNpcRepository")
|
||||
public interface MapEncountNpcRepository extends JpaRepository<MapEncountNpc, Long> {
|
||||
|
||||
Optional<MapEncountNpc> findByUserAndMusicId(UserDetail user, int musicId);
|
||||
|
||||
Page<MapEncountNpc> findByUser_Card_ExtIdAndMusicId(long userId, int musicId, Pageable page);
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserAct;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserActRepository")
|
||||
public interface UserActRepository extends JpaRepository<UserAct, Long> {
|
||||
|
||||
Optional<UserAct> findByUserAndKindAndActivityId(UserDetail user, int kind, int id);
|
||||
|
||||
List<UserAct> findByUser_Card_ExtIdAndKind(long userId, int kind);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserCharacterRepository")
|
||||
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
|
||||
|
||||
List<UserCharacter> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserCharacter> findByUserAndCharacterId(UserDetail user, int characterId);
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserDataRepository")
|
||||
public interface UserDataRepository extends JpaRepository<UserDetail, Long> {
|
||||
Optional<UserDetail> findByCard_ExtId(long userId);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserExtend;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserExtendRepository")
|
||||
public interface UserExtendRepository extends JpaRepository<UserExtend, Long> {
|
||||
|
||||
Optional<UserExtend> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserExtend> findByUser_Card_ExtId(Long extId);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserFavorite;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserFavoriteRepository")
|
||||
public interface UserFavoriteRepository extends JpaRepository<UserFavorite, Long> {
|
||||
|
||||
Optional<UserFavorite> findByUserAndItemKind(UserDetail user, int kind);
|
||||
//Optional<UserFavorite> findByUserIdAndItemKind(long userId, int kind);
|
||||
|
||||
List<UserFavorite> findByUserIdAndItemKind(long userId, int kind);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserItem;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserItemRepository")
|
||||
public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
Optional<UserItem> findByUserAndItemKindAndItemId(UserDetail user, int itemKind, int itemId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtIdAndItemKind(long userId, int kind, Pageable page);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserLoginBonus;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserLoginBonusRepository")
|
||||
public interface UserLoginBonusRepository extends JpaRepository<UserLoginBonus, Long> {
|
||||
|
||||
Optional<UserLoginBonus> findByUserAndBonusId(UserDetail user, int bonusId);
|
||||
|
||||
Page<UserLoginBonus> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMap;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserMapRepository")
|
||||
public interface UserMapRepository extends JpaRepository<UserMap, Long> {
|
||||
|
||||
Optional<UserMap> findByUserAndMapId(UserDetail user, int mapId);
|
||||
|
||||
Page<UserMap> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMusicDetail;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserMusicDetailRepository")
|
||||
public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail, Long> {
|
||||
|
||||
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserDetail user, int musicId, int level);
|
||||
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserOption;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserOptionRepository")
|
||||
public interface UserOptionRepository extends JpaRepository<UserOption, Long> {
|
||||
|
||||
Optional<UserOption> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserOption> findByUser_Card_ExtId(Long extId);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserRate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserRateRepository")
|
||||
public interface UserRateRepository extends JpaRepository<UserRate, Long> {
|
||||
|
||||
Optional<UserRate> findByUserAndMusicId(UserDetail user, int musicId);
|
||||
|
||||
List<UserRate> findByUser_Card_ExtId(long userId);
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserUdemae;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("Maimai2UserUdemaeRepository")
|
||||
public interface UserUdemaeRepository extends JpaRepository<UserUdemae, Long> {
|
||||
|
||||
Optional<UserUdemae> findByUser(UserDetail user);
|
||||
|
||||
Optional<UserUdemae> findByUser_Card_ExtId(Long extId);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
public interface BaseHandler {
|
||||
|
||||
String handle(Map<String, Object> request) throws JsonProcessingException;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
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.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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
|
||||
public class GetGameEventHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameEventHandler.class);
|
||||
|
||||
//private final GameEventRepository gameEventRepository;
|
||||
|
||||
private final StringMapper mapper;
|
||||
|
||||
public GetGameEventHandler(StringMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
String type = Integer.toString((int) request.get("type"));
|
||||
|
||||
List<Object> gameEventList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("type", type);
|
||||
resultMap.put("gameEventList", gameEventList);
|
||||
|
||||
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.StringMapper;
|
||||
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
|
||||
public class GetGameRankingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameRankingHandler.class);
|
||||
|
||||
private final StringMapper mapper;
|
||||
|
||||
public GetGameRankingHandler(StringMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
String type = Integer.toString((int) request.get("type"));
|
||||
|
||||
List<Object> gameRankingList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("type", type);
|
||||
resultMap.put("gameRankingList", gameRankingList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
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.maimai2.model.response.GetGameSettingResp;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.GameSetting;
|
||||
import icu.samnyan.aqua.sega.general.dao.PropertyEntryRepository;
|
||||
import icu.samnyan.aqua.sega.general.model.PropertyEntry;
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class GetGameSettingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameSettingHandler.class);
|
||||
|
||||
private final StringMapper mapper;
|
||||
|
||||
private final PropertyEntryRepository propertyEntryRepository;
|
||||
|
||||
@Autowired
|
||||
public GetGameSettingHandler(StringMapper mapper, PropertyEntryRepository propertyEntryRepository) {
|
||||
this.mapper = mapper;
|
||||
this.propertyEntryRepository = propertyEntryRepository;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
|
||||
PropertyEntry start = propertyEntryRepository.findByPropertyKey("reboot_start_time")
|
||||
.orElseGet(() -> new PropertyEntry("reboot_start_time", "2020-01-01 23:59:00.0"));
|
||||
PropertyEntry end = propertyEntryRepository.findByPropertyKey("reboot_end_time")
|
||||
.orElseGet(() -> new PropertyEntry("reboot_end_time", "2020-01-01 23:59:00.0"));
|
||||
|
||||
GameSetting gameSetting = new GameSetting(
|
||||
false,
|
||||
10,
|
||||
start.getPropertyValue(),
|
||||
end.getPropertyValue(),
|
||||
10000,
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0);
|
||||
|
||||
GetGameSettingResp resp = new GetGameSettingResp(
|
||||
true,
|
||||
gameSetting
|
||||
);
|
||||
|
||||
String json = mapper.write(resp);
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
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.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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
|
||||
public class GetGameTournamentInfoHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameTournamentInfoHandler.class);
|
||||
|
||||
//private final GameEventRepository gameEventRepository;
|
||||
|
||||
private final StringMapper mapper;
|
||||
|
||||
public GetGameTournamentInfoHandler(StringMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
|
||||
List<Object> gameTournamentInfoList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("length", 0);
|
||||
resultMap.put("gameTournamentInfoList", gameTournamentInfoList);
|
||||
|
||||
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.StringMapper;
|
||||
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
|
||||
public class GetTransferFriendHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetTransferFriendHandler.class);
|
||||
|
||||
private final StringMapper mapper;
|
||||
|
||||
public GetTransferFriendHandler(StringMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
int userId = (int) request.get("userId");
|
||||
|
||||
List<Object> transferFriendList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("transferFriendList", transferFriendList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserActRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserActivity;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserAct;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserActivityHandler")
|
||||
public class GetUserActivityHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserActivityHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserActRepository userActRepository;
|
||||
|
||||
public GetUserActivityHandler(BasicMapper mapper, UserActRepository userActRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userActRepository = userActRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
// kind 1 = playList, kind 2 = musicList
|
||||
// maimaiDX require these two
|
||||
List<UserAct> userPlayList = userActRepository.findByUser_Card_ExtIdAndKind(userId, 1);
|
||||
List<UserAct> userMusicList = userActRepository.findByUser_Card_ExtIdAndKind(userId, 2);
|
||||
|
||||
UserActivity userActivity = new UserActivity();
|
||||
userActivity.setMusicList(userMusicList);
|
||||
userActivity.setPlayList(userPlayList);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userActivity", userActivity);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
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
|
||||
public class GetUserCardHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserCardHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<Object> userCardList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("nextIndex", 0);
|
||||
resultMap.put("userCardList", userCardList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserCharacterRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserCharacterHandler")
|
||||
public class GetUserCharacterHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserCharacterHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserCharacterRepository userCharacterRepository;
|
||||
|
||||
public GetUserCharacterHandler(BasicMapper mapper, UserCharacterRepository userCharacterRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userCharacterRepository = userCharacterRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<UserCharacter> userCharacterList = userCharacterRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userCharacterList", userCharacterList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserDataRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class GetUserDataHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserDataRepository userDataRepository;
|
||||
|
||||
public GetUserDataHandler(BasicMapper mapper, UserDataRepository userDataRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userDataRepository = userDataRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserDetail userData = userDataRepository.findByCard_ExtId(userId).orElseThrow();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userData", userData);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserExtendRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserExtend;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class GetUserExtendHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserExtendHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserExtendRepository userExtendRepository;
|
||||
|
||||
public GetUserExtendHandler(BasicMapper mapper, UserExtendRepository userExtendRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userExtendRepository = userExtendRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserExtend userExtend = userExtendRepository.findByUser_Card_ExtId(userId).orElseThrow();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userExtend", userExtend);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserFavoriteRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserFavorite;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserFavoriteHandler")
|
||||
public class GetUserFavoriteHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserFavoriteHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserFavoriteRepository userFavoriteRepository;
|
||||
|
||||
public GetUserFavoriteHandler(BasicMapper mapper, UserFavoriteRepository userFavoriteRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userFavoriteRepository = userFavoriteRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
int itemKind = ((Number) request.get("itemKind")).intValue();
|
||||
|
||||
List<UserFavorite> userFavoriteList = userFavoriteRepository.findByUserIdAndItemKind(userId, itemKind);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userFavoriteData", userFavoriteList);
|
||||
|
||||
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
|
||||
public class GetUserGhostHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserGhostHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<Object> userGhostList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userGhostList", userGhostList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserItemRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserItem;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserItemHandler")
|
||||
public class GetUserItemHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserItemHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserItemRepository userItemRepository;
|
||||
|
||||
public GetUserItemHandler(BasicMapper mapper, UserItemRepository userItemRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userItemRepository = userItemRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
long nextIndexVal = ((Number) request.get("nextIndex")).longValue();
|
||||
int maxCount = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
long mul = 10000000000L;
|
||||
|
||||
int kind = (int) (nextIndexVal / mul);
|
||||
int nextIndex = (int) (nextIndexVal % mul);
|
||||
int pageNum = nextIndex / maxCount;
|
||||
|
||||
Page<UserItem> dbPage = userItemRepository.findByUser_Card_ExtIdAndItemKind(userId, kind, PageRequest.of(pageNum, maxCount));
|
||||
|
||||
long currentIndex = kind * mul + maxCount * pageNum + dbPage.getNumberOfElements();
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("nextIndex", dbPage.getNumberOfElements() < maxCount ? 0 : currentIndex);
|
||||
resultMap.put("itemKind", kind);
|
||||
resultMap.put("userItemList", dbPage.getContent());
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserLoginBonusRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserLoginBonus;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserLoginBonusHandler")
|
||||
public class GetUserLoginBonusHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserLoginBonusHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserLoginBonusRepository userLoginBonusRepository;
|
||||
|
||||
public GetUserLoginBonusHandler(BasicMapper mapper, UserLoginBonusRepository userLoginBonusRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userLoginBonusRepository = userLoginBonusRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
int pageNum = nextIndexVal / maxCount;
|
||||
|
||||
Page<UserLoginBonus> dbPage = userLoginBonusRepository.findByUser_Card_ExtId(userId, PageRequest.of(pageNum, maxCount));
|
||||
|
||||
long currentIndex = maxCount * pageNum + dbPage.getNumberOfElements();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("nextIndex", dbPage.getNumberOfElements() < maxCount ? 0 : currentIndex);
|
||||
resultMap.put("userLoginBonusList", dbPage.getContent());
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserMapRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMap;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserMapHandler")
|
||||
public class GetUserMapHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserMapHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserMapRepository userMapRepository;
|
||||
|
||||
public GetUserMapHandler(BasicMapper mapper, UserMapRepository userMapRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userMapRepository = userMapRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
int pageNum = nextIndexVal / maxCount;
|
||||
|
||||
Page<UserMap> dbPage = userMapRepository.findByUser_Card_ExtId(userId, PageRequest.of(pageNum, maxCount));
|
||||
|
||||
long currentIndex = maxCount * pageNum + dbPage.getNumberOfElements();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("nextIndex", dbPage.getNumberOfElements() < maxCount ? 0 : currentIndex);
|
||||
resultMap.put("userMapList", dbPage.getContent());
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserMusicDetailRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserMusic;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMusicDetail;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
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("Maimai2GetUserMusicHandler")
|
||||
public class GetUserMusicHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserMusicHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserMusicDetailRepository userMusicDetailRepository;
|
||||
|
||||
public GetUserMusicHandler(BasicMapper mapper, UserMusicDetailRepository userMusicDetailRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userMusicDetailRepository = userMusicDetailRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
int pageNum = nextIndexVal / maxCount;
|
||||
|
||||
Page<UserMusicDetail> dbPage = userMusicDetailRepository.findByUser_Card_ExtId(userId, PageRequest.of(pageNum, maxCount));
|
||||
|
||||
long currentIndex = maxCount * pageNum + dbPage.getNumberOfElements();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("nextIndex", dbPage.getNumberOfElements() < maxCount ? 0 : currentIndex);
|
||||
|
||||
UserMusic userMusic = new UserMusic();
|
||||
userMusic.setUserMusicDetailList(dbPage.getContent());
|
||||
|
||||
List<UserMusic> userMusicList = new ArrayList<>();
|
||||
userMusicList.add(userMusic);
|
||||
|
||||
resultMap.put("userMusicList", userMusicList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserOptionRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserOption;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserOptionHandler")
|
||||
public class GetUserOptionHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserOptionHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserOptionRepository userOptionRepository;
|
||||
|
||||
public GetUserOptionHandler(BasicMapper mapper, UserOptionRepository userOptionRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userOptionRepository = userOptionRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserOption userOption = userOptionRepository.findByUser_Card_ExtId(userId).orElseThrow();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userOption", userOption);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserDataRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserOptionRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.GetUserPreviewResp;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserOption;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2GetUserPreviewHandler")
|
||||
public class GetUserPreviewHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserPreviewHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserDataRepository userDataRepository;
|
||||
private final UserOptionRepository userOptionRepository;
|
||||
|
||||
public GetUserPreviewHandler(BasicMapper mapper, UserDataRepository userDataRepository, UserOptionRepository userOptionRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userDataRepository = userDataRepository;
|
||||
this.userOptionRepository = userOptionRepository;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
Optional<UserDetail> userDataOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
GetUserPreviewResp resp = new GetUserPreviewResp();
|
||||
resp.setUserId(userId);
|
||||
String json;
|
||||
if (userDataOptional.isPresent() && userDataOptional.get().getUserName() != null) {
|
||||
UserDetail user = userDataOptional.get();
|
||||
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser_Card_ExtId(userId);
|
||||
resp.setUserName(user.getUserName());
|
||||
resp.setLogin(false);
|
||||
resp.setLastGameId(user.getLastGameId());
|
||||
resp.setLastDataVersion(user.getLastDataVersion());
|
||||
resp.setLastRomVersion(user.getLastRomVersion());
|
||||
resp.setLastLoginDate(user.getLastPlayDate());
|
||||
resp.setLastPlayDate(user.getLastPlayDate());
|
||||
resp.setPlayerRating(user.getPlayerRating());
|
||||
resp.setNameplateId(user.getPlateId());
|
||||
resp.setIconId(user.getIconId());
|
||||
resp.setTrophyId(0);
|
||||
resp.setPartnerId(user.getPartnerId());
|
||||
resp.setFrameId(user.getFrameId());
|
||||
resp.setDispRate(user.getPlayerRating());
|
||||
resp.setTotalAwake(user.getTotalAwake());
|
||||
resp.setIsNetMember(user.getIsNetMember());
|
||||
resp.setDailyBonusDate(user.getDailyBonusDate());
|
||||
if (userOptionOptional.isPresent()) {
|
||||
UserOption option = userOptionOptional.get();
|
||||
resp.setHeadPhoneVolume(option.getHeadPhoneVolume());
|
||||
}
|
||||
resp.setInherit(false);
|
||||
|
||||
json = mapper.write(resp);
|
||||
} else {
|
||||
json = "{}";
|
||||
}
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserDataRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserRateRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.UserUdemaeRepository;
|
||||
import icu.samnyan.aqua.sega.maimai2.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserRating;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserDetail;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserRate;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserUdemae;
|
||||
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;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class GetUserRatingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserRatingHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserRateRepository userRateRepository;
|
||||
private final UserUdemaeRepository userUdemaeRepository;
|
||||
private final UserDataRepository userDataRepository;
|
||||
|
||||
public GetUserRatingHandler(BasicMapper mapper, UserRateRepository userRateRepository, UserUdemaeRepository userUdemaeRepository,
|
||||
UserDataRepository userDataRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userRateRepository = userRateRepository;
|
||||
this.userUdemaeRepository = userUdemaeRepository;
|
||||
this.userDataRepository = userDataRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<UserRate> userRate = userRateRepository.findByUser_Card_ExtId(userId);
|
||||
List<UserRate> emptyRating = new ArrayList<>();
|
||||
|
||||
UserRating userRating = new UserRating();
|
||||
|
||||
Optional<UserDetail> userDataOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
if (userDataOptional.isPresent() && userDataOptional.get().getUserName() != null) {
|
||||
UserDetail user = userDataOptional.get();
|
||||
userRating.setRating(user.getPlayerRating());
|
||||
}
|
||||
|
||||
// TODO: Fix these, rating is incorrect
|
||||
|
||||
// Old charts (standard) = 25
|
||||
userRating.setRatingList(userRate);
|
||||
|
||||
// New charts (DX) = 15
|
||||
userRating.setNewRatingList(emptyRating);
|
||||
|
||||
// ??
|
||||
userRating.setNextRatingList(emptyRating);
|
||||
userRating.setNextNewRatingList(emptyRating);
|
||||
|
||||
Optional<UserUdemae> optionalUserUdemae = userUdemaeRepository.findByUser_Card_ExtId(userId);
|
||||
if (optionalUserUdemae.isPresent()) {
|
||||
UserUdemae userUdemae = optionalUserUdemae.get();
|
||||
userRating.setUdemae(userUdemae);
|
||||
} else {
|
||||
userRating.setUdemae(new UserUdemae());
|
||||
}
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userRating", userRating);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
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
|
||||
public class GetUserRegionHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserDataHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserRegionHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<Object> userRegionList = new ArrayList<>();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", 0);
|
||||
resultMap.put("userRegionList", userRegionList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,297 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.general.service.CardService;
|
||||
import icu.samnyan.aqua.sega.maimai2.dao.userdata.*;
|
||||
import icu.samnyan.aqua.sega.maimai.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.request.UpsertUserAll;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.request.data.UserAll;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserActivity;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserRating;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("Maimai2UpsertUserAllHandler")
|
||||
public class UpsertUserAllHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UpsertUserAllHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final CardService cardService;
|
||||
|
||||
private final UserDataRepository userDataRepository;
|
||||
private final UserExtendRepository userExtendRepository;
|
||||
private final UserOptionRepository userOptionRepository;
|
||||
private final UserItemRepository userItemRepository;
|
||||
private final UserMusicDetailRepository userMusicDetailRepository;
|
||||
private final UserActRepository userActRepository;
|
||||
private final UserCharacterRepository userCharacterRepository;
|
||||
private final UserMapRepository userMapRepository;
|
||||
private final UserLoginBonusRepository userLoginBonusRepository;
|
||||
private final UserFavoriteRepository userFavoriteRepository;
|
||||
private final UserRateRepository userRateRepository;
|
||||
private final UserUdemaeRepository userUdemaeRepository;
|
||||
|
||||
public UpsertUserAllHandler(BasicMapper mapper, CardService cardService, UserDataRepository userDataRepository, UserExtendRepository userExtendRepository, UserOptionRepository userOptionRepository, UserItemRepository userItemRepository, UserMusicDetailRepository userMusicDetailRepository, UserActRepository userActRepository, UserCharacterRepository userCharacterRepository, UserMapRepository userMapRepository, UserLoginBonusRepository userLoginBonusRepository, UserFavoriteRepository userFavoriteRepository, UserRateRepository userRateRepository, UserUdemaeRepository userUdemaeRepository) {
|
||||
this.mapper = mapper;
|
||||
this.cardService = cardService;
|
||||
this.userDataRepository = userDataRepository;
|
||||
this.userExtendRepository = userExtendRepository;
|
||||
this.userOptionRepository = userOptionRepository;
|
||||
this.userItemRepository = userItemRepository;
|
||||
this.userMusicDetailRepository = userMusicDetailRepository;
|
||||
this.userActRepository = userActRepository;
|
||||
this.userCharacterRepository = userCharacterRepository;
|
||||
this.userMapRepository = userMapRepository;
|
||||
this.userLoginBonusRepository = userLoginBonusRepository;
|
||||
this.userFavoriteRepository = userFavoriteRepository;
|
||||
this.userRateRepository = userRateRepository;
|
||||
this.userUdemaeRepository = userUdemaeRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
|
||||
UpsertUserAll upsertUserAll = mapper.convert(request, UpsertUserAll.class);
|
||||
long userId = upsertUserAll.getUserId();
|
||||
UserAll userAll = upsertUserAll.getUpsertUserAll();
|
||||
|
||||
// UserData
|
||||
UserDetail userData;
|
||||
UserDetail newUserData;
|
||||
if (userAll.getUserData() == null) {
|
||||
return null;
|
||||
} else {
|
||||
newUserData = userAll.getUserData().get(0);
|
||||
Optional<UserDetail> userOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
if (userOptional.isPresent()) {
|
||||
userData = userOptional.get();
|
||||
} else {
|
||||
userData = new UserDetail();
|
||||
Card card = cardService.getCardByExtId(userId).orElseThrow();
|
||||
userData.setCard(card);
|
||||
}
|
||||
|
||||
newUserData.setId(userData.getId());
|
||||
newUserData.setCard(userData.getCard());
|
||||
// Decode Username
|
||||
String userName = new String(newUserData.getUserName());
|
||||
|
||||
newUserData.setUserName(userName);
|
||||
userDataRepository.saveAndFlush(newUserData);
|
||||
}
|
||||
|
||||
// UserExtend
|
||||
if (userAll.getUserExtend() != null) {
|
||||
UserExtend newUserExtend = userAll.getUserExtend().get(0);
|
||||
|
||||
Optional<UserExtend> userExtendOptional = userExtendRepository.findByUser(newUserData);
|
||||
UserExtend userExtend = userExtendOptional.orElseGet(() -> new UserExtend(newUserData));
|
||||
|
||||
newUserExtend.setId(userExtend.getId());
|
||||
newUserExtend.setUser(userExtend.getUser());
|
||||
|
||||
userExtendRepository.save(newUserExtend);
|
||||
}
|
||||
|
||||
// UserOption
|
||||
if (userAll.getUserOption() != null) {
|
||||
UserOption newUserOption = userAll.getUserOption().get(0);
|
||||
|
||||
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser(newUserData);
|
||||
UserOption userOption = userOptionOptional.orElseGet(() -> new UserOption(newUserData));
|
||||
|
||||
newUserOption.setId(userOption.getId());
|
||||
newUserOption.setUser(userOption.getUser());
|
||||
|
||||
userOptionRepository.save(newUserOption);
|
||||
}
|
||||
|
||||
// UserCharacterList
|
||||
if (userAll.getUserCharacterList() != null) {
|
||||
List<UserCharacter> userCharacterList = userAll.getUserCharacterList();
|
||||
List<UserCharacter> newUserCharacterList = new ArrayList<>();
|
||||
for (UserCharacter newUserCharacter : userCharacterList) {
|
||||
int id = newUserCharacter.getCharacterId();
|
||||
|
||||
Optional<UserCharacter> characterOptional = userCharacterRepository.findByUserAndCharacterId(newUserData, id);
|
||||
UserCharacter userCharacter = characterOptional.orElseGet(() -> new UserCharacter(newUserData));
|
||||
|
||||
newUserCharacter.setId(userCharacter.getId());
|
||||
newUserCharacter.setUser(newUserData);
|
||||
newUserCharacterList.add(newUserCharacter);
|
||||
}
|
||||
userCharacterRepository.saveAll(newUserCharacterList);
|
||||
}
|
||||
|
||||
// UserGhost : worthless
|
||||
|
||||
// UserMapList
|
||||
if (userAll.getUserMapList() != null) {
|
||||
List<UserMap> userMapList = userAll.getUserMapList();
|
||||
List<UserMap> newUserMapList = new ArrayList<>();
|
||||
for (UserMap newUserMap : userMapList) {
|
||||
int mapId = newUserMap.getMapId();
|
||||
|
||||
Optional<UserMap> mapOptional = userMapRepository.findByUserAndMapId(newUserData, mapId);
|
||||
UserMap userMap = mapOptional.orElseGet(() -> new UserMap(newUserData));
|
||||
|
||||
newUserMap.setId(userMap.getId());
|
||||
newUserMap.setUser(newUserData);
|
||||
newUserMapList.add(newUserMap);
|
||||
}
|
||||
userMapRepository.saveAll(newUserMapList);
|
||||
}
|
||||
|
||||
// UserLoginBonusList
|
||||
if (userAll.getUserLoginBonusList() != null) {
|
||||
List<UserLoginBonus> userLoginBonusList = userAll.getUserLoginBonusList();
|
||||
List<UserLoginBonus> newUserLoginBonusList = new ArrayList<>();
|
||||
for (UserLoginBonus newUserLoginBonus : userLoginBonusList) {
|
||||
int bonusId = newUserLoginBonus.getBonusId();
|
||||
|
||||
Optional<UserLoginBonus> loginBonusOptional = userLoginBonusRepository.findByUserAndBonusId(newUserData, bonusId);
|
||||
UserLoginBonus userLoginBonus = loginBonusOptional.orElseGet(() -> new UserLoginBonus(newUserData));
|
||||
|
||||
newUserLoginBonus.setId(userLoginBonus.getId());
|
||||
newUserLoginBonus.setUser(newUserData);
|
||||
newUserLoginBonusList.add(newUserLoginBonus);
|
||||
}
|
||||
userLoginBonusRepository.saveAll(newUserLoginBonusList);
|
||||
}
|
||||
|
||||
// UserRatingList
|
||||
if (userAll.getUserRatingList() != null) {
|
||||
UserRating userRating = userAll.getUserRatingList().get(0);
|
||||
|
||||
//Udemae
|
||||
UserUdemae newUserUdemae = userRating.getUdemae();
|
||||
|
||||
Optional<UserUdemae> udemaeOptional = userUdemaeRepository.findByUser(newUserData);
|
||||
UserUdemae userUdemae = udemaeOptional.orElseGet(() -> new UserUdemae(newUserData));
|
||||
|
||||
newUserUdemae.setId(userUdemae.getId());
|
||||
newUserUdemae.setUser(newUserData);
|
||||
|
||||
userUdemaeRepository.saveAndFlush(newUserUdemae);
|
||||
|
||||
List<UserRate> userRateList = userRating.getRatingList();
|
||||
List<UserRate> newUserRateList = new ArrayList<>();
|
||||
|
||||
// UserRate
|
||||
for (UserRate newUserRate : userRateList) {
|
||||
int musicId = newUserRate.getMusicId();
|
||||
|
||||
Optional<UserRate> rateOptional = userRateRepository.findByUserAndMusicId(newUserData, musicId);
|
||||
UserRate userRate = rateOptional.orElseGet(() -> new UserRate(newUserData));
|
||||
|
||||
newUserRate.setId(userRate.getId());
|
||||
newUserRate.setUser(newUserData);
|
||||
newUserRateList.add(newUserRate);
|
||||
|
||||
}
|
||||
userRateRepository.saveAll(newUserRateList);
|
||||
}
|
||||
|
||||
// UserItemList
|
||||
if (userAll.getUserItemList() != null) {
|
||||
List<UserItem> userItemList = userAll.getUserItemList();
|
||||
List<UserItem> newUserItemList = new ArrayList<>();
|
||||
|
||||
for (UserItem newUserItem : userItemList) {
|
||||
int itemId = newUserItem.getItemId();
|
||||
int itemKind = newUserItem.getItemKind();
|
||||
|
||||
Optional<UserItem> itemOptional = userItemRepository.findByUserAndItemKindAndItemId(newUserData, itemKind, itemId);
|
||||
UserItem userItem = itemOptional.orElseGet(() -> new UserItem(newUserData));
|
||||
|
||||
newUserItem.setId(userItem.getId());
|
||||
newUserItem.setUser(newUserData);
|
||||
newUserItemList.add(newUserItem);
|
||||
|
||||
}
|
||||
userItemRepository.saveAll(newUserItemList);
|
||||
}
|
||||
|
||||
// UserMusicDetailList
|
||||
if (userAll.getUserMusicDetailList() != null) {
|
||||
List<UserMusicDetail> userMusicDetailList = userAll.getUserMusicDetailList();
|
||||
List<UserMusicDetail> newUserMusicDetailList = new ArrayList<>();
|
||||
|
||||
for (UserMusicDetail newUserMusicDetail : userMusicDetailList) {
|
||||
int musicId = newUserMusicDetail.getMusicId();
|
||||
int level = newUserMusicDetail.getLevel();
|
||||
|
||||
Optional<UserMusicDetail> musicDetailOptional = userMusicDetailRepository.findByUserAndMusicIdAndLevel(newUserData, musicId, level);
|
||||
UserMusicDetail userMusicDetail = musicDetailOptional.orElseGet(() -> new UserMusicDetail(newUserData));
|
||||
|
||||
newUserMusicDetail.setId(userMusicDetail.getId());
|
||||
newUserMusicDetail.setUser(newUserData);
|
||||
newUserMusicDetailList.add(newUserMusicDetail);
|
||||
}
|
||||
userMusicDetailRepository.saveAll(newUserMusicDetailList);
|
||||
}
|
||||
|
||||
// UserFavoriteList
|
||||
if (userAll.getUserFavoriteList() != null) {
|
||||
List<UserFavorite> userFavoriteList = userAll.getUserFavoriteList();
|
||||
List<UserFavorite> newUserFavoriteList = new ArrayList<>();
|
||||
for (UserFavorite newUserFavorite : userFavoriteList) {
|
||||
int itemKind = newUserFavorite.getItemKind();
|
||||
|
||||
Optional<UserFavorite> favoriteOptional = userFavoriteRepository.findByUserAndItemKind(newUserData, itemKind);
|
||||
UserFavorite userFavorite = favoriteOptional.orElseGet(() -> new UserFavorite());
|
||||
|
||||
newUserFavorite.setId(userFavorite.getId());
|
||||
newUserFavorite.setUser(newUserData);
|
||||
newUserFavoriteList.add(newUserFavorite);
|
||||
}
|
||||
userFavoriteRepository.saveAll(newUserFavoriteList);
|
||||
}
|
||||
|
||||
// UserActivityList
|
||||
if (userAll.getUserActivityList() != null) {
|
||||
UserActivity userActivity = userAll.getUserActivityList().get(0);
|
||||
List<UserAct> newUserActList = new ArrayList<>();
|
||||
|
||||
List<List<UserAct>> activityList = new ArrayList<>();
|
||||
activityList.add(userActivity.getMusicList());
|
||||
activityList.add(userActivity.getPlayList());
|
||||
|
||||
for (List<UserAct> actList : activityList) {
|
||||
for (UserAct newUserAct : actList) {
|
||||
int kind = newUserAct.getKind();
|
||||
int id = newUserAct.getActivityId();
|
||||
|
||||
if (kind != 0 && id != 0) {
|
||||
Optional<UserAct> activityOptional = userActRepository.findByUserAndKindAndActivityId(newUserData, kind, id);
|
||||
UserAct userAct = activityOptional.orElseGet(() -> new UserAct(newUserData));
|
||||
|
||||
newUserAct.setId(userAct.getId());
|
||||
newUserAct.setUser(newUserData);
|
||||
newUserActList.add(newUserAct);
|
||||
}
|
||||
}
|
||||
}
|
||||
newUserActList.sort((a, b) -> Long.compare(b.getSortNumber(), a.getSortNumber()));
|
||||
userActRepository.saveAll(newUserActList);
|
||||
}
|
||||
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimai2servlet.api.UpsertUserAllApi\"}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
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.maimai2.model.response.UserLoginResp;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class UserLoginHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserLoginHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public UserLoginHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
//String userId = Integer.toString((int)request.get("userId"));
|
||||
|
||||
UserLoginResp resp = new UserLoginResp();
|
||||
|
||||
String json = mapper.write(resp);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.response.CodeResp;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component
|
||||
public class UserLogoutHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserLogoutHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public UserLogoutHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
|
||||
String json = mapper.write(new CodeResp(1));
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.request.data.UserAll;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UpsertUserAll implements Serializable {
|
||||
public long userId;
|
||||
public long playlogId;
|
||||
@JsonProperty("isEventMode")
|
||||
public boolean isEventMode;
|
||||
@JsonProperty("isFreePlay")
|
||||
public boolean isFreePlay;
|
||||
public UserAll upsertUserAll;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.request.data;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserActivity;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.UserRating;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserAll implements Serializable {
|
||||
public List<UserDetail> userData;
|
||||
public List<UserExtend> userExtend;
|
||||
public List<UserOption> userOption;
|
||||
public List<UserCharacter> userCharacterList;
|
||||
public List<UserGhost> userGhost;
|
||||
public List<UserMap> userMapList;
|
||||
public List<UserLoginBonus> userLoginBonusList;
|
||||
public List<UserRating> userRatingList;
|
||||
public List<UserItem> userItemList;
|
||||
public List<UserMusicDetail> userMusicDetailList;
|
||||
public List<UserFavorite> userFavoriteList;
|
||||
public List<UserActivity> userActivityList;
|
||||
public String isNewCharacterList;
|
||||
public String isNewMapList;
|
||||
public String isNewLoginBonusList;
|
||||
public String isNewItemList;
|
||||
public String isNewMusicDetailList;
|
||||
public String isNewFavoriteList;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.response.data.GameSetting;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GetGameSettingResp {
|
||||
|
||||
@JsonProperty("isAouAccession")
|
||||
private boolean isAouAccession;
|
||||
private GameSetting gameSetting;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GetUserPreviewResp {
|
||||
|
||||
private long userId;
|
||||
private String userName;
|
||||
@JsonProperty("isLogin")
|
||||
private boolean isLogin;
|
||||
private String lastGameId;
|
||||
private String lastDataVersion;
|
||||
private String lastRomVersion;
|
||||
private String lastLoginDate;
|
||||
private String lastPlayDate;
|
||||
private int playerRating;
|
||||
private int nameplateId;
|
||||
private int iconId;
|
||||
private int trophyId;
|
||||
private int partnerId;
|
||||
private int frameId;
|
||||
private int dispRate;
|
||||
private int totalAwake;
|
||||
private int isNetMember;
|
||||
private String dailyBonusDate;
|
||||
private int headPhoneVolume;
|
||||
@JsonProperty("isInherit")
|
||||
private boolean isInherit;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserLoginResp {
|
||||
public int returnCode = 1;
|
||||
public String lastLoginDate = "2020-01-01 00:00:00.0";
|
||||
public int loginCount = 1;
|
||||
public int consecutiveLoginCount = 0;
|
||||
public int loginId = 1; // What is this?
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GameSetting {
|
||||
@JsonProperty("isMaintenance")
|
||||
private boolean isMaintenance;
|
||||
private int requestInterval;
|
||||
private String rebootStartTime;
|
||||
private String rebootEndTime;
|
||||
private int movieUploadLimit;
|
||||
private int movieStatus;
|
||||
private String movieServerUri;
|
||||
private String deliverServerUri;
|
||||
private String oldServerUri;
|
||||
private String usbDlServerUri;
|
||||
private int rebootInterval;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserAct;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserActivity {
|
||||
private List<UserAct> playList;
|
||||
private List<UserAct> musicList;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserMusicDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserMusic {
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.response.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserRate;
|
||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.UserUdemae;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserRating {
|
||||
private int rating;
|
||||
private List<UserRate> ratingList;
|
||||
private List<UserRate> newRatingList;
|
||||
private List<UserRate> nextRatingList;
|
||||
private List<UserRate> nextNewRatingList;
|
||||
private UserUdemae udemae;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2MapEncountNpc")
|
||||
@Table(name = "maimai2_user_npc_encount")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MapEncountNpc implements Serializable{
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
private int npcId;
|
||||
private int musicId;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "extend_id")
|
||||
private UserExtend userExtend;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserActivity")
|
||||
@Table(name = "maimai2_user_activity")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonPropertyOrder({"kind", "id", "sortNumber", "param1", "param2", "param3", "param4"})
|
||||
public class UserAct implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int kind;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int activityId;
|
||||
|
||||
private long sortNumber;
|
||||
private int param1;
|
||||
private int param2;
|
||||
private int param3;
|
||||
private int param4;
|
||||
|
||||
public UserAct(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserCharacter")
|
||||
@Table(name = "maimai2_user_character")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserCharacter implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int characterId;
|
||||
private int level;
|
||||
private int awakening;
|
||||
private int useCount;
|
||||
|
||||
public UserCharacter(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
import icu.samnyan.aqua.sega.util.jackson.AccessCodeSerializer;
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.maimai2.util.IntegerListConverter;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserData")
|
||||
@Table(name = "maimai2_user_detail")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserDetail implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonSerialize(using = AccessCodeSerializer.class)
|
||||
@JsonProperty(value = "accessCode", access = JsonProperty.Access.READ_ONLY)
|
||||
@OneToOne
|
||||
@JoinColumn(name = "aime_card_id")
|
||||
private Card card;
|
||||
|
||||
private String userName;
|
||||
private int isNetMember;
|
||||
private int iconId;
|
||||
private int plateId;
|
||||
private int titleId;
|
||||
private int partnerId;
|
||||
private int frameId;
|
||||
private int selectMapId;
|
||||
private int totalAwake;
|
||||
private int gradeRating;
|
||||
private int musicRating;
|
||||
private int playerRating;
|
||||
private int highestRating;
|
||||
private int gradeRank;
|
||||
|
||||
@Convert(converter = IntegerListConverter.class)
|
||||
private List<Integer> charaSlot; // Entries: 5
|
||||
|
||||
@Convert(converter = IntegerListConverter.class)
|
||||
private List<Integer> charaLockSlot; // Entries: 5
|
||||
|
||||
private long contentBit;
|
||||
private int playCount;
|
||||
private String eventWatchedDate;
|
||||
private String lastGameId;
|
||||
private String lastRomVersion;
|
||||
private String lastDataVersion;
|
||||
private String lastLoginDate;
|
||||
private String lastPlayDate;
|
||||
private int lastPlaceId;
|
||||
private String lastPlaceName;
|
||||
private int lastAllNetId;
|
||||
private int lastRegionId;
|
||||
private String lastRegionName;
|
||||
private String lastClientId;
|
||||
private String lastCountryCode;
|
||||
private String firstGameId;
|
||||
private String firstRomVersion;
|
||||
private String firstDataVersion;
|
||||
private String firstPlayDate;
|
||||
private String compatibleCmVersion;
|
||||
private String dailyBonusDate;
|
||||
private int playVsCount;
|
||||
private int playSyncCount;
|
||||
private int winCount;
|
||||
private int helpCount;
|
||||
private int comboCount;
|
||||
private long totalDeluxscore;
|
||||
private long totalBasicDeluxscore;
|
||||
private long totalAdvancedDeluxscore;
|
||||
private long totalExpertDeluxscore;
|
||||
private long totalMasterDeluxscore;
|
||||
private long totalReMasterDeluxscore;
|
||||
private int totalSync;
|
||||
private int totalBasicSync;
|
||||
private int totalAdvancedSync;
|
||||
private int totalExpertSync;
|
||||
private int totalMasterSync;
|
||||
private int totalReMasterSync;
|
||||
private long totalAchievement;
|
||||
private long totalBasicAchievement;
|
||||
private long totalAdvancedAchievement;
|
||||
private long totalExpertAchievement;
|
||||
private long totalMasterAchievement;
|
||||
private long totalReMasterAchievement;
|
||||
private long dateTime;
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.util.IntegerListConverter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserExtend")
|
||||
@Table(name = "maimai2_user_extend")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonPropertyOrder({"selectMusicId", "selectDifficultyId", "categoryIndex", "musicIndex",
|
||||
"extraFlag", "selectScoreType", "extendContentBit", "isPhotoAgree", "isGotoCodeRead",
|
||||
"selectResultDetails", "sortCategorySetting", "sortMusicSetting", "selectedCardList", "encountMapNpcList"})
|
||||
public class UserExtend implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int selectMusicId;
|
||||
private int selectDifficultyId;
|
||||
private int categoryIndex;
|
||||
private int musicIndex;
|
||||
private int extraFlag;
|
||||
private int selectScoreType;
|
||||
private long extendContentBit;
|
||||
@JsonProperty("isPhotoAgree")
|
||||
private boolean isPhotoAgree;
|
||||
@JsonProperty("isGotoCodeRead")
|
||||
private boolean isGotoCodeRead;
|
||||
private boolean selectResultDetails;
|
||||
private int sortCategorySetting; //enum SortTabID
|
||||
private int sortMusicSetting; //enum SortMusicID
|
||||
|
||||
@Convert(converter = IntegerListConverter.class)
|
||||
private List<Integer> selectedCardList;
|
||||
|
||||
@OneToMany(mappedBy = "userExtend")
|
||||
private List<MapEncountNpc> encountMapNpcList = new ArrayList<>();
|
||||
|
||||
public UserExtend(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai2.util.IntegerListConverter;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserFavorite")
|
||||
@Table(name = "maimai2_user_favorite")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserFavorite implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
@JsonProperty("id")
|
||||
private long favUserId;
|
||||
private int itemKind;
|
||||
|
||||
@Convert(converter = IntegerListConverter.class)
|
||||
private List<Integer> itemIdList;
|
||||
|
||||
public UserFavorite(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserGhost {
|
||||
private String name;
|
||||
private int iconId;
|
||||
private int plateId;
|
||||
private int titleId;
|
||||
private int rate;
|
||||
private int udemaeRate;
|
||||
private String playDatetime;
|
||||
private int shopId;
|
||||
private int regionCode;
|
||||
private int typeId;
|
||||
private int musicId;
|
||||
private int difficulty;
|
||||
private int version;
|
||||
private List<Byte> resultBitList;
|
||||
private int resultNum;
|
||||
private int achievement;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserItem")
|
||||
@Table(name = "maimai2_user_item")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserItem implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int itemKind;
|
||||
private int itemId;
|
||||
private int stock;
|
||||
private boolean isValid;
|
||||
|
||||
public UserItem(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserLoginBonus")
|
||||
@Table(name = "maimai2_user_login_bonus")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonPropertyOrder({"bonusId", "point", "isCurrent", "isComplete"})
|
||||
public class UserLoginBonus implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int bonusId;
|
||||
private int point;
|
||||
@JsonProperty("isCurrent")
|
||||
private boolean isCurrent;
|
||||
@JsonProperty("isComplete")
|
||||
private boolean isComplete;
|
||||
|
||||
public UserLoginBonus(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserMap")
|
||||
@Table(name = "maimai2_user_map")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonPropertyOrder({"mapId", "distance", "isLock", "isClear", "isComplete"})
|
||||
public class UserMap implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int mapId;
|
||||
private int distance;
|
||||
@JsonProperty("isLock")
|
||||
private boolean isLock;
|
||||
@JsonProperty("isClear")
|
||||
private boolean isClear;
|
||||
@JsonProperty("isComplete")
|
||||
private boolean isComplete;
|
||||
|
||||
public UserMap(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaiMai2UserMusicDetail")
|
||||
@Table(name = "maimai2_user_music_detail")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserMusicDetail implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int musicId;
|
||||
private int level;
|
||||
private int playCount;
|
||||
private int achievement;
|
||||
private int comboStatus;
|
||||
private int syncStatus;
|
||||
private int deluxscoreMax;
|
||||
private int scoreRank;
|
||||
|
||||
public UserMusicDetail(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserOption")
|
||||
@Table(name = "maimai2_user_option")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserOption implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int optionKind;
|
||||
private int noteSpeed;
|
||||
private int slideSpeed;
|
||||
private int touchSpeed;
|
||||
private int tapDesign;
|
||||
private int holdDesign;
|
||||
private int slideDesign;
|
||||
private int starType;
|
||||
private int outlineDesign;
|
||||
private int noteSize;
|
||||
private int slideSize;
|
||||
private int touchSize;
|
||||
private int starRotate;
|
||||
private int dispCenter;
|
||||
private int dispChain;
|
||||
private int dispRate;
|
||||
private int dispBar;
|
||||
private int touchEffect;
|
||||
private int submonitorAnimation;
|
||||
private int submonitorAchive;
|
||||
private int submonitorAppeal;
|
||||
private int matching;
|
||||
private int trackSkip;
|
||||
private int brightness;
|
||||
private int mirrorMode;
|
||||
private int dispJudge;
|
||||
private int dispJudgePos;
|
||||
private int dispJudgeTouchPos;
|
||||
private int adjustTiming;
|
||||
private int ansVolume;
|
||||
private int tapHoldVolume;
|
||||
private int criticalSe;
|
||||
private int breakSe;
|
||||
private int breakVolume;
|
||||
private int exSe;
|
||||
private int exVolume;
|
||||
private int slideSe;
|
||||
private int slideVolume;
|
||||
private int touchHoldVolume;
|
||||
private int damageSeVolume;
|
||||
private int headPhoneVolume;
|
||||
private int sortTab;
|
||||
private int sortMusic;
|
||||
|
||||
public UserOption(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserRate")
|
||||
@Table(name = "maimai2_user_rate")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserRate implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int musicId;
|
||||
private int level;
|
||||
private int romVersion;
|
||||
private int achievement;
|
||||
|
||||
public UserRate(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.userdata;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "Maimai2UserUdemae")
|
||||
@Table(name = "maimai2_user_udemae")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserUdemae implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserDetail user;
|
||||
|
||||
private int rate;
|
||||
private int maxRate;
|
||||
private int totalWinNum;
|
||||
private int totalLoseNum;
|
||||
private int maxWinNum;
|
||||
private int maxLoseNum;
|
||||
private int winNum;
|
||||
private int loseNum;
|
||||
private int npcTotalWinNum;
|
||||
private int npcTotalLoseNum;
|
||||
private int npcMaxWinNum;
|
||||
private int npcMaxLoseNum;
|
||||
private int npcWinNum;
|
||||
private int npcLoseNum;
|
||||
|
||||
public UserUdemae(UserDetail user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Converter
|
||||
public class IntegerListConverter implements AttributeConverter<List<Integer>, String> {
|
||||
private static final String SPLIT_CHAR = ";";
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(List<Integer> integerList) {
|
||||
if (integerList != null && !integerList.isEmpty()) {
|
||||
StringBuilder str = new StringBuilder();
|
||||
Iterator<Integer> iter = integerList.iterator();
|
||||
while(iter.hasNext()) {
|
||||
str.append(iter.next());
|
||||
if(iter.hasNext()){
|
||||
str.append(SPLIT_CHAR);
|
||||
}
|
||||
}
|
||||
return str.toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> convertToEntityAttribute(String string) {
|
||||
if (string != null && !string.isEmpty()) {
|
||||
List<Integer> iList = new ArrayList<Integer>();
|
||||
for (String s : string.split(SPLIT_CHAR)) {
|
||||
iList.add(Integer.parseInt(s));
|
||||
}
|
||||
return iList;
|
||||
} else {
|
||||
return emptyList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,279 @@
|
|||
CREATE TABLE maimai2_user_detail (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
aime_card_id BIGINT,
|
||||
user_name VARCHAR (255),
|
||||
is_net_member INTEGER,
|
||||
icon_id INTEGER,
|
||||
plate_id INTEGER,
|
||||
title_id INTEGER,
|
||||
partner_id INTEGER,
|
||||
frame_id INTEGER,
|
||||
select_map_id INTEGER,
|
||||
total_awake INTEGER,
|
||||
grade_rating INTEGER,
|
||||
music_rating INTEGER,
|
||||
player_rating INTEGER,
|
||||
highest_rating INTEGER,
|
||||
grade_rank INTEGER,
|
||||
chara_slot VARCHAR (255),
|
||||
chara_lock_slot VARCHAR (255),
|
||||
content_bit BIGINT,
|
||||
play_count INTEGER,
|
||||
event_watched_date VARCHAR (255),
|
||||
last_game_id VARCHAR (255),
|
||||
last_rom_version VARCHAR (255),
|
||||
last_data_version VARCHAR (255),
|
||||
last_login_date VARCHAR (255),
|
||||
last_play_date VARCHAR (255),
|
||||
last_place_id INTEGER,
|
||||
last_place_name VARCHAR (255),
|
||||
last_all_net_id INTEGER,
|
||||
last_region_id INTEGER,
|
||||
last_region_name VARCHAR (255),
|
||||
last_client_id VARCHAR (255),
|
||||
last_country_code VARCHAR (255),
|
||||
first_game_id VARCHAR (255),
|
||||
first_rom_version VARCHAR (255),
|
||||
first_data_version VARCHAR (255),
|
||||
first_play_date VARCHAR (255),
|
||||
compatible_cm_version VARCHAR (255),
|
||||
daily_bonus_date VARCHAR (255),
|
||||
play_vs_count INTEGER,
|
||||
play_sync_count INTEGER,
|
||||
win_count INTEGER,
|
||||
help_count INTEGER,
|
||||
combo_count INTEGER,
|
||||
total_deluxscore BIGINT,
|
||||
total_basic_deluxscore BIGINT,
|
||||
total_advanced_deluxscore BIGINT,
|
||||
total_expert_deluxscore BIGINT,
|
||||
total_master_deluxscore BIGINT,
|
||||
total_re_master_deluxscore BIGINT,
|
||||
total_sync INTEGER,
|
||||
total_basic_sync INTEGER,
|
||||
total_advanced_sync INTEGER,
|
||||
total_expert_sync INTEGER,
|
||||
total_master_sync INTEGER,
|
||||
total_re_master_sync INTEGER,
|
||||
total_achievement BIGINT,
|
||||
total_basic_achievement BIGINT,
|
||||
total_advanced_achievement BIGINT,
|
||||
total_expert_achievement BIGINT,
|
||||
total_master_achievement BIGINT,
|
||||
total_re_master_achievement BIGINT,
|
||||
date_time BIGINT,
|
||||
constraint FKbv9jxq8qw3vvgvio
|
||||
foreign key (aime_card_id) references sega_card (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_activity (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
kind INTEGER,
|
||||
activity_id INTEGER,
|
||||
sort_number BIGINT,
|
||||
param1 INTEGER,
|
||||
param2 INTEGER,
|
||||
param3 INTEGER,
|
||||
param4 INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FKzosmkjggsr4kbwp8
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_character (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
character_id INTEGER,
|
||||
level INTEGER,
|
||||
awakening INTEGER,
|
||||
use_count INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FK7pwqw2iax9tkqsio
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_extend (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
select_music_id INTEGER,
|
||||
select_difficulty_id INTEGER,
|
||||
category_index INTEGER,
|
||||
music_index INTEGER,
|
||||
extra_flag INTEGER,
|
||||
select_score_type INTEGER,
|
||||
extend_content_bit BIGINT,
|
||||
is_photo_agree BOOLEAN,
|
||||
is_goto_code_read BOOLEAN,
|
||||
select_result_details BOOLEAN,
|
||||
sort_category_setting INTEGER,
|
||||
sort_music_setting INTEGER,
|
||||
selected_card_list VARCHAR (255),
|
||||
user_id BIGINT,
|
||||
constraint FKkohdzk55oj46xyeq
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_favorite (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
fav_user_id BIGINT,
|
||||
item_kind INTEGER,
|
||||
item_id_list VARCHAR (255),
|
||||
user_id BIGINT,
|
||||
constraint FKhedsx72h28k53obe
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_item (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
item_kind INTEGER,
|
||||
item_id INTEGER,
|
||||
stock INTEGER,
|
||||
is_valid BOOLEAN,
|
||||
user_id BIGINT,
|
||||
constraint FKopxaz95c966q7pys
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_login_bonus (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
bonus_id INTEGER,
|
||||
point INTEGER,
|
||||
is_current BOOLEAN,
|
||||
is_complete BOOLEAN,
|
||||
user_id BIGINT,
|
||||
constraint FKmwccayih2sv2smw7
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_map (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
map_id INTEGER,
|
||||
distance INTEGER,
|
||||
is_lock BOOLEAN,
|
||||
is_clear BOOLEAN,
|
||||
is_complete BOOLEAN,
|
||||
user_id BIGINT,
|
||||
constraint FKjva7jtg96nwt9539
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_music_detail (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
music_id INTEGER,
|
||||
level INTEGER,
|
||||
play_count INTEGER,
|
||||
achievement INTEGER,
|
||||
combo_status INTEGER,
|
||||
sync_status INTEGER,
|
||||
deluxscore_max INTEGER,
|
||||
score_rank INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FK8hsx2tb67q8nqxgk
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_npc_encount (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
npc_id INTEGER,
|
||||
music_id INTEGER,
|
||||
extend_id BIGINT,
|
||||
user_id BIGINT,
|
||||
constraint FKi6sfpfh45h98qjnh
|
||||
foreign key (user_id) references maimai2_user_detail (id),
|
||||
constraint FKmfy3j84f6k2ymgxb
|
||||
foreign key (extend_id) references maimai2_user_extend (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_option (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
option_kind INTEGER,
|
||||
note_speed INTEGER,
|
||||
slide_speed INTEGER,
|
||||
touch_speed INTEGER,
|
||||
tap_design INTEGER,
|
||||
hold_design INTEGER,
|
||||
slide_design INTEGER,
|
||||
star_type INTEGER,
|
||||
outline_design INTEGER,
|
||||
note_size INTEGER,
|
||||
slide_size INTEGER,
|
||||
touch_size INTEGER,
|
||||
star_rotate INTEGER,
|
||||
disp_center INTEGER,
|
||||
disp_chain INTEGER,
|
||||
disp_rate INTEGER,
|
||||
disp_bar INTEGER,
|
||||
touch_effect INTEGER,
|
||||
submonitor_animation INTEGER,
|
||||
submonitor_achive INTEGER,
|
||||
submonitor_appeal INTEGER,
|
||||
matching INTEGER,
|
||||
track_skip INTEGER,
|
||||
brightness INTEGER,
|
||||
mirror_mode INTEGER,
|
||||
disp_judge INTEGER,
|
||||
disp_judge_pos INTEGER,
|
||||
disp_judge_touch_pos INTEGER,
|
||||
adjust_timing INTEGER,
|
||||
ans_volume INTEGER,
|
||||
tap_hold_volume INTEGER,
|
||||
critical_se INTEGER,
|
||||
break_se INTEGER,
|
||||
break_volume INTEGER,
|
||||
ex_se INTEGER,
|
||||
ex_volume INTEGER,
|
||||
slide_se INTEGER,
|
||||
slide_volume INTEGER,
|
||||
touch_hold_volume INTEGER,
|
||||
damage_se_volume INTEGER,
|
||||
head_phone_volume INTEGER,
|
||||
sort_tab INTEGER,
|
||||
sort_music INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FKp3r3s8f6mwfvoyzf
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_rate (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
music_id INTEGER,
|
||||
level INTEGER,
|
||||
rom_version INTEGER,
|
||||
achievement INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FKfaewgvanchzwo8um
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_udemae (
|
||||
id BIGINT auto_increment PRIMARY KEY,
|
||||
rate INTEGER,
|
||||
max_rate INTEGER,
|
||||
total_win_num INTEGER,
|
||||
total_lose_num INTEGER,
|
||||
max_win_num INTEGER,
|
||||
max_lose_num INTEGER,
|
||||
win_num INTEGER,
|
||||
lose_num INTEGER,
|
||||
npc_total_win_num INTEGER,
|
||||
npc_total_lose_num INTEGER,
|
||||
npc_max_win_num INTEGER,
|
||||
npc_max_lose_num INTEGER,
|
||||
npc_win_num INTEGER,
|
||||
npc_lose_num INTEGER,
|
||||
user_id BIGINT,
|
||||
constraint FK9g2niydg6r5796gg
|
||||
foreign key (user_id) references maimai2_user_detail (id)
|
||||
);
|
||||
|
|
@ -0,0 +1,277 @@
|
|||
CREATE TABLE maimai2_user_detail (
|
||||
id INTEGER,
|
||||
aime_card_id BIGINT REFERENCES sega_card (id) ON DELETE CASCADE,
|
||||
user_name VARCHAR (255),
|
||||
is_net_member INTEGER,
|
||||
icon_id INTEGER,
|
||||
plate_id INTEGER,
|
||||
title_id INTEGER,
|
||||
partner_id INTEGER,
|
||||
frame_id INTEGER,
|
||||
select_map_id INTEGER,
|
||||
total_awake INTEGER,
|
||||
grade_rating INTEGER,
|
||||
music_rating INTEGER,
|
||||
player_rating INTEGER,
|
||||
highest_rating INTEGER,
|
||||
grade_rank INTEGER,
|
||||
chara_slot VARCHAR (255),
|
||||
chara_lock_slot VARCHAR (255),
|
||||
content_bit BIGINT,
|
||||
play_count INTEGER,
|
||||
event_watched_date VARCHAR (255),
|
||||
last_game_id VARCHAR (255),
|
||||
last_rom_version VARCHAR (255),
|
||||
last_data_version VARCHAR (255),
|
||||
last_login_date VARCHAR (255),
|
||||
last_play_date VARCHAR (255),
|
||||
last_place_id INTEGER,
|
||||
last_place_name VARCHAR (255),
|
||||
last_all_net_id INTEGER,
|
||||
last_region_id INTEGER,
|
||||
last_region_name VARCHAR (255),
|
||||
last_client_id VARCHAR (255),
|
||||
last_country_code VARCHAR (255),
|
||||
first_game_id VARCHAR (255),
|
||||
first_rom_version VARCHAR (255),
|
||||
first_data_version VARCHAR (255),
|
||||
first_play_date VARCHAR (255),
|
||||
compatible_cm_version VARCHAR (255),
|
||||
daily_bonus_date VARCHAR (255),
|
||||
play_vs_count INTEGER,
|
||||
play_sync_count INTEGER,
|
||||
win_count INTEGER,
|
||||
help_count INTEGER,
|
||||
combo_count INTEGER,
|
||||
total_deluxscore BIGINT,
|
||||
total_basic_deluxscore BIGINT,
|
||||
total_advanced_deluxscore BIGINT,
|
||||
total_expert_deluxscore BIGINT,
|
||||
total_master_deluxscore BIGINT,
|
||||
total_re_master_deluxscore BIGINT,
|
||||
total_sync INTEGER,
|
||||
total_basic_sync INTEGER,
|
||||
total_advanced_sync INTEGER,
|
||||
total_expert_sync INTEGER,
|
||||
total_master_sync INTEGER,
|
||||
total_re_master_sync INTEGER,
|
||||
total_achievement BIGINT,
|
||||
total_basic_achievement BIGINT,
|
||||
total_advanced_achievement BIGINT,
|
||||
total_expert_achievement BIGINT,
|
||||
total_master_achievement BIGINT,
|
||||
total_re_master_achievement BIGINT,
|
||||
date_time BIGINT,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_activity (
|
||||
id INTEGER,
|
||||
kind INTEGER,
|
||||
activity_id INTEGER,
|
||||
sort_number BIGINT,
|
||||
param1 INTEGER,
|
||||
param2 INTEGER,
|
||||
param3 INTEGER,
|
||||
param4 INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_character (
|
||||
id INTEGER,
|
||||
character_id INTEGER,
|
||||
level INTEGER,
|
||||
awakening INTEGER,
|
||||
use_count INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_extend (
|
||||
id INTEGER,
|
||||
select_music_id INTEGER,
|
||||
select_difficulty_id INTEGER,
|
||||
category_index INTEGER,
|
||||
music_index INTEGER,
|
||||
extra_flag INTEGER,
|
||||
select_score_type INTEGER,
|
||||
extend_content_bit BIGINT,
|
||||
is_photo_agree BOOLEAN,
|
||||
is_goto_code_read BOOLEAN,
|
||||
select_result_details BOOLEAN,
|
||||
sort_category_setting INTEGER,
|
||||
sort_music_setting INTEGER,
|
||||
selected_card_list VARCHAR (255),
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id),
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_favorite (
|
||||
id INTEGER,
|
||||
fav_user_id BIGINT,
|
||||
item_kind INTEGER,
|
||||
item_id_list VARCHAR (255),
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_item (
|
||||
id INTEGER,
|
||||
item_kind INTEGER,
|
||||
item_id INTEGER,
|
||||
stock INTEGER,
|
||||
is_valid BOOLEAN,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_login_bonus (
|
||||
id INTEGER,
|
||||
bonus_id INTEGER,
|
||||
point INTEGER,
|
||||
is_current BOOLEAN,
|
||||
is_complete BOOLEAN,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_map (
|
||||
id INTEGER,
|
||||
map_id INTEGER,
|
||||
distance INTEGER,
|
||||
is_lock BOOLEAN,
|
||||
is_clear BOOLEAN,
|
||||
is_complete BOOLEAN,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_music_detail (
|
||||
id INTEGER,
|
||||
music_id INTEGER,
|
||||
level INTEGER,
|
||||
play_count INTEGER,
|
||||
achievement INTEGER,
|
||||
combo_status INTEGER,
|
||||
sync_status INTEGER,
|
||||
deluxscore_max INTEGER,
|
||||
score_rank INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_npc_encount (
|
||||
id INTEGER,
|
||||
npc_id INTEGER,
|
||||
music_id INTEGER,
|
||||
extend_id BIGINT REFERENCES maimai2_user_extend (id) ON DELETE CASCADE,
|
||||
user_id BIGINT REFERENCES maimai2_user_data (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_option (
|
||||
id INTEGER,
|
||||
option_kind INTEGER,
|
||||
note_speed INTEGER,
|
||||
slide_speed INTEGER,
|
||||
touch_speed INTEGER,
|
||||
tap_design INTEGER,
|
||||
hold_design INTEGER,
|
||||
slide_design INTEGER,
|
||||
star_type INTEGER,
|
||||
outline_design INTEGER,
|
||||
note_size INTEGER,
|
||||
slide_size INTEGER,
|
||||
touch_size INTEGER,
|
||||
star_rotate INTEGER,
|
||||
disp_center INTEGER,
|
||||
disp_chain INTEGER,
|
||||
disp_rate INTEGER,
|
||||
disp_bar INTEGER,
|
||||
touch_effect INTEGER,
|
||||
submonitor_animation INTEGER,
|
||||
submonitor_achive INTEGER,
|
||||
submonitor_appeal INTEGER,
|
||||
matching INTEGER,
|
||||
track_skip INTEGER,
|
||||
brightness INTEGER,
|
||||
mirror_mode INTEGER,
|
||||
disp_judge INTEGER,
|
||||
disp_judge_pos INTEGER,
|
||||
disp_judge_touch_pos INTEGER,
|
||||
adjust_timing INTEGER,
|
||||
ans_volume INTEGER,
|
||||
tap_hold_volume INTEGER,
|
||||
critical_se INTEGER,
|
||||
break_se INTEGER,
|
||||
break_volume INTEGER,
|
||||
ex_se INTEGER,
|
||||
ex_volume INTEGER,
|
||||
slide_se INTEGER,
|
||||
slide_volume INTEGER,
|
||||
touch_hold_volume INTEGER,
|
||||
damage_se_volume INTEGER,
|
||||
head_phone_volume INTEGER,
|
||||
sort_tab INTEGER,
|
||||
sort_music INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE maimai2_user_rate (
|
||||
id INTEGER,
|
||||
music_id INTEGER,
|
||||
level INTEGER,
|
||||
rom_version INTEGER,
|
||||
achievement INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
||||
|
||||
CREATE TABLE maimai2_user_udemae (
|
||||
id INTEGER,
|
||||
rate INTEGER,
|
||||
max_rate INTEGER,
|
||||
total_win_num INTEGER,
|
||||
total_lose_num INTEGER,
|
||||
max_win_num INTEGER,
|
||||
max_lose_num INTEGER,
|
||||
win_num INTEGER,
|
||||
lose_num INTEGER,
|
||||
npc_total_win_num INTEGER,
|
||||
npc_total_lose_num INTEGER,
|
||||
npc_max_win_num INTEGER,
|
||||
npc_max_lose_num INTEGER,
|
||||
npc_win_num INTEGER,
|
||||
npc_lose_num INTEGER,
|
||||
user_id BIGINT REFERENCES maimai2_user_detail (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (
|
||||
id
|
||||
)
|
||||
);
|
Loading…
Reference in New Issue