[general] Fix all type mismatch with db

This commit is contained in:
samnyan
2020-12-25 14:15:04 +08:00
parent 6152e8ef0a
commit ff5eab48c7
78 changed files with 165 additions and 190 deletions

View File

@@ -15,11 +15,11 @@ import java.util.Optional;
@Repository("OngekiUserActivityRepository")
public interface UserActivityRepository extends JpaRepository<UserActivity, Long> {
List<UserActivity> findByUser_Card_ExtId(int userId);
List<UserActivity> findByUser_Card_ExtId(long userId);
Optional<UserActivity> findByUserAndKindAndActivityId(UserData userData, int kind, int activityId);
List<UserActivity> findByUser_Card_ExtIdAndKindOrderBySortNumberDesc(int userId, int kind);
List<UserActivity> findByUser_Card_ExtIdAndKindOrderBySortNumberDesc(long userId, int kind);
@Transactional
void deleteByUser(UserData user);

View File

@@ -14,7 +14,7 @@ import java.util.Optional;
@Repository("OngekiUserBossRepository")
public interface UserBossRepository extends JpaRepository<UserBoss, Long> {
List<UserBoss> findByUser_Card_ExtId(int userId);
List<UserBoss> findByUser_Card_ExtId(long userId);
Optional<UserBoss> findByUserAndMusicId(UserData user, int musicId);

View File

@@ -19,11 +19,11 @@ public interface UserCardRepository extends JpaRepository<UserCard, Long> {
Optional<UserCard> findByUserAndCardId(UserData userData, int cardId);
Optional<UserCard> findByUser_Card_ExtIdAndCardId(int userId, int cardId);
Optional<UserCard> findByUser_Card_ExtIdAndCardId(long userId, int cardId);
List<UserCard> findByUser_Card_ExtId(int userId);
List<UserCard> findByUser_Card_ExtId(long userId);
Page<UserCard> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserCard> findByUser_Card_ExtId(long userId, Pageable page);
@Transactional
void deleteByUser(UserData user);

View File

@@ -15,7 +15,7 @@ import java.util.Optional;
@Repository("OngekiUserChapterRepository")
public interface UserChapterRepository extends JpaRepository<UserChapter, Long> {
List<UserChapter> findByUser_Card_ExtId(int userId);
List<UserChapter> findByUser_Card_ExtId(long userId);
Optional<UserChapter> findByUserAndChapterId(UserData userData, int chapterId);

View File

@@ -17,9 +17,9 @@ import java.util.Optional;
@Repository("OngekiUserCharacterRepository")
public interface UserCharacterRepository extends JpaRepository<UserCharacter, Long> {
List<UserCharacter> findByUser_Card_ExtId(int userId);
List<UserCharacter> findByUser_Card_ExtId(long userId);
Page<UserCharacter> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserCharacter> findByUser_Card_ExtId(long userId, Pageable page);
Optional<UserCharacter> findByUserAndCharacterId(UserData userData, int characterId);

View File

@@ -16,7 +16,7 @@ public interface UserDataRepository extends JpaRepository<UserData, Long> {
Optional<UserData> findByCard(Card card);
Optional<UserData> findByCard_ExtId(int aimeId);
Optional<UserData> findByCard_ExtId(long aimeId);
@Transactional
void deleteByCard(Card card);

View File

@@ -15,7 +15,7 @@ import java.util.Optional;
@Repository("OngekiUserDeckRepository")
public interface UserDeckRepository extends JpaRepository<UserDeck, Long> {
List<UserDeck> findByUser_Card_ExtId(int userId);
List<UserDeck> findByUser_Card_ExtId(long userId);
Optional<UserDeck> findByUserAndDeckId(UserData userData, int deckId);

View File

@@ -15,7 +15,7 @@ import java.util.Optional;
@Repository("OngekiUserEventPointRepository")
public interface UserEventPointRepository extends JpaRepository<UserEventPoint, Long> {
List<UserEventPoint> findByUser_Card_ExtId(int userId);
List<UserEventPoint> findByUser_Card_ExtId(long userId);
Optional<UserEventPoint> findByUserAndEventId(UserData userData, int eventId);

View File

@@ -15,11 +15,11 @@ import java.util.Optional;
@Repository("OngekiUserGeneralDataRepository")
public interface UserGeneralDataRepository extends JpaRepository<UserGeneralData, Long> {
List<UserGeneralData> findByUser_Card_ExtId(int userId);
List<UserGeneralData> findByUser_Card_ExtId(long userId);
Optional<UserGeneralData> findByUserAndPropertyKey(UserData user, String key);
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(int userId, String key);
Optional<UserGeneralData> findByUser_Card_ExtIdAndPropertyKey(long userId, String key);
@Transactional
void deleteByUser(UserData user);

View File

@@ -17,13 +17,13 @@ import java.util.Optional;
@Repository("OngekiUserItemRepository")
public interface UserItemRepository extends JpaRepository<UserItem, Long> {
List<UserItem> findByUser_Card_ExtId(int userId);
List<UserItem> findByUser_Card_ExtId(long userId);
Page<UserItem> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserItem> findByUser_Card_ExtId(long userId, Pageable page);
Optional<UserItem> findByUserAndItemKindAndItemId(UserData userData, int itemKind, int itemId);
Page<UserItem> findByUser_Card_ExtIdAndItemKind(int userId, int kind, Pageable page);
Page<UserItem> findByUser_Card_ExtIdAndItemKind(long userId, int kind, Pageable page);
@Transactional
void deleteByUser(UserData user);

View File

@@ -13,7 +13,7 @@ import java.util.Optional;
*/
public interface UserLoginBonusRepository extends JpaRepository<UserLoginBonus, Long> {
List<UserLoginBonus> findByUser_Card_ExtId(int userId);
List<UserLoginBonus> findByUser_Card_ExtId(long userId);
Optional<UserLoginBonus> findByUserAndBonusId(UserData userData, int bonusId);

View File

@@ -15,7 +15,7 @@ import java.util.Optional;
@Repository("OngekiUserMissionPointRepository")
public interface UserMissionPointRepository extends JpaRepository<UserMissionPoint, Long> {
List<UserMissionPoint> findByUser_Card_ExtId(int userId);
List<UserMissionPoint> findByUser_Card_ExtId(long userId);
Optional<UserMissionPoint> findByUserAndEventId(UserData userData, int eventId);

View File

@@ -17,11 +17,11 @@ import java.util.Optional;
@Repository("OngekiUserMusicDetailRepository")
public interface UserMusicDetailRepository extends JpaRepository<UserMusicDetail, Long> {
List<UserMusicDetail> findByUser_Card_ExtId(int userId);
List<UserMusicDetail> findByUser_Card_ExtId(long userId);
Page<UserMusicDetail> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserMusicDetail> findByUser_Card_ExtId(long userId, Pageable page);
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(int userId, int id);
List<UserMusicDetail> findByUser_Card_ExtIdAndMusicId(long userId, int id);
Optional<UserMusicDetail> findByUserAndMusicIdAndLevel(UserData userData, int musicId, int level);

View File

@@ -17,9 +17,9 @@ import java.util.Optional;
@Repository("OngekiUserMusicItemRepository")
public interface UserMusicItemRepository extends JpaRepository<UserMusicItem, Long> {
List<UserMusicItem> findByUser_Card_ExtId(int aimeId);
List<UserMusicItem> findByUser_Card_ExtId(long aimeId);
Page<UserMusicItem> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserMusicItem> findByUser_Card_ExtId(long userId, Pageable page);
Optional<UserMusicItem> findByUserAndMusicId(UserData userData, int musicId);

View File

@@ -16,7 +16,7 @@ public interface UserOptionRepository extends JpaRepository<UserOption, Long> {
Optional<UserOption> findByUser(UserData userData);
Optional<UserOption> findByUser_Card_ExtId(int userId);
Optional<UserOption> findByUser_Card_ExtId(long userId);
@Transactional
void deleteByUser(UserData user);

View File

@@ -16,11 +16,11 @@ import java.util.List;
@Repository("OngekiUserPlaylogRepository")
public interface UserPlaylogRepository extends JpaRepository<UserPlaylog, Long> {
List<UserPlaylog> findByUser_Card_ExtId(int userId);
List<UserPlaylog> findByUser_Card_ExtId(long userId);
Page<UserPlaylog> findByUser_Card_ExtId(int userId, Pageable page);
Page<UserPlaylog> findByUser_Card_ExtId(long userId, Pageable page);
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(Integer userId, int musicId, int level);
List<UserPlaylog> findByUser_Card_ExtIdAndMusicIdAndLevel(long userId, int musicId, int level);
@Transactional
void deleteByUser(UserData user);

View File

@@ -14,7 +14,7 @@ import java.util.Optional;
@Repository("OngekiUserScenarioRepository")
public interface UserScenarioRepository extends JpaRepository<UserScenario, Long> {
List<UserScenario> findByUser_Card_ExtId(int userId);
List<UserScenario> findByUser_Card_ExtId(long userId);
Optional<UserScenario> findByUserAndScenarioId(UserData user, int scenarioId);

View File

@@ -15,7 +15,7 @@ import java.util.Optional;
@Repository("OngekiUserStoryRepository")
public interface UserStoryRepository extends JpaRepository<UserStory, Long> {
List<UserStory> findByUser_Card_ExtId(int userId);
List<UserStory> findByUser_Card_ExtId(long userId);
Optional<UserStory> findByUserAndStoryId(UserData userData, int storyId);

View File

@@ -14,7 +14,7 @@ import java.util.Optional;
@Repository("OngekiUserTechCountRepository")
public interface UserTechCountRepository extends JpaRepository<UserTechCount, Long> {
List<UserTechCount> findByUser_Card_ExtId(int userId);
List<UserTechCount> findByUser_Card_ExtId(long userId);
Optional<UserTechCount> findByUserAndLevelId(UserData user, int levelId);

View File

@@ -17,7 +17,7 @@ public interface UserTrainingRoomRepository extends JpaRepository<UserTrainingRo
Optional<UserTrainingRoom> findByUserAndRoomId(UserData user, int roomId);
List<UserTrainingRoom> findByUser_Card_ExtId(int userId);
List<UserTrainingRoom> findByUser_Card_ExtId(long userId);
@Transactional
void deleteByUser(UserData user);

View File

@@ -35,7 +35,7 @@ public class GetUserChapterHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserChapter> chapterList = userChapterRepository.findByUser_Card_ExtId(userId);
Map<String, Object> resultMap = new LinkedHashMap<>();

View File

@@ -35,7 +35,7 @@ public class GetUserDataHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
Optional<UserData> userDataOptional = userDataRepository.findByCard_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserDeckByKeyHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserDeck> deckList = userDeckRepository.findByUser_Card_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserEventPointHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserEventPoint> eventPointList = userEventPointRepository.findByUser_Card_ExtId(userId);

View File

@@ -39,7 +39,7 @@ public class GetUserEventRankingHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.0"));

View File

@@ -35,7 +35,7 @@ public class GetUserLoginBonusHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserLoginBonus> loginBonusList = userLoginBonusRepository.findByUser_Card_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserMissionPointHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserMissionPoint> missionPointList = userMissionPointRepository.findByUser_Card_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserOptionHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser_Card_ExtId(userId);

View File

@@ -43,7 +43,7 @@ public class GetUserPreviewHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
Optional<UserData> userData = userDataRepository.findByCard_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserStoryHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserStory> userStoryList = userStoryRepository.findByUser_Card_ExtId(userId);

View File

@@ -35,7 +35,7 @@ public class GetUserTrainingRoomByKeyHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
List<UserTrainingRoom> trainingRoomList = userTrainingRoomRepository.findByUser_Card_ExtId(userId);

View File

@@ -83,7 +83,7 @@ public class UpsertUserAllHandler implements BaseHandler {
@Override
public String handle(Map<String, Object> request) throws JsonProcessingException {
Integer userId = (Integer) request.get("userId");
Long userId = (Long) request.get("userId");
UpsertUserAll upsertUserAll = mapper.convert(request.get("upsertUserAll"), UpsertUserAll.class);
// All the field should exist, no need to check now.

View File

@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class GetUserPreviewResp {
private Integer userId = 0;
private long userId = 0;
@JsonProperty("isLogin")
private boolean isLogin = false;
private String lastLoginDate = null;

View File

@@ -33,6 +33,7 @@ public class UserGeneralData implements Serializable {
private String propertyKey;
@Column(columnDefinition = "TEXT")
private String propertyValue;
public UserGeneralData(UserData userData, String key) {