forked from Cookies_Github_mirror/AquaDX
[general] Fix all type mismatch with db
This commit is contained in:
@@ -16,7 +16,7 @@ public interface UserActivityRepository extends JpaRepository<UserActivity, Long
|
||||
|
||||
Optional<UserActivity> findTopByUserAndActivityIdAndKindOrderByIdDesc(UserData user, int activityId, int kind);
|
||||
|
||||
List<UserActivity> findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(int extId, int kind);
|
||||
List<UserActivity> findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Long extId, int kind);
|
||||
|
||||
List<UserActivity> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserActivity> findAllByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ import java.util.Optional;
|
||||
@Repository
|
||||
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
|
||||
|
||||
Page<UserCharacter> findByUser_Card_ExtId(int extId, Pageable pageable);
|
||||
Page<UserCharacter> findByUser_Card_ExtId(Long extId, Pageable pageable);
|
||||
|
||||
List<UserCharacter> findByUser_Card_ExtId(int extId);
|
||||
List<UserCharacter> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserCharacter> findTopByUserAndCharacterIdOrderByIdDesc(UserData user, int characterId);
|
||||
|
||||
Optional<UserCharacter> findByUser_Card_ExtIdAndCharacterId(int extId, int characterId);
|
||||
Optional<UserCharacter> findByUser_Card_ExtIdAndCharacterId(Long extId, int characterId);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Optional;
|
||||
*/
|
||||
@Repository
|
||||
public interface UserChargeRepository extends JpaRepository<UserCharge, Long> {
|
||||
List<UserCharge> findByUser_Card_ExtId(int extId);
|
||||
List<UserCharge> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserCharge> findByUserAndChargeId(UserData extId, int chargeId);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Optional;
|
||||
public interface UserCourseRepository extends JpaRepository<UserCourse, Long> {
|
||||
Optional<UserCourse> findTopByUserAndCourseIdOrderByIdDesc(UserData user, int courseId);
|
||||
|
||||
Page<UserCourse> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserCourse> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
|
||||
List<UserCourse> findByUser_Card_ExtId(int extId);
|
||||
List<UserCourse> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserDataExRepository extends JpaRepository<UserDataEx, Long> {
|
||||
|
||||
Optional<UserDataEx> findByUser(UserData user);
|
||||
|
||||
Optional<UserDataEx> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserDataEx> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserDataRepository extends JpaRepository<UserData, Long> {
|
||||
|
||||
Optional<UserData> findByCard(Card card);
|
||||
|
||||
Optional<UserData> findByCard_ExtId(int extId);
|
||||
Optional<UserData> findByCard_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ public interface UserDuelRepository extends JpaRepository<UserDuel, Long> {
|
||||
|
||||
Optional<UserDuel> findTopByUserAndDuelIdOrderByIdDesc(UserData user, int duelId);
|
||||
|
||||
List<UserDuel> findByUser_Card_ExtId(int extId);
|
||||
List<UserDuel> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ import java.util.Optional;
|
||||
public interface UserGameOptionExRepository extends JpaRepository<UserGameOptionEx, Long> {
|
||||
Optional<UserGameOptionEx> findByUser(UserData user);
|
||||
|
||||
Optional<UserGameOptionEx> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserGameOptionEx> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,5 +15,5 @@ public interface UserGameOptionRepository extends JpaRepository<UserGameOption,
|
||||
|
||||
Optional<UserGameOption> findByUser(UserData user);
|
||||
|
||||
Optional<UserGameOption> findByUser_Card_ExtId(int extId);
|
||||
Optional<UserGameOption> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ public interface UserGeneralDataRepository extends JpaRepository<UserGeneralData
|
||||
|
||||
Optional<UserGeneralData> findByUserAndPropertyKey(UserData user, String key);
|
||||
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(int extId, String key);
|
||||
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(Long extId, String key);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package icu.samnyan.aqua.sega.chunithm.dao.userdata;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserItem;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -19,9 +18,9 @@ public interface UserItemRepository extends JpaRepository<UserItem, Long> {
|
||||
|
||||
Optional<UserItem> findTopByUserAndItemIdAndItemKindOrderByIdDesc(UserData user, int itemId, int itemKind);
|
||||
|
||||
Page<UserItem> findAllByUser_Card_ExtIdAndItemKind(int extId, int itemKind, Pageable pageable);
|
||||
Page<UserItem> findAllByUser_Card_ExtIdAndItemKind(Long extId, int itemKind, Pageable pageable);
|
||||
|
||||
List<UserItem> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserItem> findAllByUser_Card_ExtId(Long extId);
|
||||
|
||||
Page<UserItem> findByUser_Card_ExtId(int extId, Pageable pageable);
|
||||
Page<UserItem> findByUser_Card_ExtId(Long extId, Pageable pageable);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
public interface UserMapRepository extends JpaRepository<UserMap, Long> {
|
||||
List<UserMap> findAllByUser(UserData user);
|
||||
|
||||
List<UserMap> findAllByUser_Card_ExtId(int extId);
|
||||
List<UserMap> findAllByUser_Card_ExtId(Long extId);
|
||||
|
||||
Optional<UserMap> findTopByUserAndMapIdOrderByIdDesc(UserData user, int mapId);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail
|
||||
|
||||
Optional<UserMusicDetail> findTopByUserAndMusicIdAndLevelOrderByIdDesc(UserData user, int musicId, int level);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(int extId);
|
||||
List<UserMusicDetail> findByUser_Card_ExtId(Long extId);
|
||||
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(int extId, int musicId);
|
||||
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(Long extId, int musicId);
|
||||
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserMusicDetail> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ import java.util.List;
|
||||
*/
|
||||
@Repository
|
||||
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndLevelNot(int extId, int levelNot, Pageable page);
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndLevelNot(Long extId, int levelNot, Pageable page);
|
||||
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(int extId, Pageable page);
|
||||
Page<UserPlaylog> findByUser_Card_ExtId(Long extId, Pageable page);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(int extId, int musicId, int level);
|
||||
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(Long extId, int musicId, int level);
|
||||
|
||||
List<UserPlaylog> findByUser_Card_ExtId(int extId);
|
||||
List<UserPlaylog> findByUser_Card_ExtId(Long extId);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ package icu.samnyan.aqua.sega.chunithm.handler.impl;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import icu.samnyan.aqua.sega.chunithm.handler.BaseHandler;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserDataService;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.util.VersionUtil;
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -33,23 +32,13 @@ public class GetUserDataHandler implements BaseHandler {
|
||||
|
||||
private final UserDataService userDataService;
|
||||
|
||||
private final boolean overwriteVersion;
|
||||
private final String romVersion;
|
||||
private final String dataVersion;
|
||||
|
||||
@Autowired
|
||||
public GetUserDataHandler(StringMapper mapper,
|
||||
ClientSettingService clientSettingService, UserDataService userDataService,
|
||||
@Value("${game.chunithm.overwrite-version}") boolean overwriteVersion,
|
||||
@Value("${game.chunithm.rom-version}") String romVersion,
|
||||
@Value("${game.chunithm.data-version}") String dataVersion
|
||||
ClientSettingService clientSettingService, UserDataService userDataService
|
||||
) {
|
||||
this.mapper = mapper;
|
||||
this.clientSettingService = clientSettingService;
|
||||
this.userDataService = userDataService;
|
||||
this.overwriteVersion = overwriteVersion;
|
||||
this.romVersion = romVersion;
|
||||
this.dataVersion = dataVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,16 +6,15 @@ import icu.samnyan.aqua.sega.chunithm.model.response.GetUserPreviewResp;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserCharacter;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserGameOption;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserCharacterService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserDataService;
|
||||
import icu.samnyan.aqua.sega.chunithm.service.UserGameOptionService;
|
||||
import icu.samnyan.aqua.sega.general.service.ClientSettingService;
|
||||
import icu.samnyan.aqua.sega.util.VersionUtil;
|
||||
import icu.samnyan.aqua.sega.util.jackson.StringMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -43,27 +42,17 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
private final UserCharacterService userCharacterService;
|
||||
private final UserGameOptionService userGameOptionService;
|
||||
|
||||
private final boolean overwriteVersion;
|
||||
private final String romVersion;
|
||||
private final String dataVersion;
|
||||
|
||||
@Autowired
|
||||
public GetUserPreviewHandler(StringMapper mapper,
|
||||
ClientSettingService clientSettingService, UserDataService userDataService,
|
||||
UserCharacterService userCharacterService,
|
||||
UserGameOptionService userGameOptionService,
|
||||
@Value("${game.chunithm.overwrite-version}") boolean overwriteVersion,
|
||||
@Value("${game.chunithm.rom-version}") String romVersion,
|
||||
@Value("${game.chunithm.data-version}") String dataVersion
|
||||
UserGameOptionService userGameOptionService
|
||||
) {
|
||||
this.mapper = mapper;
|
||||
this.clientSettingService = clientSettingService;
|
||||
this.userDataService = userDataService;
|
||||
this.userCharacterService = userCharacterService;
|
||||
this.userGameOptionService = userGameOptionService;
|
||||
this.overwriteVersion = overwriteVersion;
|
||||
this.romVersion = romVersion;
|
||||
this.dataVersion = dataVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,10 +90,6 @@ public class GetUserPreviewHandler implements BaseHandler {
|
||||
resp.setLastDataVersion(user.getLastDataVersion());
|
||||
}
|
||||
|
||||
if (overwriteVersion) {
|
||||
resp.setLastRomVersion(romVersion);
|
||||
resp.setLastDataVersion(dataVersion);
|
||||
}
|
||||
resp.setLastPlayDate(user.getLastPlayDate());
|
||||
resp.setTrophyId(user.getTrophyId());
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package icu.samnyan.aqua.sega.chunithm.model.gamedata;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
@@ -29,7 +32,7 @@ public class Character implements Serializable {
|
||||
|
||||
private String illustratorName;
|
||||
|
||||
private Integer firstSkillId;
|
||||
private String firstSkillId;
|
||||
|
||||
// Format: level:skillId,level:skillId
|
||||
// Keep 0 skillId
|
||||
|
||||
@@ -33,6 +33,7 @@ public class UserGeneralData implements Serializable {
|
||||
|
||||
private String propertyKey;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String propertyValue;
|
||||
|
||||
public UserGeneralData(UserData userData, String key) {
|
||||
|
||||
@@ -35,10 +35,10 @@ public class UserActivityService {
|
||||
}
|
||||
|
||||
public List<UserActivity> getAllByUserIdAndKind(String userId, String kind) {
|
||||
return userActivityRepository.findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Integer.parseInt(userId), Integer.parseInt(kind));
|
||||
return userActivityRepository.findAllByUser_Card_ExtIdAndKindOrderBySortNumberDesc(Long.parseLong(userId), Integer.parseInt(kind));
|
||||
}
|
||||
|
||||
public List<UserActivity> getByUserId(String userId) {
|
||||
return userActivityRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userActivityRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ public class UserCharacterService {
|
||||
}
|
||||
|
||||
public List<UserCharacter> getByUserId(String userId) {
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserCharacter> getByUserId(String userId, int pageNumber, int maxCount) {
|
||||
Pageable pageable = PageRequest.of(pageNumber, maxCount);
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Integer.parseInt(userId), pageable);
|
||||
return userCharacterRepository.findByUser_Card_ExtId(Long.parseLong(userId), pageable);
|
||||
}
|
||||
|
||||
public Optional<UserCharacter> getByUserAndCharacterId(UserData user, int characterId) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class UserChargeService {
|
||||
}
|
||||
|
||||
public List<UserCharge> getByUserId(String userId) {
|
||||
return userChargeRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userChargeRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserCharge> getByUserAndChargeId(UserData user, int chargeId) {
|
||||
|
||||
@@ -34,12 +34,12 @@ public class UserCourseService {
|
||||
}
|
||||
|
||||
public List<UserCourse> getByUserId(String userId) {
|
||||
return userCourseRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userCourseRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserCourse> getByUserId(String userId, int pageNum, int maxCount) {
|
||||
Pageable page = PageRequest.of(pageNum, maxCount);
|
||||
return userCourseRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userCourseRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public Optional<UserCourse> getByUserAndCourseId(UserData user, int courseId) {
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserDataExService {
|
||||
}
|
||||
|
||||
public Optional<UserDataEx> getByExtId(String userId) {
|
||||
return userDataExRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userDataExRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class UserDataService {
|
||||
}
|
||||
|
||||
public Optional<UserData> getUserByExtId(String aimeId) {
|
||||
return userDataRepository.findByCard_ExtId(Integer.parseInt(aimeId));
|
||||
return userDataRepository.findByCard_ExtId(Long.parseLong(aimeId));
|
||||
}
|
||||
|
||||
public Optional<UserData> getUserByCard(Card card) {
|
||||
|
||||
@@ -35,6 +35,6 @@ public class UserDuelService {
|
||||
}
|
||||
|
||||
public List<UserDuel> getByUserId(String userId) {
|
||||
return userDuelRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userDuelRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserGameOptionExService {
|
||||
}
|
||||
|
||||
public Optional<UserGameOptionEx> getByUserId(String userId) {
|
||||
return userGameOptionExRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userGameOptionExRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class UserGameOptionService {
|
||||
}
|
||||
|
||||
public Optional<UserGameOption> getByUserId(String userId) {
|
||||
return userGameOptionRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userGameOptionRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UserGeneralDataService {
|
||||
}
|
||||
|
||||
public Optional<UserGeneralData> getByUserIdAndKey(String userId, String key) {
|
||||
return userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(Integer.parseInt(userId), key);
|
||||
return userGeneralDataRepository.findByUser_Card_ExtIdAndPropertyKey(Long.parseLong(userId), key);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class UserItemService {
|
||||
}
|
||||
|
||||
public List<UserItem> getByUserId(String userId) {
|
||||
return userItemRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userItemRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserItem> getByUserAndItemIdAndKind(UserData user, int itemId, int itemKind) {
|
||||
@@ -42,10 +42,10 @@ public class UserItemService {
|
||||
|
||||
public Page<UserItem> getByUserAndItemKind(String userId, int kind, int pageNumber, int maxCount) {
|
||||
Pageable page = PageRequest.of(pageNumber, maxCount);
|
||||
return userItemRepository.findAllByUser_Card_ExtIdAndItemKind(Integer.parseInt(userId), kind, page);
|
||||
return userItemRepository.findAllByUser_Card_ExtIdAndItemKind(Long.parseLong(userId), kind, page);
|
||||
}
|
||||
|
||||
public Page<UserItem> getByUserId(String userId, int page, int size) {
|
||||
return userItemRepository.findByUser_Card_ExtId(Integer.parseInt(userId), PageRequest.of(page, size));
|
||||
return userItemRepository.findByUser_Card_ExtId(Long.parseLong(userId), PageRequest.of(page, size));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class UserMapService {
|
||||
}
|
||||
|
||||
public List<UserMap> getByUserId(String userId) {
|
||||
return userMapRepository.findAllByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userMapRepository.findAllByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Optional<UserMap> getByUserAndMapId(UserData user, int mapId) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import icu.samnyan.aqua.sega.chunithm.model.userdata.UserData;
|
||||
import icu.samnyan.aqua.sega.chunithm.model.userdata.UserMusicDetail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -34,15 +33,15 @@ public class UserMusicDetailService {
|
||||
}
|
||||
|
||||
public List<UserMusicDetail> getByUserId(String userId) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public Page<UserMusicDetail> getByUserId(String userId, Pageable page) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userMusicDetailRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public List<UserMusicDetail> getByUserIdAndMusicId(String userId, int musicId) {
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(Integer.parseInt(userId), musicId);
|
||||
return userMusicDetailRepository.findByUser_Card_ExtIdAndMusicId(Long.parseLong(userId), musicId);
|
||||
}
|
||||
|
||||
public Optional<UserMusicDetail> getByUserAndMusicIdAndLevel(UserData user, int musicId, int level) {
|
||||
|
||||
@@ -33,19 +33,19 @@ public class UserPlaylogService {
|
||||
}
|
||||
|
||||
public Page<UserPlaylog> getRecentPlays(String userId, Pageable page) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Integer.parseInt(userId), page);
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Long.parseLong(userId), page);
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getRecent30Plays(String userId) {
|
||||
Pageable page = PageRequest.of(0, 30, Sort.by(Sort.Direction.DESC, "userPlayDate"));
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndLevelNot(Integer.parseInt(userId), 4, page);
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndLevelNot(Long.parseLong(userId), 4, page);
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getByUserId(String userId) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Integer.parseInt(userId));
|
||||
return userPlaylogRepository.findByUser_Card_ExtId(Long.parseLong(userId));
|
||||
}
|
||||
|
||||
public List<UserPlaylog> getByUserIdAndMusicIdAndLevel(String userId, int id, int level) {
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(Integer.parseInt(userId), id, level);
|
||||
return userPlaylogRepository.findByUser_Card_ExtIdAndMusicIdAndLevel(Long.parseLong(userId), id, level);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user