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