mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-25 12:02:40 +00:00
[-] Drop maimai finale since literally 0 accounts was created since 2024
This commit is contained in:
parent
34aae0c87a
commit
32d050cb2f
@ -1,179 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.handler.impl.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
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;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/g/mai")
|
||||
@AllArgsConstructor
|
||||
public class MaimaiServletController {
|
||||
|
||||
private final GetGameEventHandler getGameEventHandler;
|
||||
private final GetGameRankingHandler getGameRankingHandler;
|
||||
private final GetGameSettingHandler getGameSettingHandler;
|
||||
private final GetTransferFriendHandler getTransferFriendHandler;
|
||||
private final GetUserActivityHandler getUserActivityHandler;
|
||||
private final GetUserBossHandler getUserBossHandler;
|
||||
private final GetUserCharacterHandler getUserCharacterHandler;
|
||||
private final GetUserCourseHandler getUserCourseHandler;
|
||||
private final GetUserDataHandler getUserDataHandler;
|
||||
private final GetUserGradeHandler getUserGradeHandler;
|
||||
private final GetUserItemHandler getUserItemHandler;
|
||||
private final GetUserMusicHandler getUserMusicHandler;
|
||||
private final GetUserOptionHandler getUserOptionHandler;
|
||||
private final GetUserPresentEventHandler getUserPresentEventHandler;
|
||||
private final GetUserPresentHandler getUserPresentHandler;
|
||||
private final GetUserPreviewHandler getUserPreviewHandler;
|
||||
private final GetUserRecentRatingHandler getUserRecentRatingHandler;
|
||||
private final GetUserSurvivalHandler getUserSurvivalHandler;
|
||||
private final GetUserWebOptionHandler getUserWebOptionHandler;
|
||||
private final UpsertTransferHandler upsertTransferHandler;
|
||||
private final UpsertUserAllHandler upsertUserAllHandler;
|
||||
private final UserLoginHandler userLoginHandler;
|
||||
private final UserLogoutHandler userLogoutHandler;
|
||||
|
||||
@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, HttpServletRequest http) throws JsonProcessingException {
|
||||
request.put("localAddr", http.getLocalAddr());
|
||||
request.put("localPort", Integer.toString(http.getLocalPort()));
|
||||
return getGameSettingHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserActivityApi")
|
||||
public String getUserActivity(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserActivityHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserBossApi")
|
||||
public String getUserBoss(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserBossHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserCharacterApi")
|
||||
public String getUserCharacter(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserCharacterHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserCourseApi")
|
||||
public String getUserCourse(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserCourseHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserDataApi")
|
||||
public String getUserData(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserDataHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetTransferFriendApi")
|
||||
public String getTransferFriend(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getTransferFriendHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserItemApi")
|
||||
public String getUserItem(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserItemHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserMusicApi")
|
||||
public String getUserMusic(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserMusicHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserOptionApi")
|
||||
public String getUserOption(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserOptionHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserPresent")
|
||||
public String getUserPresent(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserPresentHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserPresentEventApi")
|
||||
public String getUserPresentEvent(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserPresentEventHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserPreviewApi")
|
||||
public String getUserPreview(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserPreviewHandler.handle((request));
|
||||
}
|
||||
|
||||
@PostMapping("GetUserGradeApi")
|
||||
public String getUserGrade(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserGradeHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserRecentRatingApi")
|
||||
public String getUserRecentRating(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserRecentRatingHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserSurvivalApi")
|
||||
public String getUserSurvival(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserSurvivalHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserWebOptionApi")
|
||||
public String getUserWebOption(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserWebOptionHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UpsertTransferApi")
|
||||
public String upsertTransfer(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return upsertTransferHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UpsertUserAllApi")
|
||||
public String upsertUserAll(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return upsertUserAllHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UserLoginApi")
|
||||
public String userLogin(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return userLoginHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UserLogoutApi")
|
||||
public String userLogout(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return userLogoutHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientBookkeepingApi")
|
||||
public String upsertClientBookkeeping(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":\"1\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientSettingApi")
|
||||
public String upsertClientSetting(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimaiservlet.api.UpsertClientSettingApi\"}";
|
||||
}
|
||||
|
||||
@PostMapping("UpsertClientTestmodeApi")
|
||||
public String upsertClientTestmode(@ModelAttribute Map<String, Object> request) {
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimaiservlet.api.UpsertClientTestmodeApi\"}";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.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 jakarta.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.maimai")
|
||||
public class MaimaiServletControllerAdvice {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MaimaiServletControllerAdvice.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<>() {
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.gamedata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.gamedata.GameEvent;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiGameEventRepository")
|
||||
public interface GameEventRepository extends JpaRepository<GameEvent, Long> {
|
||||
|
||||
List<GameEvent> findByType(Integer type);
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserActivity;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
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("MaimaiUserActivityRepository")
|
||||
public interface UserActivityRepository extends JpaRepository<UserActivity, Long> {
|
||||
|
||||
Optional<UserActivity> findByUserAndKindAndActivityId(UserData user, int kind, int id);
|
||||
|
||||
List<UserActivity> findByUser_Card_ExtIdAndKind(long userId, int kind);
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserBoss;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserBossRepository")
|
||||
public interface UserBossRepository extends JpaRepository<UserBoss, Long> {
|
||||
|
||||
Optional<UserBoss> findByUser_Card_ExtId(long userId);
|
||||
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
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("MaimaiUserCharacterRepository")
|
||||
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
|
||||
|
||||
List<UserCharacter> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserCharacter> findByUserAndCharacterId(UserData user, int characterId);
|
||||
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserDataRepository")
|
||||
public interface UserDataRepository extends JpaRepository<UserData, Long> {
|
||||
Optional<UserData> findByCard_ExtId(long userId);
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserGeneralData;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserGeneralDataRepository")
|
||||
public interface UserGeneralDataRepository extends JpaRepository<UserGeneralData, Long> {
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(long userId, String key);
|
||||
|
||||
Optional<UserGeneralData> findByUserAndPropertyKey(UserData user, String key);
|
||||
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserItem;
|
||||
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("MaimaiUserItemRepository")
|
||||
public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtIdAndItemKind(long userId, int kind, Pageable page);
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserMusicDetail;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserMusicDetailRepository")
|
||||
public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail, Long> {
|
||||
|
||||
@Query("SELECT musicId FROM MaiMaiUserMusicDetail WHERE user.card.extId = :userId AND musicId >= :offset GROUP BY musicId ORDER BY musicId")
|
||||
List<Integer> findMusicIdsByUser_Card_ExtIdAndOffset(long userId, long offset, Pageable page);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicIdIn(long userId, List<Integer> ids);
|
||||
|
||||
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserData user, int musicId, int level);
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiUserOptionRepository")
|
||||
public interface UserOptionRepository extends JpaRepository<UserOption, Long> {
|
||||
|
||||
Optional<UserOption> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserOption> findByUser(UserData user);
|
||||
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserPlaylog;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserPlaylogRepository")
|
||||
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserPresentEvent;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserPresentEventRepository")
|
||||
public interface UserPresentEventRepository extends JpaRepository<UserPresentEvent, Long> {
|
||||
|
||||
List<UserPresentEvent> findByUser_Card_ExtId(long userId);
|
||||
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserSurvival;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserSurvivalRepository")
|
||||
public interface UserSurvivalRepository extends JpaRepository<UserSurvival, Long> {
|
||||
|
||||
List<UserSurvival> findByUser_Card_ExtId(long userId);
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserWebOption;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("MaimaiUserWebOptionRepository")
|
||||
public interface UserWebOptionRepository extends JpaRepository<UserWebOption, Long> {
|
||||
|
||||
Optional<UserWebOption> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserWebOption> findByUser(UserData user);
|
||||
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.gamedata.GameEventRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.gamedata.GameEvent;
|
||||
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("MaimaiGetGameEventHandler")
|
||||
public class GetGameEventHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameEventHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final GameEventRepository gameEventRepository;
|
||||
|
||||
public GetGameEventHandler(BasicMapper mapper, GameEventRepository gameEventRepository) {
|
||||
this.mapper = mapper;
|
||||
this.gameEventRepository = gameEventRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
int type = ((Number) request.get("type")).intValue();
|
||||
Boolean isAllEvent = (Boolean) request.get("isAllEvent");
|
||||
|
||||
List<GameEvent> gameEventList = gameEventRepository.findByType(type);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("type", type);
|
||||
resultMap.put("length", gameEventList.size());
|
||||
resultMap.put("gameEventList", gameEventList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.dao.PropertyEntryRepository;
|
||||
import icu.samnyan.aqua.sega.general.model.PropertyEntry;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.GameRanking;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetGameRankingHandler")
|
||||
public class GetGameRankingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameRankingHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final PropertyEntryRepository propertyEntryRepository;
|
||||
|
||||
@Autowired
|
||||
public GetGameRankingHandler(BasicMapper mapper, PropertyEntryRepository propertyEntryRepository) {
|
||||
this.mapper = mapper;
|
||||
this.propertyEntryRepository = propertyEntryRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
int type = ((Number) request.get("type")).intValue();
|
||||
|
||||
String dataName = "maimai_game_ranking_";
|
||||
|
||||
Optional<PropertyEntry> ranking = propertyEntryRepository.findByPropertyKey(dataName + type);
|
||||
|
||||
List<GameRanking> gameRankingList = new ArrayList<>();
|
||||
if (ranking.isPresent()) {
|
||||
String rankingList = ranking.get().getPropertyValue();
|
||||
String[] r = rankingList.split(",");
|
||||
for (String i : r) {
|
||||
String[] v = i.split(":");
|
||||
if (v.length == 2) {
|
||||
gameRankingList.add(new GameRanking(Integer.parseInt(v[0]), Integer.parseInt(v[1]), ""));
|
||||
} else if (v.length == 3) {
|
||||
gameRankingList.add(new GameRanking(Integer.parseInt(v[0]), Integer.parseInt(v[1]), v[2]));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.dao.PropertyEntryRepository;
|
||||
import icu.samnyan.aqua.sega.general.model.PropertyEntry;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.GetGameSettingResp;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.GameSetting;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetGameSettingHandler")
|
||||
public class GetGameSettingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetGameSettingHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final PropertyEntryRepository propertyEntryRepository;
|
||||
|
||||
private final String HOST_OVERRIDE;
|
||||
private final String PORT_OVERRIDE;
|
||||
|
||||
@Autowired
|
||||
public GetGameSettingHandler(BasicMapper mapper, PropertyEntryRepository propertyEntryRepository,
|
||||
@Value("${allnet.server.host:}") String HOST,
|
||||
@Value("${allnet.server.port:}") String PORT) {
|
||||
this.mapper = mapper;
|
||||
this.propertyEntryRepository = propertyEntryRepository;
|
||||
this.HOST_OVERRIDE = HOST;
|
||||
this.PORT_OVERRIDE = PORT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
|
||||
PropertyEntry start = propertyEntryRepository.findByPropertyKey("reboot_start_time")
|
||||
.orElseGet(() -> new PropertyEntry("reboot_start_time", "2020-01-01 07:00:00.0"));
|
||||
PropertyEntry end = propertyEntryRepository.findByPropertyKey("reboot_end_time")
|
||||
.orElseGet(() -> new PropertyEntry("reboot_end_time", "2020-01-01 07:59:59.0"));
|
||||
|
||||
String addr = HOST_OVERRIDE.equals("") ? (String) request.get("localAddr") : HOST_OVERRIDE;
|
||||
String port = PORT_OVERRIDE.equals("") ? (String) request.get("localPort") : PORT_OVERRIDE;
|
||||
|
||||
GameSetting gameSetting = new GameSetting(
|
||||
false,
|
||||
1800,
|
||||
start.getPropertyValue(),
|
||||
end.getPropertyValue(),
|
||||
0,
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"http://" + addr + ":" + port + "/",
|
||||
"");
|
||||
|
||||
GetGameSettingResp resp = new GetGameSettingResp(
|
||||
false,
|
||||
gameSetting
|
||||
);
|
||||
|
||||
String json = mapper.write(resp);
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.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("MaimaiGetTransferFriendHandler")
|
||||
public class GetTransferFriendHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetTransferFriendHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetTransferFriendHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Response:
|
||||
* transferFriendList
|
||||
* playUserId
|
||||
* playUserName
|
||||
* playDate
|
||||
* friendPoint
|
||||
* isFavorite
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserActivityRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserActivity;
|
||||
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("MaimaiGetUserActivityHandler")
|
||||
public class GetUserActivityHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserActivityHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserActivityRepository userActivityRepository;
|
||||
|
||||
public GetUserActivityHandler(BasicMapper mapper, UserActivityRepository userActivityRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userActivityRepository = userActivityRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
Integer kind = (Integer) request.get("kind");
|
||||
|
||||
List<UserActivity> userActivityList = userActivityRepository.findByUser_Card_ExtIdAndKind(userId, kind);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", userActivityList.size());
|
||||
resultMap.put("kind", kind);
|
||||
resultMap.put("gameRankingList", userActivityList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserBossRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserBoss;
|
||||
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;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetUserBossHandler")
|
||||
public class GetUserBossHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserBossHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserBossRepository userBossRepository;
|
||||
|
||||
public GetUserBossHandler(BasicMapper mapper, UserBossRepository userBossRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userBossRepository = userBossRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
Optional<UserBoss> userBossOptional = userBossRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
if (userBossOptional.isPresent()) {
|
||||
resultMap.put("userBossData", userBossOptional.get());
|
||||
} else {
|
||||
resultMap.put("userBossData", null);
|
||||
}
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserCharacterRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiGetUserCharacterHandler")
|
||||
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, ?> 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("length", userCharacterList.size());
|
||||
resultMap.put("userCharacterList", userCharacterList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.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.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetUserCourseHandler")
|
||||
public class GetUserCourseHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserCourseHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserCourseHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Response Format:
|
||||
* nextIndex
|
||||
* userCourseList
|
||||
* courseId
|
||||
* rate
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", 0);
|
||||
resultMap.put("userCourseList", null);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserDataRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
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("MaimaiGetUserDataHandler")
|
||||
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, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserData 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;
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserGeneralDataRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserGradeStatus;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserGeneralData;
|
||||
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("MaimaiGetUserGradeHandler")
|
||||
public class GetUserGradeHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserGradeHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserGeneralDataRepository userGeneralDataRepository;
|
||||
|
||||
public GetUserGradeHandler(BasicMapper mapper, UserGeneralDataRepository userGeneralDataRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userGeneralDataRepository = userGeneralDataRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserGeneralData userData = userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(userId, "user_grade_status")
|
||||
.orElseGet(() -> new UserGeneralData(-1, null, "user_grade_status", "1,1,1,1"));
|
||||
|
||||
String[] val = userData.getPropertyValue().split(",");
|
||||
UserGradeStatus userGradeStatus = new UserGradeStatus(
|
||||
Integer.parseInt(val[0]),
|
||||
Integer.parseInt(val[1]),
|
||||
Integer.parseInt(val[2]),
|
||||
Integer.parseInt(val[3])
|
||||
);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userGradeStatus", userGradeStatus);
|
||||
resultMap.put("length", 0);
|
||||
resultMap.put("userGradeList", null);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserItemRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiGetUserItemHandler")
|
||||
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, ?> 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;
|
||||
}
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserMusicDetailRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserMusic;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserMusicDetail;
|
||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetUserMusicHandler")
|
||||
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, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
long nextIndex = ((Number) request.get("nextIndex")).longValue();
|
||||
int maxCount = ((Number) request.get("maxCount")).intValue();
|
||||
|
||||
List<Integer> musicIds = userMusicDetailRepository.findMusicIdsByUser_Card_ExtIdAndOffset(userId, nextIndex, PageRequest.of(0, maxCount));
|
||||
|
||||
List<UserMusicDetail> detailList = userMusicDetailRepository.findByUser_Card_ExtIdAndMusicIdIn(userId, musicIds);
|
||||
|
||||
Map<Integer, UserMusic> userMusicMap = new LinkedHashMap<>();
|
||||
|
||||
detailList.forEach(music -> {
|
||||
UserMusic userMusic;
|
||||
if (userMusicMap.containsKey(music.getMusicId())) {
|
||||
userMusic = userMusicMap.get(music.getMusicId());
|
||||
} else {
|
||||
userMusic = new UserMusic(new LinkedList<>(), 0);
|
||||
userMusicMap.put(music.getMusicId(), userMusic);
|
||||
}
|
||||
userMusic.getUserMusicDetailList().add(music);
|
||||
});
|
||||
|
||||
userMusicMap.forEach((key, val) -> {
|
||||
val.setLength(val.getUserMusicDetailList().size());
|
||||
});
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", musicIds.size());
|
||||
resultMap.put("nextIndex", musicIds.size() != 50 ? 0 : musicIds.get(musicIds.size() - 1) + 1);
|
||||
resultMap.put("userMusicList", userMusicMap.values());
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserOptionRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiGetUserOptionHandler")
|
||||
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, ?> 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;
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserPresentEventRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserPresentEvent;
|
||||
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("MaimaiGetUserPresentEventHandler")
|
||||
public class GetUserPresentEventHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserPresentEventHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserPresentEventRepository userPresentEventRepository;
|
||||
|
||||
public GetUserPresentEventHandler(BasicMapper mapper, UserPresentEventRepository userPresentEventRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userPresentEventRepository = userPresentEventRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<UserPresentEvent> userPresentEventList = userPresentEventRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", userPresentEventList.size());
|
||||
resultMap.put("userPresentEventList", userPresentEventList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.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.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetUserPresentHandler")
|
||||
public class GetUserPresentHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserPresentHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public GetUserPresentHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty
|
||||
*/
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", 0);
|
||||
resultMap.put("userPresentList", List.of());
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserDataRepository;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserWebOptionRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.GetUserPreviewResp;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserWebOption;
|
||||
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("MaimaiGetUserPreviewHandler")
|
||||
public class GetUserPreviewHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserPreviewHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserDataRepository userDataRepository;
|
||||
private final UserWebOptionRepository userWebOptionRepository;
|
||||
|
||||
public GetUserPreviewHandler(BasicMapper mapper, UserDataRepository userDataRepository, UserWebOptionRepository userWebOptionRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userDataRepository = userDataRepository;
|
||||
this.userWebOptionRepository = userWebOptionRepository;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
Optional<UserData> userDataOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
GetUserPreviewResp resp = new GetUserPreviewResp();
|
||||
resp.setUserId(userId);
|
||||
String json;
|
||||
if (userDataOptional.isPresent() && userDataOptional.get().getUserName() != null) {
|
||||
UserData user = userDataOptional.get();
|
||||
Optional<UserWebOption> userWebOptionOptional = userWebOptionRepository.findByUser_Card_ExtId(userId);
|
||||
resp.setUserName(user.getUserName());
|
||||
resp.setLogin(true);
|
||||
resp.setLastDataVersion(user.getLastDataVersion());
|
||||
resp.setLastLoginDate(user.getLastPlayDate());
|
||||
resp.setLastPlayDate(user.getLastPlayDate());
|
||||
resp.setPlayerRating(user.getPlayerRating());
|
||||
resp.setNameplateId(user.getNameplateId());
|
||||
resp.setFrameId(user.getFrameId());
|
||||
resp.setIconId(user.getIconId());
|
||||
resp.setTrophyId(user.getTrophyId());
|
||||
if (userWebOptionOptional.isPresent()) {
|
||||
UserWebOption option = userWebOptionOptional.get();
|
||||
resp.setDispRate(option.getDispRate());
|
||||
resp.setDispRank(option.getDispRank());
|
||||
resp.setDispHomeRanker(option.getDispHomeRanker());
|
||||
resp.setDispTotalLv(option.getDispTotalLv());
|
||||
}
|
||||
resp.setTotalLv(user.getTotalLv());
|
||||
json = mapper.write(resp);
|
||||
} else {
|
||||
json = "{}";
|
||||
}
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserGeneralDataRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserRecentRating;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserGeneralData;
|
||||
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.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("MaimaiGetUserRecentRatingHandler")
|
||||
public class GetUserRecentRatingHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserRecentRatingHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserGeneralDataRepository userGeneralDataRepository;
|
||||
|
||||
public GetUserRecentRatingHandler(BasicMapper mapper, UserGeneralDataRepository userGeneralDataRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userGeneralDataRepository = userGeneralDataRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserGeneralData data = userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(userId, "user_recent_rating")
|
||||
.orElse(new UserGeneralData(-1, null, "user_recent_rating", ""));
|
||||
|
||||
String[] ratings = data.getPropertyValue().split(",");
|
||||
List<UserRecentRating> recentRatingList = new LinkedList<>();
|
||||
for (String rating : ratings) {
|
||||
String[] v = rating.split(":");
|
||||
recentRatingList.add(new UserRecentRating(Integer.parseInt(v[0]), Integer.parseInt(v[1]), Integer.parseInt(v[2])));
|
||||
}
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", recentRatingList.size());
|
||||
resultMap.put("userRecentRatingList", recentRatingList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserSurvivalRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserSurvival;
|
||||
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("MaimaiGetUserSurvivalHandler")
|
||||
public class GetUserSurvivalHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserSurvivalHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserSurvivalRepository userSurvivalRepository;
|
||||
|
||||
public GetUserSurvivalHandler(BasicMapper mapper, UserSurvivalRepository userSurvivalRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userSurvivalRepository = userSurvivalRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
List<UserSurvival> userSurvivalList = userSurvivalRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("length", userSurvivalList.size());
|
||||
resultMap.put("userSurvivalList", userSurvivalList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.maimai.dao.userdata.UserWebOptionRepository;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserWebOption;
|
||||
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("MaimaiGetUserWebOptionHandler")
|
||||
public class GetUserWebOptionHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserWebOptionHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserWebOptionRepository userWebOptionRepository;
|
||||
|
||||
public GetUserWebOptionHandler(BasicMapper mapper, UserWebOptionRepository userWebOptionRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userWebOptionRepository = userWebOptionRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
|
||||
UserWebOption userWebOption = userWebOptionRepository.findByUser_Card_ExtId(userId)
|
||||
.orElse(new UserWebOption(-1, null, true, 1, 1, 1, 1, 1));
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
resultMap.put("userWebOption", userWebOption);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.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("MaimaiUpsertTransferHandler")
|
||||
public class UpsertTransferHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UpsertTransferHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
public UpsertTransferHandler(BasicMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
return "{\"returnCode\":1}";
|
||||
}
|
||||
}
|
||||
@ -1,212 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.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.maimai.dao.userdata.*;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.model.request.UpsertUserAll;
|
||||
import icu.samnyan.aqua.sega.maimai.model.request.data.UserAll;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserGradeStatus;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserRecentRating;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiUpsertUserAllHandler")
|
||||
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 UserOptionRepository userOptionRepository;
|
||||
private final UserWebOptionRepository userWebOptionRepository;
|
||||
private final UserMusicDetailRepository userMusicDetailRepository;
|
||||
private final UserGeneralDataRepository userGeneralDataRepository;
|
||||
private final UserActivityRepository userActivityRepository;
|
||||
private final UserCharacterRepository userCharacterRepository;
|
||||
private final UserPlaylogRepository userPlaylogRepository;
|
||||
|
||||
public UpsertUserAllHandler(BasicMapper mapper, CardService cardService, UserDataRepository userDataRepository, UserOptionRepository userOptionRepository, UserWebOptionRepository userWebOptionRepository, UserMusicDetailRepository userMusicDetailRepository, UserGeneralDataRepository userGeneralDataRepository, UserActivityRepository userActivityRepository, UserCharacterRepository userCharacterRepository, UserPlaylogRepository userPlaylogRepository) {
|
||||
this.mapper = mapper;
|
||||
this.cardService = cardService;
|
||||
this.userDataRepository = userDataRepository;
|
||||
this.userOptionRepository = userOptionRepository;
|
||||
this.userWebOptionRepository = userWebOptionRepository;
|
||||
this.userMusicDetailRepository = userMusicDetailRepository;
|
||||
this.userGeneralDataRepository = userGeneralDataRepository;
|
||||
this.userActivityRepository = userActivityRepository;
|
||||
this.userCharacterRepository = userCharacterRepository;
|
||||
this.userPlaylogRepository = userPlaylogRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
|
||||
UpsertUserAll upsertUserAll = mapper.convert(request, UpsertUserAll.class);
|
||||
long userId = upsertUserAll.getUserId();
|
||||
UserAll userAll = upsertUserAll.getUpsertUserAll();
|
||||
|
||||
// UserData
|
||||
UserData userData;
|
||||
UserData newUserData;
|
||||
if (userAll.getUserData() == null) {
|
||||
return null;
|
||||
} else {
|
||||
newUserData = userAll.getUserData().get(0);
|
||||
Optional<UserData> userOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
if (userOptional.isPresent()) {
|
||||
userData = userOptional.get();
|
||||
} else {
|
||||
userData = new UserData();
|
||||
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()
|
||||
.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
|
||||
|
||||
newUserData.setUserName(userName);
|
||||
userDataRepository.saveAndFlush(newUserData);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// UserWebOption
|
||||
if (userAll.getUserWebOption() != null) {
|
||||
UserWebOption newUserWebOption = userAll.getUserWebOption().get(0);
|
||||
|
||||
Optional<UserWebOption> userWebOptionOptional = userWebOptionRepository.findByUser(newUserData);
|
||||
UserWebOption userWebOption = userWebOptionOptional.orElseGet(() -> new UserWebOption(newUserData));
|
||||
|
||||
newUserWebOption.setId(userWebOption.getId());
|
||||
newUserWebOption.setUser(userWebOption.getUser());
|
||||
|
||||
userWebOptionRepository.save(newUserWebOption);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// UserRecentRatingList
|
||||
if (userAll.getUserRecentRatingList() != null) {
|
||||
List<UserRecentRating> recentRatingList = userAll.getUserRecentRatingList();
|
||||
StringBuilder userRecentRating = new StringBuilder();
|
||||
recentRatingList.forEach(rating -> {
|
||||
userRecentRating.append(rating.getMusicId()).append(":").append(rating.getLevel()).append(":").append(rating.getAchieve()).append(":");
|
||||
userRecentRating.append(",");
|
||||
});
|
||||
if (userRecentRating.length() > 0) {
|
||||
userRecentRating.deleteCharAt(userRecentRating.length() - 1);
|
||||
}
|
||||
UserGeneralData ratingData = userGeneralDataRepository.findByUserAndPropertyKey(newUserData, "user_recent_rating")
|
||||
.orElseGet(() -> new UserGeneralData(newUserData, "user_recent_rating"));
|
||||
ratingData.setPropertyValue(userRecentRating.toString());
|
||||
userGeneralDataRepository.save(ratingData);
|
||||
}
|
||||
|
||||
// UserActivityList
|
||||
if (userAll.getUserActivityList() != null) {
|
||||
List<UserActivity> userActivityList = userAll.getUserActivityList();
|
||||
List<UserActivity> newUserActivityList = new ArrayList<>();
|
||||
|
||||
for (UserActivity newUserActivity : userActivityList) {
|
||||
int kind = newUserActivity.getKind();
|
||||
int id = newUserActivity.getActivityId();
|
||||
|
||||
if (kind != 0 && id != 0) {
|
||||
Optional<UserActivity> activityOptional = userActivityRepository.findByUserAndKindAndActivityId(newUserData, kind, id);
|
||||
UserActivity userActivity = activityOptional.orElseGet(() -> new UserActivity(newUserData));
|
||||
|
||||
newUserActivity.setId(userActivity.getId());
|
||||
newUserActivity.setUser(newUserData);
|
||||
newUserActivityList.add(newUserActivity);
|
||||
}
|
||||
}
|
||||
newUserActivityList.sort((a, b) -> Long.compare(b.getSortNumber(), a.getSortNumber()));
|
||||
userActivityRepository.saveAll(newUserActivityList);
|
||||
}
|
||||
|
||||
// UserGradeStatusList
|
||||
if (userAll.getUserGradeStatusList() != null) {
|
||||
UserGradeStatus userGradeStatus = userAll.getUserGradeStatusList().get(0);
|
||||
UserGeneralData gradeData = userGeneralDataRepository.findByUserAndPropertyKey(newUserData, "user_grade_status")
|
||||
.orElseGet(() -> new UserGeneralData(newUserData, "user_grade_status"));
|
||||
gradeData.setPropertyValue(userGradeStatus.getGradeVersion() + "," + userGradeStatus.getGradeLevel() + "," + userGradeStatus.getGradeSubLevel() + "," + userGradeStatus.getGradeMaxId());
|
||||
userGeneralDataRepository.save(gradeData);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// UserPlaylogList
|
||||
if (userAll.getUserPlaylogList() != null) {
|
||||
List<UserPlaylog> userPlaylogList = userAll.getUserPlaylogList();
|
||||
userPlaylogList.forEach(log -> log.setUser(newUserData));
|
||||
userPlaylogRepository.saveAll(userPlaylogList);
|
||||
}
|
||||
|
||||
return "{\"returnCode\":1,\"apiName\":\"com.sega.maimaiservlet.api.UpsertUserAllApi\"}";
|
||||
}
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.maimai.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("MaimaiUserLoginHandler")
|
||||
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, ?> request) throws JsonProcessingException {
|
||||
String userId = (String) request.get("userId");
|
||||
|
||||
UserLoginResp resp = new UserLoginResp();
|
||||
|
||||
String json = mapper.write(resp);
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.response.CodeResp;
|
||||
import icu.samnyan.aqua.sega.general.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("MaimaiUserLogoutHandler")
|
||||
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, ?> request) throws JsonProcessingException {
|
||||
|
||||
String json = mapper.write(new CodeResp(1));
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.gamedata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiGameEvent")
|
||||
@Table(name = "maimai_game_event")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GameEvent implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public int type;
|
||||
@JsonProperty("id")
|
||||
public int eventId;
|
||||
public String startDate;
|
||||
public String endDate;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import icu.samnyan.aqua.sega.maimai.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 {
|
||||
private long userId;
|
||||
@JsonProperty("isEventMode")
|
||||
private boolean isEventMode;
|
||||
@JsonProperty("isFreePlay")
|
||||
private boolean isFreePlay;
|
||||
private UserAll upsertUserAll;
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.request.data;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserGradeStatus;
|
||||
import icu.samnyan.aqua.sega.maimai.model.response.data.UserRecentRating;
|
||||
import icu.samnyan.aqua.sega.maimai.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 {
|
||||
private List<UserPlaylog> userPlaylogList;
|
||||
private List<UserData> userData;
|
||||
private List<UserOption> userOption;
|
||||
private Integer userId;
|
||||
private List<UserWebOption> userWebOption;
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
private List<UserItem> userItemList;
|
||||
private List<UserRecentRating> userRecentRatingList;
|
||||
private List<UserActivity> userActivityList;
|
||||
private List<UserGradeStatus> userGradeStatusList;
|
||||
private List<UserBoss> userBossList;
|
||||
private List<UserCharacter> userCharacterList;
|
||||
private String isNewCharacterList;
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import icu.samnyan.aqua.sega.maimai.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;
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.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 = 0L;
|
||||
private String userName = "";
|
||||
@JsonProperty("isLogin")
|
||||
private boolean isLogin = false;
|
||||
private int lastDataVersion = 0;
|
||||
private String lastLoginDate = null;
|
||||
private String lastPlayDate = null;
|
||||
private int playerRating = 0;
|
||||
private int nameplateId = 0;
|
||||
private int frameId = 0;
|
||||
private int iconId = 0;
|
||||
private int trophyId = 0;
|
||||
private int dispRate = 1;
|
||||
private int dispRank = 1;
|
||||
private int dispHomeRanker = 1;
|
||||
private int dispTotalLv = 1;
|
||||
private int totalLv = 0;
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.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 = 0;
|
||||
public int consecutiveLoginCount = 0;
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.response.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GameRanking {
|
||||
private Integer id;
|
||||
private Integer point;
|
||||
private String userName;
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.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;
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.response.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserGradeStatus {
|
||||
int gradeVersion;
|
||||
int gradeLevel;
|
||||
int gradeSubLevel;
|
||||
int gradeMaxId;
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.response.data;
|
||||
|
||||
import icu.samnyan.aqua.sega.maimai.model.userdata.UserMusicDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserMusic {
|
||||
List<UserMusicDetail> userMusicDetailList;
|
||||
int length;
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.response.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserRecentRating {
|
||||
int musicId;
|
||||
int level;
|
||||
int achieve;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserActivity")
|
||||
@Table(name = "maimai_user_activity")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserActivity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData 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 UserActivity(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserBoss")
|
||||
@Table(name = "maimai_user_boss")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserBoss implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private long pandoraFlagList0;
|
||||
|
||||
private long pandoraFlagList1;
|
||||
|
||||
private long pandoraFlagList2;
|
||||
|
||||
private long pandoraFlagList3;
|
||||
|
||||
private long pandoraFlagList4;
|
||||
|
||||
private long pandoraFlagList5;
|
||||
|
||||
private long pandoraFlagList6;
|
||||
|
||||
private long emblemFlagList;
|
||||
|
||||
public UserBoss(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserCharacter")
|
||||
@Table(name = "maimai_user_character")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserCharacter implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int characterId;
|
||||
|
||||
private int point;
|
||||
|
||||
private int level;
|
||||
|
||||
public UserCharacter(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,135 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.util.jackson.AccessCodeSerializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserData")
|
||||
@Table(name = "maimai_user_data")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonSerialize(using = AccessCodeSerializer.class)
|
||||
@JsonProperty(value = "accessCode", access = JsonProperty.Access.READ_ONLY)
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "aime_card_id")
|
||||
private Card card;
|
||||
|
||||
private int lastDataVersion;
|
||||
|
||||
private String userName;
|
||||
|
||||
private int point;
|
||||
|
||||
private int totalPoint;
|
||||
|
||||
private int iconId;
|
||||
|
||||
private int nameplateId;
|
||||
|
||||
private int frameId;
|
||||
|
||||
private int trophyId;
|
||||
|
||||
private int playCount;
|
||||
|
||||
private int playVsCount;
|
||||
|
||||
private int playSyncCount;
|
||||
|
||||
private int winCount;
|
||||
|
||||
private int helpCount;
|
||||
|
||||
private int comboCount;
|
||||
|
||||
private int feverCount;
|
||||
|
||||
private int totalHiScore;
|
||||
|
||||
private int totalEasyHighScore;
|
||||
|
||||
private int totalBasicHighScore;
|
||||
|
||||
private int totalAdvancedHighScore;
|
||||
|
||||
private int totalExpertHighScore;
|
||||
|
||||
private int totalMasterHighScore;
|
||||
|
||||
private int totalReMasterHighScore;
|
||||
|
||||
private int totalHighSync;
|
||||
|
||||
private int totalEasySync;
|
||||
|
||||
private int totalBasicSync;
|
||||
|
||||
private int totalAdvancedSync;
|
||||
|
||||
private int totalExpertSync;
|
||||
|
||||
private int totalMasterSync;
|
||||
|
||||
private int totalReMasterSync;
|
||||
|
||||
private int playerRating;
|
||||
|
||||
private int highestRating;
|
||||
|
||||
private int rankAuthTailId;
|
||||
|
||||
private String eventWatchedDate;
|
||||
|
||||
private String webLimitDate;
|
||||
|
||||
private int challengeTrackPhase;
|
||||
|
||||
private int firstPlayBits;
|
||||
|
||||
private String lastPlayDate;
|
||||
|
||||
private int lastPlaceId;
|
||||
|
||||
private String lastPlaceName;
|
||||
|
||||
private int lastRegionId;
|
||||
|
||||
private String lastRegionName;
|
||||
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private String lastClientId;
|
||||
|
||||
private String lastCountryCode;
|
||||
|
||||
private int eventPoint;
|
||||
|
||||
private int totalLv;
|
||||
|
||||
private int lastLoginBonusDay;
|
||||
|
||||
private int lastSurvivalBonusDay;
|
||||
|
||||
private int loginBonusLv;
|
||||
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* For userGradeStatus, userRecentRatingList
|
||||
*
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserGeneralData")
|
||||
@Table(name = "maimai_user_general_data")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserGeneralData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private String propertyKey;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String propertyValue;
|
||||
|
||||
public UserGeneralData(UserData userData, String key) {
|
||||
this.user = userData;
|
||||
this.propertyKey = key;
|
||||
this.propertyValue = "";
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserItem")
|
||||
@Table(name = "maimai_user_item")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int itemKind;
|
||||
|
||||
private int itemId;
|
||||
|
||||
private int stock;
|
||||
|
||||
public UserItem(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaiMaiUserMusicDetail")
|
||||
@Table(name = "maimai_user_music_detail")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserMusicDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int musicId;
|
||||
|
||||
private int level;
|
||||
|
||||
private int playCount;
|
||||
|
||||
private int scoreMax;
|
||||
|
||||
private int syncRateMax;
|
||||
|
||||
private boolean isAllPerfect;
|
||||
|
||||
private int isAllPerfectPlus;
|
||||
|
||||
private int fullCombo;
|
||||
|
||||
private int maxFever;
|
||||
|
||||
private int achievement;
|
||||
|
||||
public UserMusicDetail(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,120 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserOption")
|
||||
@Table(name = "maimai_user_option")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserOption implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int soudEffect;
|
||||
|
||||
private int mirrorMode;
|
||||
|
||||
private int guideSpeed;
|
||||
|
||||
private int bgInfo;
|
||||
|
||||
private int brightness;
|
||||
|
||||
private int isStarRot;
|
||||
|
||||
private int breakSe;
|
||||
|
||||
private int slideSe;
|
||||
|
||||
private int hardJudge;
|
||||
|
||||
private int isTagJump;
|
||||
|
||||
private int breakSeVol;
|
||||
|
||||
private int slideSeVol;
|
||||
|
||||
private int isUpperDisp;
|
||||
|
||||
private int trackSkip;
|
||||
|
||||
private int optionMode;
|
||||
|
||||
private int simpleOptionParam;
|
||||
|
||||
private int adjustTiming;
|
||||
|
||||
private int dispTiming;
|
||||
|
||||
private int timingPos;
|
||||
|
||||
private int ansVol;
|
||||
|
||||
private int noteVol;
|
||||
|
||||
private int dmgVol;
|
||||
|
||||
private int appealFlame;
|
||||
|
||||
private int isFeverDisp;
|
||||
|
||||
private int dispJudge;
|
||||
|
||||
private int judgePos;
|
||||
|
||||
private int ratingGuard;
|
||||
|
||||
private int selectChara;
|
||||
|
||||
private int sortType;
|
||||
|
||||
private int filterGenre;
|
||||
|
||||
private int filterLevel;
|
||||
|
||||
private int filterRank;
|
||||
|
||||
private int filterVersion;
|
||||
|
||||
private int filterRec;
|
||||
|
||||
private int filterFullCombo;
|
||||
|
||||
private int filterAllPerfect;
|
||||
|
||||
private int filterDifficulty;
|
||||
|
||||
private int filterFullSync;
|
||||
|
||||
private int filterReMaster;
|
||||
|
||||
private int filterMaxFever;
|
||||
|
||||
private int finalSelectId;
|
||||
|
||||
private int finalSelectCategory;
|
||||
|
||||
public UserOption(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,157 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserPlaylog")
|
||||
@Table(name = "maimai_user_playlog")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserPlaylog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int orderId;
|
||||
|
||||
private long sortNumber;
|
||||
|
||||
private int placeId;
|
||||
|
||||
private String placeName;
|
||||
|
||||
private String country;
|
||||
|
||||
private int regionId;
|
||||
|
||||
private String playDate;
|
||||
|
||||
private String userPlayDate;
|
||||
|
||||
private int musicId;
|
||||
|
||||
private int level;
|
||||
|
||||
private int gameMode;
|
||||
|
||||
private int rivalNum;
|
||||
|
||||
private int track;
|
||||
|
||||
private int eventId;
|
||||
|
||||
@JsonProperty("isFreeToPlay")
|
||||
private boolean isFreeToPlay;
|
||||
|
||||
private int playerRating;
|
||||
|
||||
private long playedUserId1;
|
||||
|
||||
private String playedUserName1;
|
||||
|
||||
private int playedMusicLevel1;
|
||||
|
||||
private long playedUserId2;
|
||||
|
||||
private String playedUserName2;
|
||||
|
||||
private int playedMusicLevel2;
|
||||
|
||||
private long playedUserId3;
|
||||
|
||||
private String playedUserName3;
|
||||
|
||||
private int playedMusicLevel3;
|
||||
|
||||
private int achievement;
|
||||
|
||||
private int score;
|
||||
|
||||
private int tapScore;
|
||||
|
||||
private int holdScore;
|
||||
|
||||
private int slideScore;
|
||||
|
||||
private int breakScore;
|
||||
|
||||
private int syncRate;
|
||||
|
||||
private int vsWin;
|
||||
|
||||
@JsonProperty("isAllPerfect")
|
||||
private boolean isAllPerfect;
|
||||
|
||||
private int fullCombo;
|
||||
|
||||
private int maxFever;
|
||||
|
||||
private int maxCombo;
|
||||
|
||||
private int tapPerfect;
|
||||
|
||||
private int tapGreat;
|
||||
|
||||
private int tapGood;
|
||||
|
||||
private int tapBad;
|
||||
|
||||
private int holdPerfect;
|
||||
|
||||
private int holdGreat;
|
||||
|
||||
private int holdGood;
|
||||
|
||||
private int holdBad;
|
||||
|
||||
private int slidePerfect;
|
||||
|
||||
private int slideGreat;
|
||||
|
||||
private int slideGood;
|
||||
|
||||
private int slideBad;
|
||||
|
||||
private int breakPerfect;
|
||||
|
||||
private int breakGreat;
|
||||
|
||||
private int breakGood;
|
||||
|
||||
private int breakBad;
|
||||
|
||||
@JsonProperty("isTrackSkip")
|
||||
private boolean isTrackSkip;
|
||||
|
||||
@JsonProperty("isHighScore")
|
||||
private boolean isHighScore;
|
||||
|
||||
@JsonProperty("isChallengeTrack")
|
||||
private boolean isChallengeTrack;
|
||||
|
||||
private int challengeLife;
|
||||
|
||||
private int challengeRemain;
|
||||
|
||||
private int isAllPerfectPlus;
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserPresentEvent")
|
||||
@Table(name = "maimai_user_present_event")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserPresentEvent implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int presentEventId;
|
||||
|
||||
private int point;
|
||||
|
||||
private int presentCount;
|
||||
|
||||
private int rate;
|
||||
|
||||
public UserPresentEvent(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Survival Course
|
||||
*
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserSurvival")
|
||||
@Table(name = "maimai_user_survival")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserSurvival implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
private int survivalId;
|
||||
|
||||
private int totalScore;
|
||||
|
||||
private int totalAchieve;
|
||||
|
||||
@JsonProperty("isClear")
|
||||
private boolean isClear;
|
||||
|
||||
@JsonProperty("isNoDamage")
|
||||
private boolean isNoDamage;
|
||||
|
||||
public UserSurvival(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package icu.samnyan.aqua.sega.maimai.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "MaimaiUserWebOption")
|
||||
@Table(name = "maimai_user_web_option")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserWebOption implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonIgnore
|
||||
private long id;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id")
|
||||
private UserData user;
|
||||
|
||||
@JsonProperty("isNetMember")
|
||||
private boolean isNetMember = true;
|
||||
|
||||
private int dispRate;
|
||||
|
||||
private int dispJudgeStyle;
|
||||
|
||||
private int dispRank;
|
||||
|
||||
private int dispHomeRanker;
|
||||
|
||||
private int dispTotalLv;
|
||||
|
||||
public UserWebOption(UserData user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user