forked from Cookies_Github_mirror/AquaDX
[+] Support for Ongeki Re:Fresh (#133)
* [+] Minimum working support for Ongeki Re:Fresh * [+] Re:Fresh: Add user event map and missing fields * [+] Re:Fresh: Extract user skin
This commit is contained in:
@@ -4,7 +4,6 @@ package icu.samnyan.aqua.sega.ongeki.controller;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.ongeki.handler.impl.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -38,6 +37,7 @@ public class OngekiController {
|
||||
private final GetUserCharacterHandler getUserCharacterHandler;
|
||||
private final GetUserDataHandler getUserDataHandler;
|
||||
private final GetUserDeckByKeyHandler getUserDeckByKeyHandler;
|
||||
private final GetUserEventMapHandler getUserEventMapHandler;
|
||||
private final GetUserEventPointHandler getUserEventPointHandler;
|
||||
private final GetUserEventRankingHandler getUserEventRankingHandler;
|
||||
private final GetUserEventMusicHandler getUserEventMusicHandler;
|
||||
@@ -55,6 +55,7 @@ public class OngekiController {
|
||||
private final GetUserRivalMusicHandler getUserRivalMusicHandler;
|
||||
private final GetUserRivalDataHandler getUserRivalDataHandler;
|
||||
private final GetUserScenarioHandler getUserScenarioHandler;
|
||||
private final GetUserSkinHandler getUserSkinHandler;
|
||||
private final GetUserStoryHandler getUserStoryHandler;
|
||||
private final GetUserTechCountHandler getUserTechCountHandler;
|
||||
private final GetUserTechEventHandler getUserTechEventHandler;
|
||||
@@ -187,6 +188,11 @@ public class OngekiController {
|
||||
return getUserDeckByKeyHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserEventMapApi")
|
||||
public String getUserEventMap(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserEventMapHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserEventPointApi")
|
||||
public String getUserEventPoint(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserEventPointHandler.handle(request);
|
||||
@@ -277,6 +283,11 @@ public class OngekiController {
|
||||
return getUserScenarioHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserSkinApi")
|
||||
public String getUserSkin(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserSkinHandler.handle(request);
|
||||
}
|
||||
|
||||
@PostMapping("GetUserStoryApi")
|
||||
public String getUserStory(@ModelAttribute Map<String, Object> request) throws JsonProcessingException {
|
||||
return getUserStoryHandler.handle(request);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.UserEventMap;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("OngekiUserEventMapRepository")
|
||||
public interface UserEventMapRepository extends JpaRepository<UserEventMap, Long> {
|
||||
|
||||
Optional<UserEventMap> findByUser(UserData userData);
|
||||
|
||||
Optional<UserEventMap> findByUser_Card_ExtId(long userId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.dao.userdata;
|
||||
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.UserSkin;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Repository("OngekiUserSkinRepository")
|
||||
public interface UserSkinRepository extends JpaRepository<UserSkin, Long> {
|
||||
|
||||
List<UserSkin> findByUser_Card_ExtId(long userId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.ongeki.dao.userdata.UserEventMapRepository;
|
||||
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.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("OngekiGetUserEventMapHandler")
|
||||
public class GetUserEventMapHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserEventMapHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserEventMapRepository userEventMapRepository;
|
||||
|
||||
@Autowired
|
||||
public GetUserEventMapHandler(BasicMapper mapper, UserEventMapRepository userEventMapRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userEventMapRepository = userEventMapRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, ?> request) throws JsonProcessingException {
|
||||
long userId = ((Number) request.get("userId")).longValue();
|
||||
var eventMapOptional = userEventMapRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
resultMap.put("userId", userId);
|
||||
if(eventMapOptional.isPresent()) {
|
||||
resultMap.put("userEventMap", eventMapOptional.get());
|
||||
} else {
|
||||
resultMap.put("userEventMap", null);
|
||||
}
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,7 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
resp.setLevel(user.getLevel());
|
||||
resp.setExp(user.getExp());
|
||||
resp.setPlayerRating(user.getPlayerRating());
|
||||
resp.setNewPlayerRating(user.getNewPlayerRating());
|
||||
|
||||
resp.setLastGameId(user.getLastGameId());
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.ongeki.dao.userdata.UserSkinRepository;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.UserSkin;
|
||||
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.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("OngekiGetUserSkinHandler")
|
||||
public class GetUserSkinHandler implements BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(GetUserSkinHandler.class);
|
||||
|
||||
private final BasicMapper mapper;
|
||||
|
||||
private final UserSkinRepository userSkinRepository;
|
||||
|
||||
@Autowired
|
||||
public GetUserSkinHandler(BasicMapper mapper, UserSkinRepository userSkinRepository) {
|
||||
this.mapper = mapper;
|
||||
this.userSkinRepository = userSkinRepository;
|
||||
}
|
||||
|
||||
|
||||
@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);
|
||||
List<UserSkin> userSkinList = userSkinRepository.findByUser_Card_ExtId(userId);
|
||||
resultMap.put("length", userSkinList.size());
|
||||
resultMap.put("userSkinList", userSkinList);
|
||||
|
||||
String json = mapper.write(resultMap);
|
||||
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.handler.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.general.model.Card;
|
||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating;
|
||||
import icu.samnyan.aqua.sega.general.service.CardService;
|
||||
import icu.samnyan.aqua.sega.ongeki.dao.userdata.*;
|
||||
import icu.samnyan.aqua.sega.general.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.gamedata.OngekiFumenScore;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.request.UpsertUserAll;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.response.CodeResp;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.*;
|
||||
@@ -22,6 +23,7 @@ import java.util.Optional;
|
||||
|
||||
/**
|
||||
* The handler for saving all data of a ONGEKI profile
|
||||
*
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Component("OngekiUserAllHandler")
|
||||
@@ -58,10 +60,11 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
private final UserEventMusicRepository userEventMusicRepository;
|
||||
private final UserTechEventRepository userTechEventRepository;
|
||||
private final UserKopRepository userKopRepository;
|
||||
private final UserEventMapRepository userEventMapRepository;
|
||||
|
||||
@Autowired
|
||||
public UpsertUserAllHandler(BasicMapper mapper,
|
||||
CardService cardService, UserDataRepository userDataRepository, UserOptionRepository userOptionRepository, UserPlaylogRepository userPlaylogRepository, UserActivityRepository userActivityRepository, UserMusicDetailRepository userMusicDetailRepository, UserCharacterRepository userCharacterRepository, UserCardRepository userCardRepository, UserDeckRepository userDeckRepository, UserStoryRepository userStoryRepository, UserChapterRepository userChapterRepository, UserItemRepository userItemRepository, UserMusicItemRepository userMusicItemRepository, UserLoginBonusRepository userLoginBonusRepository, UserEventPointRepository userEventPointRepository, UserMissionPointRepository userMissionPointRepository, UserTrainingRoomRepository userTrainingRoomRepository, UserGeneralDataRepository userGeneralDataRepository, UserBossRepository userBossRepository, UserScenarioRepository userScenarioRepository, UserTechCountRepository userTechCountRepository, UserTradeItemRepository userTradeItemRepository, UserEventMusicRepository userEventMusicRepository, UserTechEventRepository userTechEventRepository, UserKopRepository userKopRepository, UserMemoryChapterRepository userMemoryChapterRepository) {
|
||||
CardService cardService, UserDataRepository userDataRepository, UserOptionRepository userOptionRepository, UserPlaylogRepository userPlaylogRepository, UserActivityRepository userActivityRepository, UserMusicDetailRepository userMusicDetailRepository, UserCharacterRepository userCharacterRepository, UserCardRepository userCardRepository, UserDeckRepository userDeckRepository, UserStoryRepository userStoryRepository, UserChapterRepository userChapterRepository, UserItemRepository userItemRepository, UserMusicItemRepository userMusicItemRepository, UserLoginBonusRepository userLoginBonusRepository, UserEventPointRepository userEventPointRepository, UserMissionPointRepository userMissionPointRepository, UserTrainingRoomRepository userTrainingRoomRepository, UserGeneralDataRepository userGeneralDataRepository, UserBossRepository userBossRepository, UserScenarioRepository userScenarioRepository, UserTechCountRepository userTechCountRepository, UserTradeItemRepository userTradeItemRepository, UserEventMusicRepository userEventMusicRepository, UserTechEventRepository userTechEventRepository, UserKopRepository userKopRepository, UserMemoryChapterRepository userMemoryChapterRepository, UserEventMapRepository userEventMapRepository) {
|
||||
this.mapper = mapper;
|
||||
this.cardService = cardService;
|
||||
this.userDataRepository = userDataRepository;
|
||||
@@ -89,6 +92,7 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
this.userEventMusicRepository = userEventMusicRepository;
|
||||
this.userTechEventRepository = userTechEventRepository;
|
||||
this.userKopRepository = userKopRepository;
|
||||
this.userEventMapRepository = userEventMapRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,7 +122,7 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
}
|
||||
|
||||
// If new data exists, use new data. Otherwise, use old data
|
||||
newUserData = !upsertUserAll.getUserData().isEmpty() ? upsertUserAll.getUserData().get(0) : userData;
|
||||
newUserData = !upsertUserAll.getUserData().isEmpty() ? upsertUserAll.getUserData().getFirst() : userData;
|
||||
|
||||
newUserData.setId(userData.getId());
|
||||
newUserData.setCard(userData.getCard());
|
||||
@@ -132,7 +136,7 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
|
||||
|
||||
// UserOption
|
||||
UserOption newUserOption = upsertUserAll.getUserOption().get(0);
|
||||
UserOption newUserOption = upsertUserAll.getUserOption().getFirst();
|
||||
|
||||
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser(newUserData);
|
||||
UserOption userOption = userOptionOptional.orElseGet(() -> new UserOption(newUserData));
|
||||
@@ -181,7 +185,7 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
|
||||
// UserRecentRatingList
|
||||
// This thing still need to save to solve the rating drop
|
||||
this.saveGeneralData(upsertUserAll.getUserRecentRatingList(), newUserData, "recent_rating_list");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRecentRatingList(), newUserData, "recent_rating_list");
|
||||
|
||||
|
||||
/*
|
||||
@@ -190,33 +194,44 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
* into a csv format for convenience
|
||||
*/
|
||||
// UserBpBaseList (For calculating Battle point)
|
||||
this.saveGeneralData(upsertUserAll.getUserBpBaseList(), newUserData, "battle_point_base");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserBpBaseList(), newUserData, "battle_point_base");
|
||||
|
||||
|
||||
// This is the best rating of all charts. Best 30 + 10 after that.
|
||||
// userRatingBaseBestList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseBestList(), newUserData, "rating_base_best");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseBestList(), newUserData, "rating_base_best");
|
||||
|
||||
|
||||
// userRatingBaseNextList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseNextList(), newUserData, "rating_base_next");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseNextList(), newUserData, "rating_base_next");
|
||||
|
||||
|
||||
// This is the best rating of new charts. Best 15 + 10 after that.
|
||||
// New chart means same version
|
||||
// userRatingBaseBestNewList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseBestNewList(), newUserData, "rating_base_new_best");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseBestNewList(), newUserData, "rating_base_new_best");
|
||||
|
||||
// userRatingBaseNextNewList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseNextNewList(), newUserData, "rating_base_new_next");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseNextNewList(), newUserData, "rating_base_new_next");
|
||||
|
||||
// This is the recent best
|
||||
// userRatingBaseHotList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseHotList(), newUserData, "rating_base_hot_best");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseHotList(), newUserData, "rating_base_hot_best");
|
||||
|
||||
// userRatingBaseHotNextList
|
||||
this.saveGeneralData(upsertUserAll.getUserRatingBaseHotNextList(), newUserData, "rating_base_hot_next");
|
||||
this.saveRecentRatingData(upsertUserAll.getUserRatingBaseHotNextList(), newUserData, "rating_base_hot_next");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBaseBestList(), newUserData, "new_rating_base_best");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBaseNextBestList(), newUserData, "new_rating_base_next_best");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBaseBestNewList(), newUserData, "new_rating_base_new_best");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBaseNextBestNewList(), newUserData, "new_rating_base_new_next_best");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBasePScoreList(), newUserData, "new_rating_base_pscore");
|
||||
|
||||
this.saveFumenScoreData(upsertUserAll.getUserNewRatingBaseNextPScoreList(), newUserData, "new_rating_base_next_pscore");
|
||||
|
||||
// UserMusicDetailList
|
||||
List<UserMusicDetail> userMusicDetailList = upsertUserAll.getUserMusicDetailList();
|
||||
@@ -339,16 +354,16 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
|
||||
// UserMemoryChapterList
|
||||
List<UserMemoryChapter> userMemoryChapterList = upsertUserAll.getUserMemoryChapterList();
|
||||
|
||||
|
||||
if (userMemoryChapterList != null) {
|
||||
List<UserMemoryChapter> newUserMemoryChapterList = new ArrayList<>();
|
||||
|
||||
for (UserMemoryChapter newUserMemoryChapter : userMemoryChapterList) {
|
||||
int chapterId = newUserMemoryChapter.getChapterId();
|
||||
|
||||
|
||||
Optional<UserMemoryChapter> chapterOptional = userMemoryChapterRepository.findByUserAndChapterId(newUserData, chapterId);
|
||||
UserMemoryChapter userChapter = chapterOptional.orElseGet(() -> new UserMemoryChapter(newUserData));
|
||||
|
||||
|
||||
newUserMemoryChapter.setId(userChapter.getId());
|
||||
newUserMemoryChapter.setUser(newUserData);
|
||||
newUserMemoryChapterList.add(newUserMemoryChapter);
|
||||
@@ -561,13 +576,24 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
}
|
||||
userKopRepository.saveAll(newUserKopList);
|
||||
|
||||
// UserEventMap
|
||||
UserEventMap newUserEventMap = upsertUserAll.getUserEventMap();
|
||||
if (newUserEventMap != null) {
|
||||
Optional<UserEventMap> userEventOptional = userEventMapRepository.findByUser(newUserData);
|
||||
UserEventMap userEventMap = userEventOptional.orElseGet(() -> new UserEventMap(newUserData));
|
||||
|
||||
newUserEventMap.setId(userEventMap.getId());
|
||||
newUserEventMap.setUser(newUserData);
|
||||
userEventMapRepository.save(newUserEventMap);
|
||||
}
|
||||
|
||||
String json = mapper.write(new CodeResp(1, "upsertUserAll"));
|
||||
logger.info("Response: " + json);
|
||||
return json;
|
||||
|
||||
}
|
||||
|
||||
private void saveGeneralData(List<UserRecentRating> itemList, UserData newUserData, String key) {
|
||||
private void saveRecentRatingData(List<UserRecentRating> itemList, UserData newUserData, String key) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// Convert to a string
|
||||
for (UserRecentRating item :
|
||||
@@ -575,12 +601,34 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
sb.append(item.getMusicId()).append(":").append(item.getDifficultId()).append(":").append(item.getScore());
|
||||
sb.append(",");
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
if (!sb.isEmpty()) {
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
saveGeneralData(newUserData, key, sb.toString());
|
||||
}
|
||||
|
||||
private void saveFumenScoreData(List<OngekiFumenScore> itemList, UserData newUserData, String key) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (OngekiFumenScore item : itemList) {
|
||||
sb.append(item.getMusicId()).append(":")
|
||||
.append(item.getDifficultId()).append(":")
|
||||
.append(item.getScore()).append(":")
|
||||
.append(item.getPlatinumScoreStar()).append(":")
|
||||
.append(item.getPlatinumScoreMax());
|
||||
sb.append(",");
|
||||
}
|
||||
|
||||
if (!sb.isEmpty()) {
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
saveGeneralData(newUserData, key, sb.toString());
|
||||
}
|
||||
|
||||
private void saveGeneralData(UserData newUserData, String key, String data) {
|
||||
Optional<UserGeneralData> uOptional = userGeneralDataRepository.findByUserAndPropertyKey(newUserData, key);
|
||||
UserGeneralData userGeneralData = uOptional.orElseGet(() -> new UserGeneralData(newUserData, key));
|
||||
userGeneralData.setPropertyValue(sb.toString());
|
||||
userGeneralData.setPropertyValue(data);
|
||||
userGeneralDataRepository.save(userGeneralData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.model.gamedata;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OngekiFumenScore {
|
||||
private int musicId;
|
||||
private int difficultId;
|
||||
private String romVersionCode;
|
||||
private int score;
|
||||
public int platinumScoreMax;
|
||||
public int platinumScoreStar;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package icu.samnyan.aqua.sega.ongeki.model.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import icu.samnyan.aqua.sega.general.model.response.UserRecentRating;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.gamedata.OngekiFumenScore;
|
||||
import icu.samnyan.aqua.sega.ongeki.model.userdata.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -47,6 +48,18 @@ public class UpsertUserAll implements Serializable {
|
||||
|
||||
private List<UserRecentRating> userRatingBaseHotNextList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBasePScoreList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBaseBestList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBaseBestNewList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBaseNextPScoreList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBaseNextBestList;
|
||||
|
||||
private List<OngekiFumenScore> userNewRatingBaseNextBestNewList;
|
||||
|
||||
private List<UserMusicDetail> userMusicDetailList;
|
||||
|
||||
private List<UserCharacter> userCharacterList;
|
||||
@@ -89,6 +102,8 @@ public class UpsertUserAll implements Serializable {
|
||||
|
||||
private List<UserKop> userKopList;
|
||||
|
||||
public UserEventMap userEventMap;
|
||||
|
||||
private Map<String, Object> clientSystemInfo;
|
||||
|
||||
@JsonProperty("isNewMusicDetailList")
|
||||
|
||||
@@ -22,6 +22,7 @@ public class GetUserPreviewResp {
|
||||
private int level = 0;
|
||||
private long exp = 0;
|
||||
private long playerRating = 0;
|
||||
private long newPlayerRating = 0;
|
||||
private String lastGameId = "";
|
||||
private String lastRomVersion = "";
|
||||
private String lastDataVersion = "";
|
||||
|
||||
@@ -35,7 +35,6 @@ public class UserData implements Serializable, IUserData {
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "aime_card_id", unique = true)
|
||||
private Card card;
|
||||
// Access code in card
|
||||
|
||||
private String userName;
|
||||
|
||||
@@ -57,10 +56,16 @@ public class UserData implements Serializable, IUserData {
|
||||
|
||||
private int medalCount;
|
||||
|
||||
private int shizukuCount;
|
||||
|
||||
private int playerRating;
|
||||
|
||||
private int highestRating;
|
||||
|
||||
private int newPlayerRating;
|
||||
|
||||
private int newHighestRating;
|
||||
|
||||
private int battlePoint;
|
||||
|
||||
private int bestBattlePoint;
|
||||
@@ -118,6 +123,18 @@ public class UserData implements Serializable, IUserData {
|
||||
|
||||
private long sumBattleLunaticHighScore;
|
||||
|
||||
private int sumPlatinumScoreStar;
|
||||
|
||||
private int sumBasicPlatinumScoreStar;
|
||||
|
||||
private int sumAdvancedPlatinumScoreStar;
|
||||
|
||||
private int sumExpertPlatinumScoreStar;
|
||||
|
||||
private int sumMasterPlatinumScoreStar;
|
||||
|
||||
private int sumLunaticPlatinumScoreStar;
|
||||
|
||||
private String eventWatchedDate;
|
||||
|
||||
private String cmEventWatchedDate;
|
||||
@@ -163,4 +180,4 @@ public class UserData implements Serializable, IUserData {
|
||||
public long getTotalScore() {
|
||||
return sumTechHighScore;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.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 = "OngekiUserEventMap")
|
||||
@Table(name = "ongeki_user_event_map")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserEventMap 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 eventId;
|
||||
|
||||
private int mapId;
|
||||
|
||||
private String mapData;
|
||||
|
||||
private int totalPoint;
|
||||
|
||||
private int totalUsePoint;
|
||||
|
||||
public UserEventMap(UserData userData) {
|
||||
this.user = userData;
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,9 @@ public class UserMemoryChapter implements Serializable {
|
||||
@JsonProperty("isBossWatched")
|
||||
private boolean isBossWatched;
|
||||
|
||||
@JsonProperty("isEndingWatched")
|
||||
private boolean isEndingWatched;
|
||||
|
||||
@JsonProperty("isClear")
|
||||
private boolean isClear;
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ public class UserMusicDetail implements Serializable, IGenericUserMusic {
|
||||
|
||||
private int platinumScoreMax;
|
||||
|
||||
private int platinumScoreStar;
|
||||
|
||||
private int maxComboCount;
|
||||
|
||||
private int maxOverKill;
|
||||
|
||||
@@ -82,6 +82,8 @@ public class UserOption implements Serializable {
|
||||
|
||||
private int effectPos;
|
||||
|
||||
private int effectAttack;
|
||||
|
||||
private int judgeDisp;
|
||||
|
||||
private int judgePos;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package icu.samnyan.aqua.sega.ongeki.model.userdata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@Entity(name = "OngekiUserSkin")
|
||||
@Table(name = "ongeki_user_skin")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserSkin 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;
|
||||
|
||||
//TODO: should be updated on net when changing skin
|
||||
private boolean isValid;
|
||||
|
||||
private int deckId;
|
||||
|
||||
private int cardId1;
|
||||
|
||||
private int cardId2;
|
||||
|
||||
private int cardId3;
|
||||
|
||||
public UserSkin(UserData userData) {
|
||||
this.user = userData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user