[+] Maimai export

This commit is contained in:
Azalea
2024-03-17 00:12:02 -04:00
parent 0f1d6c0984
commit 25f5f6e1f7
6 changed files with 123 additions and 31 deletions

View File

@@ -11,6 +11,7 @@ import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.NoRepositoryBean
import org.springframework.stereotype.Component
import java.util.*
@@ -154,4 +155,37 @@ interface Chu3GameNamePlateRepo : JpaRepository<NamePlate, Long>
interface Chu3GameSystemVoiceRepo : JpaRepository<SystemVoice, Long>
interface Chu3GameTrophyRepo : JpaRepository<Trophy, Long>
interface Chu3GameTrophyRepo : JpaRepository<Trophy, Long>
@Component
class Chu3Repos(
val userLoginBonus: Chu3UserLoginBonusRepo,
val userActivity: Chu3UserActivityRepo,
val userCardPrintState: Chu3UserCardPrintStateRepo,
val userCharacter: Chu3UserCharacterRepo,
val userCharge: Chu3UserChargeRepo,
val userCourse: Chu3UserCourseRepo,
val userData: Chu3UserDataRepo,
val userDuel: Chu3UserDuelRepo,
val userGacha: Chu3UserGachaRepo,
val userGameOption: Chu3UserGameOptionRepo,
val userGeneralData: Chu3UserGeneralDataRepo,
val userItem: Chu3UserItemRepo,
val userMapArea: Chu3UserMapAreaRepo,
val userMusicDetail: Chu3UserMusicDetailRepo,
val userPlaylog: Chu3UserPlaylogRepo,
val gameAvatarAcc: Chu3GameAvatarAccRepo,
val gameCharacter: Chu3GameCharacterRepo,
val gameCharge: Chu3GameChargeRepo,
val gameEvent: Chu3GameEventRepo,
val gameFrame: Chu3GameFrameRepo,
val gameGachaCard: Chu3GameGachaCardRepo,
val gameGacha: Chu3GameGachaRepo,
val gameLoginBonusPresets: Chu3GameLoginBonusPresetsRepo,
val gameLoginBonus: Chu3GameLoginBonusRepo,
val gameMapIcon: Chu3GameMapIconRepo,
val gameMusic: Chu3GameMusicRepo,
val gameNamePlate: Chu3GameNamePlateRepo,
val gameSystemVoice: Chu3GameSystemVoiceRepo,
val gameTrophy: Chu3GameTrophyRepo
)

View File

@@ -103,7 +103,7 @@ public class UpsertUserAllHandler implements BaseHandler {
if (userAll.getUserExtend() != null) {
UserExtend newUserExtend = userAll.getUserExtend().get(0);
Optional<UserExtend> userExtendOptional = userExtendRepository.findByUser(newUserData);
Optional<UserExtend> userExtendOptional = userExtendRepository.findSingleByUser(newUserData);
UserExtend userExtend = userExtendOptional.orElseGet(() -> new UserExtend(newUserData));
newUserExtend.setId(userExtend.getId());
@@ -116,7 +116,7 @@ public class UpsertUserAllHandler implements BaseHandler {
if (userAll.getUserOption() != null) {
UserOption newUserOption = userAll.getUserOption().get(0);
Optional<UserOption> userOptionOptional = userOptionRepository.findByUser(newUserData);
Optional<UserOption> userOptionOptional = userOptionRepository.findSingleByUser(newUserData);
UserOption userOption = userOptionOptional.orElseGet(() -> new UserOption(newUserData));
newUserOption.setId(userOption.getId());
@@ -185,7 +185,7 @@ public class UpsertUserAllHandler implements BaseHandler {
//Udemae
UserUdemae newUserUdemae = userRating.getUdemae();
Optional<UserUdemae> udemaeOptional = userUdemaeRepository.findByUser(newUserData);
Optional<UserUdemae> udemaeOptional = userUdemaeRepository.findSingleByUser(newUserData);
UserUdemae userUdemae = udemaeOptional.orElseGet(() -> new UserUdemae(newUserData));
newUserUdemae.setId(userUdemae.getId());

View File

@@ -13,12 +13,14 @@ import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.repository.NoRepositoryBean
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
import java.util.*
@NoRepositoryBean
interface UserLinked<T>: JpaRepository<T, Long> {
fun findByUser(user: UserDetail): Optional<T>
fun findByUser(user: UserDetail): List<T>
fun findSingleByUser(user: UserDetail): Optional<T>
fun findByUser_Card_ExtId(userId: Long): List<T>
fun findByUser_Card_ExtId(userId: Long, page: Pageable): Page<T>
fun findSingleByUser_Card_ExtId(userId: Long): Optional<T>
@@ -109,4 +111,30 @@ interface Mai2GameEventRepo : JpaRepository<GameEvent, Int> {
fun findByTypeAndEnable(type: Int, enable: Boolean): List<GameEvent>
}
interface Mai2GameSellingCardRepo : JpaRepository<GameSellingCard, Long>
interface Mai2GameSellingCardRepo : JpaRepository<GameSellingCard, Long>
@Component
class Mai2Repos(
val mapEncountNpc: Mai2MapEncountNpcRepo,
val userAct: Mai2UserActRepo,
val userCard: Mai2UserCardRepo,
val userCharacter: Mai2UserCharacterRepo,
val userCharge: Mai2UserChargeRepo,
val userCourse: Mai2UserCourseRepo,
val userData: Mai2UserDataRepo,
val userExtend: Mai2UserExtendRepo,
val userFavorite: Mai2UserFavoriteRepo,
val userFriendSeasonRanking: Mai2UserFriendSeasonRankingRepo,
val userGeneralData: Mai2UserGeneralDataRepo,
val userItem: Mai2UserItemRepo,
val userLoginBonus: Mai2UserLoginBonusRepo,
val userMap: Mai2UserMapRepo,
val userMusicDetail: Mai2UserMusicDetailRepo,
val userOption: Mai2UserOptionRepo,
val userPlaylog: Mai2UserPlaylogRepo,
val userPrintDetail: Mai2UserPrintDetailRepo,
val userUdemae: Mai2UserUdemaeRepo,
val gameCharge: Mai2GameChargeRepo,
val gameEvent: Mai2GameEventRepo,
val gameSellingCard: Mai2GameSellingCardRepo
)