forked from Cookies_Github_mirror/AquaDX
[general] Fix all type mismatch with db
This commit is contained in:
@@ -87,41 +87,41 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("profile")
|
||||
public ProfileResp getProfile(@RequestParam Integer aimeId) {
|
||||
public ProfileResp getProfile(@RequestParam long aimeId) {
|
||||
return mapper.convert(userDataRepository.findByCard_ExtId(aimeId).orElseThrow(), new TypeReference<>() {
|
||||
});
|
||||
}
|
||||
|
||||
@PostMapping("profile/userName")
|
||||
public UserData updateName(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setUserName((String) request.get("userName"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/plate")
|
||||
public UserData updatePlate(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setNameplateId((Integer) request.get("nameplateId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/trophy")
|
||||
public UserData updateTrophy(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setTrophyId((Integer) request.get("trophyId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@PostMapping("profile/card")
|
||||
public UserData updateCard(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
profile.setCardId((Integer) request.get("cardId"));
|
||||
return userDataRepository.save(profile);
|
||||
}
|
||||
|
||||
@GetMapping("card")
|
||||
public ReducedPageResponse<UserCard> getCard(@RequestParam Integer aimeId,
|
||||
public ReducedPageResponse<UserCard> getCard(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserCard> cards = userCardRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size, Sort.Direction.DESC, "id"));
|
||||
@@ -136,7 +136,7 @@ public class ApiOngekiPlayerDataController {
|
||||
*/
|
||||
@PostMapping("card")
|
||||
public ResponseEntity<Object> insertCard(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
Integer cardId = (Integer) request.get("cardId");
|
||||
Optional<UserCard> userCardOptional = userCardRepository.findByUserAndCardId(profile, cardId);
|
||||
if (userCardOptional.isPresent()) {
|
||||
@@ -174,7 +174,7 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@PostMapping("card/{cardId}/kaika")
|
||||
public ResponseEntity<Object> kaikaCard(@RequestParam Integer aimeId, @PathVariable Integer cardId) {
|
||||
public ResponseEntity<Object> kaikaCard(@RequestParam long aimeId, @PathVariable Integer cardId) {
|
||||
Optional<UserCard> userCardOptional = userCardRepository.findByUser_Card_ExtIdAndCardId(aimeId, cardId);
|
||||
if (userCardOptional.isEmpty()) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new MessageResponse("Card not found."));
|
||||
@@ -192,7 +192,7 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@PostMapping("card/{cardId}/choKaika")
|
||||
public ResponseEntity<Object> choKaikaCard(@RequestParam Integer aimeId, @PathVariable Integer cardId) {
|
||||
public ResponseEntity<Object> choKaikaCard(@RequestParam long aimeId, @PathVariable Integer cardId) {
|
||||
Optional<UserCard> userCardOptional = userCardRepository.findByUser_Card_ExtIdAndCardId(aimeId, cardId);
|
||||
if (userCardOptional.isEmpty()) {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new MessageResponse("Card not found."));
|
||||
@@ -224,7 +224,7 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("character")
|
||||
public ReducedPageResponse<UserCharacter> getCharacter(@RequestParam Integer aimeId,
|
||||
public ReducedPageResponse<UserCharacter> getCharacter(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserCharacter> characters = userCharacterRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size));
|
||||
@@ -232,13 +232,13 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("activity")
|
||||
public List<UserActivity> getActivities(@RequestParam Integer aimeId) {
|
||||
public List<UserActivity> getActivities(@RequestParam long aimeId) {
|
||||
return userActivityRepository.findByUser_Card_ExtId(aimeId);
|
||||
}
|
||||
|
||||
@PostMapping("activity")
|
||||
public ResponseEntity<Object> updateActivities(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
Integer activityId = (Integer) request.get("id");
|
||||
Integer kind = (Integer) request.get("kind");
|
||||
Integer sortNumber = (Integer) request.get("sortNumber");
|
||||
@@ -266,7 +266,7 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("item")
|
||||
public ReducedPageResponse<UserItem> getItem(@RequestParam Integer aimeId,
|
||||
public ReducedPageResponse<UserItem> getItem(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserItem> items = userItemRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size));
|
||||
@@ -275,7 +275,7 @@ public class ApiOngekiPlayerDataController {
|
||||
|
||||
@PostMapping("item")
|
||||
public ResponseEntity<Object> updateItem(@RequestBody Map<String, Object> request) {
|
||||
UserData profile = userDataRepository.findByCard_ExtId((Integer) request.get("aimeId")).orElseThrow();
|
||||
UserData profile = userDataRepository.findByCard_ExtId(((Number) request.get("aimeId")).longValue()).orElseThrow();
|
||||
Integer itemKind = (Integer) request.get("itemKind");
|
||||
Integer itemId = (Integer) request.get("itemId");
|
||||
int stock = 1;
|
||||
@@ -299,7 +299,7 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("recent")
|
||||
public ReducedPageResponse<UserPlaylog> getRecent(@RequestParam Integer aimeId,
|
||||
public ReducedPageResponse<UserPlaylog> getRecent(@RequestParam long aimeId,
|
||||
@RequestParam(required = false, defaultValue = "0") int page,
|
||||
@RequestParam(required = false, defaultValue = "10") int size) {
|
||||
Page<UserPlaylog> playlogs = userPlaylogRepository.findByUser_Card_ExtId(aimeId, PageRequest.of(page, size, Sort.Direction.DESC, "id"));
|
||||
@@ -308,29 +308,29 @@ public class ApiOngekiPlayerDataController {
|
||||
}
|
||||
|
||||
@GetMapping("song/{id}")
|
||||
public List<UserMusicDetail> getSongDetail(@RequestParam Integer aimeId, @PathVariable int id) {
|
||||
public List<UserMusicDetail> getSongDetail(@RequestParam long aimeId, @PathVariable int id) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(aimeId, id);
|
||||
}
|
||||
|
||||
@GetMapping("song/{id}/{level}")
|
||||
public List<UserPlaylog> getLevelPlaylog(@RequestParam Integer aimeId, @PathVariable int id, @PathVariable int level) {
|
||||
public List<UserPlaylog> getLevelPlaylog(@RequestParam long aimeId, @PathVariable int id, @PathVariable int level) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(aimeId, id, level);
|
||||
}
|
||||
|
||||
@GetMapping("options")
|
||||
public UserOption getOptions(@RequestParam Integer aimeId) {
|
||||
public UserOption getOptions(@RequestParam long aimeId) {
|
||||
return userOptionRepository.findByUser_Card_ExtId(aimeId).orElseThrow();
|
||||
}
|
||||
|
||||
@GetMapping("general")
|
||||
public ResponseEntity<Object> getGeneralData(@RequestParam Integer aimeId, @RequestParam String key) {
|
||||
public ResponseEntity<Object> getGeneralData(@RequestParam long aimeId, @RequestParam String key) {
|
||||
Optional<UserGeneralData> userGeneralDataOptional = userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(aimeId, key);
|
||||
return userGeneralDataOptional.<ResponseEntity<Object>>map(ResponseEntity::ok)
|
||||
.orElseGet(() -> ResponseEntity.status(HttpStatus.NOT_FOUND).body(new MessageResponse("User or value not found.")));
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
public ResponseEntity<Object> exportAllUserData(@RequestParam Integer aimeId) {
|
||||
public ResponseEntity<Object> exportAllUserData(@RequestParam long aimeId) {
|
||||
OngekiDataExport data = new OngekiDataExport();
|
||||
try {
|
||||
data.setGameId("SDDT");
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface UserActivityRepository extends JpaRepository<UserActivity, Long
|
||||
|
||||
Optional<UserActivity> findTopByUserAndActivityIdAndKindOrderByIdDesc(UserData user, int activityId, int kind);
|
||||
|
||||
List<UserActivity> findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(int extId, int kind);
|
||||
List<UserActivity> findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Long extId, int kind);
|
||||
|
||||
List<UserActivity> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserActivity> findAllByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ import java.util.Optional;
|
||||
@Repository
|
||||
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
|
||||
|
||||
Page<UserCharacter> findByUser_Card_ExtId(int extId, Pageable pageable);
|
||||
Page<UserCharacter> findByUser_Card_ExtId(Long extId, Pageable pageable);
|
||||
|
||||
List<UserCharacter> findByUser_Card_ExtId(int extId);
|
||||
List<UserCharacter> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserCharacter> findTopByUserAndCharacterIdOrderByIdDesc(UserData user, int characterId);
|
||||
|
||||
Optional<UserCharacter> findByUser_Card_ExtIdAndCharacterId(int extId, int characterId);
|
||||
Optional<UserCharacter> findByUser_Card_ExtIdAndCharacterId(Long extId, int characterId);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Optional;
|
||||
*/
|
||||
@Repository
|
||||
public interface UserChargeRepository extends JpaRepository<UserCharge, Long> {
|
||||
List<UserCharge> findByUser_Card_ExtId(int extId);
|
||||
List<UserCharge> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserCharge> findByUserAndChargeId(UserData extId, int chargeId);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Optional;
|
||||
public interface UserCourseRepository extends JpaRepository<UserCourse, Long> {
|
||||
Optional<UserCourse> findTopByUserAndCourseIdOrderByIdDesc(UserData user, int courseId);
|
||||
|
||||
Page<UserCourse> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserCourse> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
|
||||
List<UserCourse> findByUser_Card_ExtId(int extId);
|
||||
List<UserCourse> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserDataExRepository extends JpaRepository<UserDataEx, Long> {
|
||||
|
||||
Optional<UserDataEx> findByUser(UserData user);
|
||||
|
||||
Optional<UserDataEx> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserDataEx> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserDataRepository extends JpaRepository<UserData, Long> {
|
||||
|
||||
Optional<UserData> findByCard(Card card);
|
||||
|
||||
Optional<UserData> findByCard_ExtId(int extId);
|
||||
Optional<UserData> findByCard_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ public interface UserDuelRepository extends JpaRepository<UserDuel, Long> {
|
||||
|
||||
Optional<UserDuel> findTopByUserAndDuelIdOrderByIdDesc(UserData user, int duelId);
|
||||
|
||||
List<UserDuel> findByUser_Card_ExtId(int extId);
|
||||
List<UserDuel> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ import java.util.Optional;
|
||||
public interface UserGameOptionExRepository extends JpaRepository<UserGameOptionEx, Long> {
|
||||
Optional<UserGameOptionEx> findByUser(UserData user);
|
||||
|
||||
Optional<UserGameOptionEx> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserGameOptionEx> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserGameOptionRepository extends JpaRepository<UserGameOption,
|
||||
|
||||
Optional<UserGameOption> findByUser(UserData user);
|
||||
|
||||
Optional<UserGameOption> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserGameOption> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ public interface UserGeneralDataRepository extends JpaRepository<UserGeneralData
|
||||
|
||||
Optional<UserGeneralData> findByUserAndPropertyKey(UserData user, String key);
|
||||
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(int extId, String key);
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(Long extId, String key);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package icu.samnyan.aqua.sega.chunithm.dao.userdata;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserItem;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -19,9 +18,9 @@ public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
Optional<UserItem> findTopByUserAndItemIdAndItemKindOrderByIdDesc(UserData user, int itemId, int itemKind);
|
||||
|
||||
Page<UserItem> findAllByUser_Card_ExtIdAndItemKind(int extId, int itemKind, Pageable pageable);
|
||||
Page<UserItem> findAllByUser_Card_ExtIdAndItemKind(Long extId, int itemKind, Pageable pageable);
|
||||
|
||||
List<UserItem> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserItem> findAllByUser_Card_ExtId(Long extId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtId(int extId, Pageable pageable);
|
||||
Page<UserItem> findByUser_Card_ExtId(Long extId, Pageable pageable);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
public interface UserMapRepository extends JpaRepository<UserMap, Long> {
|
||||
List<UserMap> findAllByUser(UserData user);
|
||||
|
||||
List<UserMap> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserMap> findAllByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserMap> findTopByUserAndMapIdOrderByIdDesc(UserData user, int mapId);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail
|
||||
|
||||
Optional<UserMusicDetail> findTopByUserAndMusicIdAndLevelOrderByIdDesc(UserData user, int musicId, int level);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(int extId);
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(int extId, int musicId);
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(Long extId, int musicId);
|
||||
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndLevelNot(int extId, int levelNot, Pageable page);
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndLevelNot(Long extId, int levelNot, Pageable page);
|
||||
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(int extId, int musicId, int level);
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(Long extId, int musicId, int level);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtId(int extId);
|
||||
List<UserPlaylog> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ package icu.samnyan.aqua.sega.chunithm.handler.impl;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.chunithm.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserDataService;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.util.VersionUtil;
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -33,23 +32,13 @@ public class GetUserDataHandler implements BaseHandler {
|
||||
|
||||
private final UserDataService userDataService;
|
||||
|
||||
private final boolean overwriteVersion;
|
||||
private final String romVersion;
|
||||
private final String dataVersion;
|
||||
|
||||
@Autowired
|
||||
public GetUserDataHandler(StringMapper mapper,
|
||||
ClientSettingService clientSettingService, UserDataService userDataService,
|
||||
@Value("${game.chunithm.overwrite-version}") boolean overwriteVersion,
|
||||
@Value("${game.chunithm.rom-version}") String romVersion,
|
||||
@Value("${game.chunithm.data-version}") String dataVersion
|
||||
ClientSettingService clientSettingService, UserDataService userDataService
|
||||
) {
|
||||
this.mapper = mapper;
|
||||
this.clientSettingService = clientSettingService;
|
||||
this.userDataService = userDataService;
|
||||
this.overwriteVersion = overwriteVersion;
|
||||
this.romVersion = romVersion;
|
||||
this.dataVersion = dataVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,16 +6,15 @@ import icu.samnyan.aqua.sega.chunithm.model.response.GetUserPreviewResp;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserGameOption;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserCharacterService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserDataService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserGameOptionService;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.util.VersionUtil;
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -43,27 +42,17 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
private final UserCharacterService userCharacterService;
|
||||
private final UserGameOptionService userGameOptionService;
|
||||
|
||||
private final boolean overwriteVersion;
|
||||
private final String romVersion;
|
||||
private final String dataVersion;
|
||||
|
||||
@Autowired
|
||||
public GetUserPreviewHandler(StringMapper mapper,
|
||||
ClientSettingService clientSettingService, UserDataService userDataService,
|
||||
UserCharacterService userCharacterService,
|
||||
UserGameOptionService userGameOptionService,
|
||||
@Value("${game.chunithm.overwrite-version}") boolean overwriteVersion,
|
||||
@Value("${game.chunithm.rom-version}") String romVersion,
|
||||
@Value("${game.chunithm.data-version}") String dataVersion
|
||||
UserGameOptionService userGameOptionService
|
||||
) {
|
||||
this.mapper = mapper;
|
||||
this.clientSettingService = clientSettingService;
|
||||
this.userDataService = userDataService;
|
||||
this.userCharacterService = userCharacterService;
|
||||
this.userGameOptionService = userGameOptionService;
|
||||
this.overwriteVersion = overwriteVersion;
|
||||
this.romVersion = romVersion;
|
||||
this.dataVersion = dataVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,10 +90,6 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
resp.setLastDataVersion(user.getLastDataVersion());
|
||||
}
|
||||
|
||||
if (overwriteVersion) {
|
||||
resp.setLastRomVersion(romVersion);
|
||||
resp.setLastDataVersion(dataVersion);
|
||||
}
|
||||
resp.setLastPlayDate(user.getLastPlayDate());
|
||||
resp.setTrophyId(user.getTrophyId());
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package icu.samnyan.aqua.sega.chunithm.model.gamedata;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
@@ -29,7 +32,7 @@ public class Character implements Serializable {
|
||||
|
||||
private String illustratorName;
|
||||
|
||||
private Integer firstSkillId;
|
||||
private String firstSkillId;
|
||||
|
||||
// Format: level:skillId,level:skillId
|
||||
// Keep 0 skillId
|
||||
|
||||
@@ -33,6 +33,7 @@ public class UserGeneralData implements Serializable {
|
||||
|
||||
private String propertyKey;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String propertyValue;
|
||||
|
||||
public UserGeneralData(UserData userData, String key) {
|
||||
|
||||
@@ -35,10 +35,10 @@ public class UserActivityService {
|
||||
}
|
||||
|
||||
public List<UserActivity> getAllByUserIdAndKind(String userId, String kind) {
|
||||
return userActivityRepository.findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Integer.parseInt(userId), Integer.parseInt(kind));
|
||||
return userActivityRepository.findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Long.parseLong(userId), Integer.parseInt(kind));
|
||||
}
|
||||
|
||||
public List<UserActivity> getByUserId(String userId) {
|
||||
return userActivityRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userActivityRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ public class UserCharacterService {
|
||||
}
|
||||
|
||||
public List<UserCharacter> getByUserId(String userId) {
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserCharacter> getByUserId(String userId, int pageNumber, int maxCount) {
|
||||
Pageable pageable = PageRequest.of(pageNumber, maxCount);
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Integer.parseInt(userId), pageable);
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Long.parseLong(userId), pageable);
|
||||
}
|
||||
|
||||
public Optional<UserCharacter> getByUserAndCharacterId(UserData user, int characterId) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class UserChargeService {
|
||||
}
|
||||
|
||||
public List<UserCharge> getByUserId(String userId) {
|
||||
return userChargeRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userChargeRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserCharge> getByUserAndChargeId(UserData user, int chargeId) {
|
||||
|
||||
@@ -34,12 +34,12 @@ public class UserCourseService {
|
||||
}
|
||||
|
||||
public List<UserCourse> getByUserId(String userId) {
|
||||
return userCourseRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userCourseRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserCourse> getByUserId(String userId, int pageNum, int maxCount) {
|
||||
Pageable page = PageRequest.of(pageNum, maxCount);
|
||||
return userCourseRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userCourseRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public Optional<UserCourse> getByUserAndCourseId(UserData user, int courseId) {
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserDataExService {
|
||||
}
|
||||
|
||||
public Optional<UserDataEx> getByExtId(String userId) {
|
||||
return userDataExRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userDataExRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class UserDataService {
|
||||
}
|
||||
|
||||
public Optional<UserData> getUserByExtId(String aimeId) {
|
||||
return userDataRepository.findByCard_ExtId(Integer.parseInt(aimeId));
|
||||
return userDataRepository.findByCard_ExtId(Long.parseLong(aimeId));
|
||||
}
|
||||
|
||||
public Optional<UserData> getUserByCard(Card card) {
|
||||
|
||||
@@ -35,6 +35,6 @@ public class UserDuelService {
|
||||
}
|
||||
|
||||
public List<UserDuel> getByUserId(String userId) {
|
||||
return userDuelRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userDuelRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserGameOptionExService {
|
||||
}
|
||||
|
||||
public Optional<UserGameOptionEx> getByUserId(String userId) {
|
||||
return userGameOptionExRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userGameOptionExRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserGameOptionService {
|
||||
}
|
||||
|
||||
public Optional<UserGameOption> getByUserId(String userId) {
|
||||
return userGameOptionRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userGameOptionRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UserGeneralDataService {
|
||||
}
|
||||
|
||||
public Optional<UserGeneralData> getByUserIdAndKey(String userId, String key) {
|
||||
return userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(Integer.parseInt(userId), key);
|
||||
return userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(Long.parseLong(userId), key);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class UserItemService {
|
||||
}
|
||||
|
||||
public List<UserItem> getByUserId(String userId) {
|
||||
return userItemRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userItemRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserItem> getByUserAndItemIdAndKind(UserData user, int itemId, int itemKind) {
|
||||
@@ -42,10 +42,10 @@ public class UserItemService {
|
||||
|
||||
public Page<UserItem> getByUserAndItemKind(String userId, int kind, int pageNumber, int maxCount) {
|
||||
Pageable page = PageRequest.of(pageNumber, maxCount);
|
||||
return userItemRepository.findAllByUser_Card_ExtIdAndItemKind(Integer.parseInt(userId), kind, page);
|
||||
return userItemRepository.findAllByUser_Card_ExtIdAndItemKind(Long.parseLong(userId), kind, page);
|
||||
}
|
||||
|
||||
public Page<UserItem> getByUserId(String userId, int page, int size) {
|
||||
return userItemRepository.findByUser_Card_ExtId(Integer.parseInt(userId), PageRequest.of(page, size));
|
||||
return userItemRepository.findByUser_Card_ExtId(Long.parseLong(userId), PageRequest.of(page, size));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class UserMapService {
|
||||
}
|
||||
|
||||
public List<UserMap> getByUserId(String userId) {
|
||||
return userMapRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userMapRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserMap> getByUserAndMapId(UserData user, int mapId) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserMusicDetail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,15 +33,15 @@ public class UserMusicDetailService {
|
||||
}
|
||||
|
||||
public List<UserMusicDetail> getByUserId(String userId) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserMusicDetail> getByUserId(String userId, Pageable page) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public List<UserMusicDetail> getByUserIdAndMusicId(String userId, int musicId) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(Integer.parseInt(userId), musicId);
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(Long.parseLong(userId), musicId);
|
||||
}
|
||||
|
||||
public Optional<UserMusicDetail> getByUserAndMusicIdAndLevel(UserData user, int musicId, int level) {
|
||||
|
||||
@@ -33,19 +33,19 @@ public class UserPlaylogService {
|
||||
}
|
||||
|
||||
public Page<UserPlaylog> getRecentPlays(String userId, Pageable page) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getRecent30Plays(String userId) {
|
||||
Pageable page = PageRequest.of(0, 30, Sort.by(Sort.Direction.DESC, "userPlayDate"));
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndLevelNot(Integer.parseInt(userId), 4, page);
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndLevelNot(Long.parseLong(userId), 4, page);
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getByUserId(String userId) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getByUserIdAndMusicIdAndLevel(String userId, int id, int level) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(Integer.parseInt(userId), id, level);
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(Long.parseLong(userId), id, level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package icu.samnyan.aqua.sega.diva.handler.ingame;
|
||||
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvCustomizeRepository;
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvRecordRepository;
|
||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
||||
@@ -11,6 +10,7 @@ import icu.samnyan.aqua.sega.diva.model.response.ingame.GetPvPdResponse;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerProfile;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerPvCustomize;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerPvRecord;
|
||||
import icu.samnyan.aqua.sega.diva.service.PlayerProfileService;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaDateTimeUtil;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper;
|
||||
import icu.samnyan.aqua.sega.util.URIEncoder;
|
||||
@@ -31,18 +31,18 @@ public class GetPvPdHandler extends BaseHandler {
|
||||
|
||||
private final PlayerPvRecordRepository pvRecordRepository;
|
||||
private final PlayerPvCustomizeRepository pvCustomizeRepository;
|
||||
private final PlayerProfileRepository profileRepository;
|
||||
private final PlayerProfileService playerProfileService;
|
||||
|
||||
public GetPvPdHandler(DivaMapper mapper, PlayerPvRecordRepository pvRecordRepository, PlayerPvCustomizeRepository pvCustomizeRepository, PlayerProfileRepository profileRepository) {
|
||||
public GetPvPdHandler(DivaMapper mapper, PlayerPvRecordRepository pvRecordRepository, PlayerPvCustomizeRepository pvCustomizeRepository, PlayerProfileService playerProfileService) {
|
||||
super(mapper);
|
||||
this.pvRecordRepository = pvRecordRepository;
|
||||
this.pvCustomizeRepository = pvCustomizeRepository;
|
||||
this.profileRepository = profileRepository;
|
||||
this.playerProfileService = playerProfileService;
|
||||
}
|
||||
|
||||
public String handle(GetPvPdRequest request) {
|
||||
|
||||
Optional<PlayerProfile> profileO = profileRepository.findByPdId(request.getPd_id());
|
||||
Optional<PlayerProfile> profileO = playerProfileService.findByPdId(request.getPd_id());
|
||||
StringBuilder pd = new StringBuilder();
|
||||
|
||||
for (int pvId :
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package icu.samnyan.aqua.sega.diva.handler.ingame;
|
||||
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerPvCustomizeRepository;
|
||||
import icu.samnyan.aqua.sega.diva.exception.ProfileNotFoundException;
|
||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
||||
@@ -9,6 +8,7 @@ import icu.samnyan.aqua.sega.diva.model.request.ingame.ShopExitRequest;
|
||||
import icu.samnyan.aqua.sega.diva.model.response.ingame.ShopExitResponse;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerProfile;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerPvCustomize;
|
||||
import icu.samnyan.aqua.sega.diva.service.PlayerProfileService;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -24,19 +24,19 @@ public class ShopExitHandler extends BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ShopExitHandler.class);
|
||||
|
||||
private final PlayerProfileRepository playerProfileRepository;
|
||||
private final PlayerProfileService playerProfileService;
|
||||
|
||||
private final PlayerPvCustomizeRepository pvCustomizeRepository;
|
||||
|
||||
public ShopExitHandler(DivaMapper mapper, PlayerProfileRepository playerProfileRepository, PlayerPvCustomizeRepository pvCustomizeRepository) {
|
||||
public ShopExitHandler(DivaMapper mapper, PlayerProfileService playerProfileService, PlayerPvCustomizeRepository pvCustomizeRepository) {
|
||||
super(mapper);
|
||||
this.playerProfileRepository = playerProfileRepository;
|
||||
this.playerProfileService = playerProfileService;
|
||||
this.pvCustomizeRepository = pvCustomizeRepository;
|
||||
}
|
||||
|
||||
public String handle(ShopExitRequest request) {
|
||||
|
||||
PlayerProfile profile = playerProfileRepository.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
PlayerProfile profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
PlayerPvCustomize customize = pvCustomizeRepository.findByPdIdAndPvId(profile, request.getPly_pv_id()).orElseGet(() -> new PlayerPvCustomize(profile, request.getPly_pv_id()));
|
||||
|
||||
if (request.getUse_pv_mdl_eqp() == 1) {
|
||||
@@ -53,7 +53,7 @@ public class ShopExitHandler extends BaseHandler {
|
||||
profile.setCommonCustomizeItems(arrToCsv(request.getC_itm_eqp_cmn_ary()));
|
||||
profile.setModuleSelectItemFlag(arrToCsv(request.getMs_itm_flg_cmn_ary()));
|
||||
|
||||
playerProfileRepository.save(profile);
|
||||
playerProfileService.save(profile);
|
||||
pvCustomizeRepository.save(customize);
|
||||
ShopExitResponse response = new ShopExitResponse(
|
||||
request.getCmd(),
|
||||
|
||||
@@ -10,6 +10,7 @@ import icu.samnyan.aqua.sega.diva.model.gamedata.Contest;
|
||||
import icu.samnyan.aqua.sega.diva.model.request.ingame.StageResultRequest;
|
||||
import icu.samnyan.aqua.sega.diva.model.response.ingame.StageResultResponse;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.*;
|
||||
import icu.samnyan.aqua.sega.diva.service.PlayerProfileService;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaCalculator;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -32,7 +33,7 @@ public class StageResultHandler extends BaseHandler {
|
||||
|
||||
private final GameSessionRepository gameSessionRepository;
|
||||
private final PlayerPvRecordRepository pvRecordRepository;
|
||||
private final PlayerProfileRepository profileRepository;
|
||||
private final PlayerProfileService playerProfileService;
|
||||
private final PlayLogRepository playLogRepository;
|
||||
private final ContestRepository contestRepository;
|
||||
private final PlayerContestRepository playerContestRepository;
|
||||
@@ -43,11 +44,11 @@ public class StageResultHandler extends BaseHandler {
|
||||
|
||||
private PlayerProfile currentProfile = null;
|
||||
|
||||
public StageResultHandler(DivaMapper mapper, GameSessionRepository gameSessionRepository, PlayerPvRecordRepository pvRecordRepository, PlayerProfileRepository profileRepository, PlayLogRepository playLogRepository, ContestRepository contestRepository, PlayerContestRepository playerContestRepository, PlayerCustomizeRepository playerCustomizeRepository, PlayerInventoryRepository playerInventoryRepository, DivaCalculator divaCalculator) {
|
||||
public StageResultHandler(DivaMapper mapper, GameSessionRepository gameSessionRepository, PlayerPvRecordRepository pvRecordRepository, PlayerProfileService playerProfileService, PlayLogRepository playLogRepository, ContestRepository contestRepository, PlayerContestRepository playerContestRepository, PlayerCustomizeRepository playerCustomizeRepository, PlayerInventoryRepository playerInventoryRepository, DivaCalculator divaCalculator) {
|
||||
super(mapper);
|
||||
this.gameSessionRepository = gameSessionRepository;
|
||||
this.pvRecordRepository = pvRecordRepository;
|
||||
this.profileRepository = profileRepository;
|
||||
this.playerProfileService = playerProfileService;
|
||||
this.playLogRepository = playLogRepository;
|
||||
this.contestRepository = contestRepository;
|
||||
this.playerContestRepository = playerContestRepository;
|
||||
@@ -59,7 +60,7 @@ public class StageResultHandler extends BaseHandler {
|
||||
public String handle(StageResultRequest request) {
|
||||
StageResultResponse response;
|
||||
if (request.getPd_id() != -1) {
|
||||
PlayerProfile profile = profileRepository.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
PlayerProfile profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
GameSession session = gameSessionRepository.findByPdId(profile).orElseThrow(SessionNotFoundException::new);
|
||||
|
||||
currentProfile = profile;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package icu.samnyan.aqua.sega.diva.handler.ingame;
|
||||
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.GameSessionRepository;
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
||||
import icu.samnyan.aqua.sega.diva.exception.ProfileNotFoundException;
|
||||
import icu.samnyan.aqua.sega.diva.exception.SessionNotFoundException;
|
||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
||||
@@ -9,6 +8,7 @@ import icu.samnyan.aqua.sega.diva.model.request.ingame.StageStartRequest;
|
||||
import icu.samnyan.aqua.sega.diva.model.response.BaseResponse;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.GameSession;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerProfile;
|
||||
import icu.samnyan.aqua.sega.diva.service.PlayerProfileService;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -23,17 +23,17 @@ public class StageStartHandler extends BaseHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(StageResultHandler.class);
|
||||
|
||||
private final GameSessionRepository gameSessionRepository;
|
||||
private final PlayerProfileRepository profileRepository;
|
||||
private final PlayerProfileService playerProfileService;
|
||||
|
||||
public StageStartHandler(DivaMapper mapper, GameSessionRepository gameSessionRepository, PlayerProfileRepository profileRepository) {
|
||||
public StageStartHandler(DivaMapper mapper, GameSessionRepository gameSessionRepository, PlayerProfileService playerProfileService) {
|
||||
super(mapper);
|
||||
this.gameSessionRepository = gameSessionRepository;
|
||||
this.profileRepository = profileRepository;
|
||||
this.playerProfileService = playerProfileService;
|
||||
}
|
||||
|
||||
public String handle(StageStartRequest request) {
|
||||
if (request.getPd_id() != -1) {
|
||||
PlayerProfile profile = profileRepository.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
PlayerProfile profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
GameSession session = gameSessionRepository.findByPdId(profile).orElseThrow(SessionNotFoundException::new);
|
||||
|
||||
int[] stageArr = request.getStg_ply_pv_id();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package icu.samnyan.aqua.sega.diva.handler.ingame;
|
||||
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerProfileRepository;
|
||||
import icu.samnyan.aqua.sega.diva.dao.userdata.PlayerScreenShotRepository;
|
||||
import icu.samnyan.aqua.sega.diva.exception.ProfileNotFoundException;
|
||||
import icu.samnyan.aqua.sega.diva.handler.BaseHandler;
|
||||
@@ -8,6 +7,7 @@ import icu.samnyan.aqua.sega.diva.model.request.ingame.StoreSsRequest;
|
||||
import icu.samnyan.aqua.sega.diva.model.response.BaseResponse;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerProfile;
|
||||
import icu.samnyan.aqua.sega.diva.model.userdata.PlayerScreenShot;
|
||||
import icu.samnyan.aqua.sega.diva.service.PlayerProfileService;
|
||||
import icu.samnyan.aqua.sega.diva.util.DivaMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -31,19 +31,19 @@ public class StoreSsHandler extends BaseHandler {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(StoreSsHandler.class);
|
||||
|
||||
private final PlayerProfileRepository profileRepository;
|
||||
private final PlayerProfileService playerProfileService;
|
||||
|
||||
private final PlayerScreenShotRepository screenShotRepository;
|
||||
|
||||
public StoreSsHandler(DivaMapper mapper, PlayerProfileRepository profileRepository, PlayerScreenShotRepository screenShotRepository) {
|
||||
public StoreSsHandler(DivaMapper mapper, PlayerProfileService playerProfileService, PlayerScreenShotRepository screenShotRepository) {
|
||||
super(mapper);
|
||||
this.profileRepository = profileRepository;
|
||||
this.playerProfileService = playerProfileService;
|
||||
this.screenShotRepository = screenShotRepository;
|
||||
}
|
||||
|
||||
|
||||
public String handle(StoreSsRequest request, MultipartFile file) {
|
||||
PlayerProfile profile = profileRepository.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
PlayerProfile profile = playerProfileService.findByPdId(request.getPd_id()).orElseThrow(ProfileNotFoundException::new);
|
||||
|
||||
BaseResponse response;
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,9 @@ import icu.samnyan.aqua.sega.diva.model.common.ChallengeKind;
|
||||
import icu.samnyan.aqua.sega.diva.model.common.ClearResult;
|
||||
import icu.samnyan.aqua.sega.diva.model.common.Difficulty;
|
||||
import icu.samnyan.aqua.sega.diva.model.common.Edition;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
@@ -17,6 +19,8 @@ import java.time.LocalDateTime;
|
||||
@Entity(name = "DivaPlayLog")
|
||||
@Table(name = "diva_play_log")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlayLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -110,9 +114,6 @@ public class PlayLog implements Serializable {
|
||||
|
||||
private LocalDateTime dateTime;
|
||||
|
||||
public PlayLog() {
|
||||
}
|
||||
|
||||
public PlayLog(PlayerProfile pdId, int pvId, Difficulty difficulty, Edition edition, int scriptVer, int score, ChallengeKind challengeKind, int challengeResult, ClearResult clearResult, int vp, int coolCount, int coolPercent, int fineCount, int finePercent, int safeCount, int safePercent, int sadCount, int sadPercent, int wrongCount, int wrongPercent, int maxCombo, int chanceTime, int holdScore, int attainPoint, int skinId, int buttonSe, int buttonSeVol, int sliderSe, int chainSlideSe, int sliderTouchSe, String modules, int stageCompletion, int slideScore, int isVocalChange, String customizeItems, String rhythmGameOptions, int screenShotCount, LocalDateTime dateTime) {
|
||||
this.pdId = pdId;
|
||||
this.pvId = pvId;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Optional;
|
||||
@Repository("SegaCardRepository")
|
||||
public interface CardRepository extends JpaRepository<Card, Long> {
|
||||
|
||||
Optional<Card> findByExtId(int extId);
|
||||
Optional<Card> findByExtId(Long extId);
|
||||
|
||||
Optional<Card> findByLuid(String luid);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Card implements Serializable {
|
||||
|
||||
// A external id
|
||||
@Column(name = "ext_id", unique = true)
|
||||
private Integer extId;
|
||||
private Long extId;
|
||||
|
||||
// Access Code
|
||||
@Column(unique = true)
|
||||
|
||||
@@ -24,6 +24,7 @@ public class PropertyEntry implements Serializable {
|
||||
@Column(unique = true)
|
||||
private String propertyKey;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String propertyValue;
|
||||
|
||||
public PropertyEntry(String propertyKey, String propertyValue) {
|
||||
|
||||
@@ -28,15 +28,16 @@ public class CardService {
|
||||
* @return Optional of a Card
|
||||
*/
|
||||
public Optional<Card> getCardByExtId(String extId) {
|
||||
return cardRepository.findByExtId(Integer.parseInt(extId));
|
||||
return cardRepository.findByExtId(Long.parseLong(extId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a card by External Id
|
||||
*
|
||||
* @param extId External Id
|
||||
* @return Optional of a Card
|
||||
*/
|
||||
public Optional<Card> getCardByExtId(int extId) {
|
||||
public Optional<Card> getCardByExtId(Long extId) {
|
||||
return cardRepository.findByExtId(extId);
|
||||
}
|
||||
|
||||
@@ -57,9 +58,9 @@ public class CardService {
|
||||
public Card registerByAccessCode(String accessCode) {
|
||||
Card card = new Card();
|
||||
card.setLuid(accessCode);
|
||||
int extId = ThreadLocalRandom.current().nextInt(99999999);
|
||||
long extId = ThreadLocalRandom.current().nextLong(99999999);
|
||||
while (cardRepository.findByExtId(extId).isPresent()) {
|
||||
extId = ThreadLocalRandom.current().nextInt(99999999);
|
||||
extId = ThreadLocalRandom.current().nextLong(99999999);
|
||||
}
|
||||
card.setExtId(extId);
|
||||
card.setRegisterTime(LocalDateTime.now());
|
||||
|
||||
@@ -15,11 +15,11 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserActivityRepository")
|
||||
public interface UserActivityRepository extends JpaRepository<UserActivity, Long> {
|
||||
|
||||
List<UserActivity> findByUser_Card_ExtId(int userId);
|
||||
List<UserActivity> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserActivity> findByUserAndKindAndActivityId(UserData userData, int kind, int activityId);
|
||||
|
||||
List<UserActivity> findByUser_Card_ExtIdAndKindOrderBySortNumberDesc(int userId, int kind);
|
||||
List<UserActivity> findByUser_Card_ExtIdAndKindOrderBySortNumberDesc(long userId, int kind);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserBossRepository")
|
||||
public interface UserBossRepository extends JpaRepository<UserBoss, Long> {
|
||||
|
||||
List<UserBoss> findByUser_Card_ExtId(int userId);
|
||||
List<UserBoss> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserBoss> findByUserAndMusicId(UserData user, int musicId);
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ public interface UserCardRepository extends JpaRepository<UserCard, Long> {
|
||||
|
||||
Optional<UserCard> findByUserAndCardId(UserData userData, int cardId);
|
||||
|
||||
Optional<UserCard> findByUser_Card_ExtIdAndCardId(int userId, int cardId);
|
||||
Optional<UserCard> findByUser_Card_ExtIdAndCardId(long userId, int cardId);
|
||||
|
||||
List<UserCard> findByUser_Card_ExtId(int userId);
|
||||
List<UserCard> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserCard> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserCard> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserChapterRepository")
|
||||
public interface UserChapterRepository extends JpaRepository<UserChapter, Long> {
|
||||
|
||||
List<UserChapter> findByUser_Card_ExtId(int userId);
|
||||
List<UserChapter> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserChapter> findByUserAndChapterId(UserData userData, int chapterId);
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserCharacterRepository")
|
||||
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
|
||||
|
||||
List<UserCharacter> findByUser_Card_ExtId(int userId);
|
||||
List<UserCharacter> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserCharacter> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserCharacter> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
Optional<UserCharacter> findByUserAndCharacterId(UserData userData, int characterId);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface UserDataRepository extends JpaRepository<UserData, Long> {
|
||||
|
||||
Optional<UserData> findByCard(Card card);
|
||||
|
||||
Optional<UserData> findByCard_ExtId(int aimeId);
|
||||
Optional<UserData> findByCard_ExtId(long aimeId);
|
||||
|
||||
@Transactional
|
||||
void deleteByCard(Card card);
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserDeckRepository")
|
||||
public interface UserDeckRepository extends JpaRepository<UserDeck, Long> {
|
||||
|
||||
List<UserDeck> findByUser_Card_ExtId(int userId);
|
||||
List<UserDeck> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserDeck> findByUserAndDeckId(UserData userData, int deckId);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserEventPointRepository")
|
||||
public interface UserEventPointRepository extends JpaRepository<UserEventPoint, Long> {
|
||||
|
||||
List<UserEventPoint> findByUser_Card_ExtId(int userId);
|
||||
List<UserEventPoint> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserEventPoint> findByUserAndEventId(UserData userData, int eventId);
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserGeneralDataRepository")
|
||||
public interface UserGeneralDataRepository extends JpaRepository<UserGeneralData, Long> {
|
||||
|
||||
List<UserGeneralData> findByUser_Card_ExtId(int userId);
|
||||
List<UserGeneralData> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserGeneralData> findByUserAndPropertyKey(UserData user, String key);
|
||||
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(int userId, String key);
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(long userId, String key);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -17,13 +17,13 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserItemRepository")
|
||||
public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
List<UserItem> findByUser_Card_ExtId(int userId);
|
||||
List<UserItem> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserItem> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
Optional<UserItem> findByUserAndItemKindAndItemId(UserData userData, int itemKind, int itemId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtIdAndItemKind(int userId, int kind, Pageable page);
|
||||
Page<UserItem> findByUser_Card_ExtIdAndItemKind(long userId, int kind, Pageable page);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Optional;
|
||||
*/
|
||||
public interface UserLoginBonusRepository extends JpaRepository<UserLoginBonus, Long> {
|
||||
|
||||
List<UserLoginBonus> findByUser_Card_ExtId(int userId);
|
||||
List<UserLoginBonus> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserLoginBonus> findByUserAndBonusId(UserData userData, int bonusId);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserMissionPointRepository")
|
||||
public interface UserMissionPointRepository extends JpaRepository<UserMissionPoint, Long> {
|
||||
|
||||
List<UserMissionPoint> findByUser_Card_ExtId(int userId);
|
||||
List<UserMissionPoint> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserMissionPoint> findByUserAndEventId(UserData userData, int eventId);
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserMusicDetailRepository")
|
||||
public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail, Long> {
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(int userId);
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(int userId, int id);
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(long userId, int id);
|
||||
|
||||
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserData userData, int musicId, int level);
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserMusicItemRepository")
|
||||
public interface UserMusicItemRepository extends JpaRepository<UserMusicItem, Long> {
|
||||
|
||||
List<UserMusicItem> findByUser_Card_ExtId(int aimeId);
|
||||
List<UserMusicItem> findByUser_Card_ExtId(long aimeId);
|
||||
|
||||
Page<UserMusicItem> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserMusicItem> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
Optional<UserMusicItem> findByUserAndMusicId(UserData userData, int musicId);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface UserOptionRepository extends JpaRepository<UserOption, Long> {
|
||||
|
||||
Optional<UserOption> findByUser(UserData userData);
|
||||
|
||||
Optional<UserOption> findByUser_Card_ExtId(int userId);
|
||||
Optional<UserOption> findByUser_Card_ExtId(long userId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -16,11 +16,11 @@ import java.util.List;
|
||||
@Repository("OngekiUserPlaylogRepository")
|
||||
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtId(int userId);
|
||||
List<UserPlaylog> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(int userId, Pageable page);
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(long userId, Pageable page);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(Integer userId, int musicId, int level);
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(long userId, int musicId, int level);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserScenarioRepository")
|
||||
public interface UserScenarioRepository extends JpaRepository<UserScenario, Long> {
|
||||
|
||||
List<UserScenario> findByUser_Card_ExtId(int userId);
|
||||
List<UserScenario> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserScenario> findByUserAndScenarioId(UserData user, int scenarioId);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserStoryRepository")
|
||||
public interface UserStoryRepository extends JpaRepository<UserStory, Long> {
|
||||
|
||||
List<UserStory> findByUser_Card_ExtId(int userId);
|
||||
List<UserStory> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserStory> findByUserAndStoryId(UserData userData, int storyId);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Optional;
|
||||
@Repository("OngekiUserTechCountRepository")
|
||||
public interface UserTechCountRepository extends JpaRepository<UserTechCount, Long> {
|
||||
|
||||
List<UserTechCount> findByUser_Card_ExtId(int userId);
|
||||
List<UserTechCount> findByUser_Card_ExtId(long userId);
|
||||
|
||||
Optional<UserTechCount> findByUserAndLevelId(UserData user, int levelId);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface UserTrainingRoomRepository extends JpaRepository<UserTrainingRo
|
||||
|
||||
Optional<UserTrainingRoom> findByUserAndRoomId(UserData user, int roomId);
|
||||
|
||||
List<UserTrainingRoom> findByUser_Card_ExtId(int userId);
|
||||
List<UserTrainingRoom> findByUser_Card_ExtId(long userId);
|
||||
|
||||
@Transactional
|
||||
void deleteByUser(UserData user);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserChapterHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserChapter> chapterList = userChapterRepository.findByUser_Card_ExtId(userId);
|
||||
Map<String, Object> resultMap = new LinkedHashMap<>();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserDataHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
Optional<UserData> userDataOptional = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserDeckByKeyHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserDeck> deckList = userDeckRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserEventPointHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserEventPoint> eventPointList = userEventPointRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GetUserEventRankingHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.0"));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserLoginBonusHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserLoginBonus> loginBonusList = userLoginBonusRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserMissionPointHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserMissionPoint> missionPointList = userMissionPointRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserOptionHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
Optional<UserData> userData = userDataRepository.findByCard_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserStoryHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserStory> userStoryList = userStoryRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GetUserTrainingRoomByKeyHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
|
||||
List<UserTrainingRoom> trainingRoomList = userTrainingRoomRepository.findByUser_Card_ExtId(userId);
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class UpsertUserAllHandler implements BaseHandler {
|
||||
|
||||
@Override
|
||||
public String handle(Map<String, Object> request) throws JsonProcessingException {
|
||||
Integer userId = (Integer) request.get("userId");
|
||||
Long userId = (Long) request.get("userId");
|
||||
UpsertUserAll upsertUserAll = mapper.convert(request.get("upsertUserAll"), UpsertUserAll.class);
|
||||
|
||||
// All the field should exist, no need to check now.
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
public class GetUserPreviewResp {
|
||||
|
||||
private Integer userId = 0;
|
||||
private long userId = 0;
|
||||
@JsonProperty("isLogin")
|
||||
private boolean isLogin = false;
|
||||
private String lastLoginDate = null;
|
||||
|
||||
@@ -33,6 +33,7 @@ public class UserGeneralData implements Serializable {
|
||||
|
||||
private String propertyKey;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String propertyValue;
|
||||
|
||||
public UserGeneralData(UserData userData, String key) {
|
||||
|
||||
@@ -31,10 +31,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLiteDialect
|
||||
#spring.datasource.url=jdbc:mariadb://localhost:3306/?useSSL=false
|
||||
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB10Dialect
|
||||
|
||||
## Game setting
|
||||
## CHUNITHM
|
||||
game.chunithm.overwrite-version=false
|
||||
game.chunithm.rom-version=1.30.00
|
||||
game.chunithm.data-version=1.30.00
|
||||
|
||||
## You can add any Spring Boot properties below
|
||||
Reference in New Issue
Block a user