mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-26 04:22:38 +00:00
[F] Fix duplicate uploads
This commit is contained in:
parent
762f0ef445
commit
1421d55a56
@ -43,6 +43,14 @@ class UploadUserPlaylogHandler(
|
||||
).increment()
|
||||
}
|
||||
|
||||
// Check duplicate
|
||||
val isDup = playlogRepo.findByUser_Card_ExtIdAndMusicIdAndUserPlayDate(
|
||||
req.userId,
|
||||
req.userPlaylog.musicId,
|
||||
req.userPlaylog.userPlayDate
|
||||
).size > 0
|
||||
if (isDup) return """{"returnCode":1,"apiName":"com.sega.maimai2servlet.api.UploadUserPlaylogApi"}"""
|
||||
|
||||
// Save if the user is registered
|
||||
val u = userDataRepository.findByCardExtId(req.userId).getOrNull()
|
||||
if (u != null) playlogRepo.save(req.userPlaylog.apply { user = u })
|
||||
|
||||
@ -99,6 +99,11 @@ interface Mai2UserOptionRepo : Mai2UserLinked<Mai2UserOption>
|
||||
|
||||
interface Mai2UserPlaylogRepo : GenericPlaylogRepo<Mai2UserPlaylog>, Mai2UserLinked<Mai2UserPlaylog> {
|
||||
fun findByUser_Card_ExtIdAndMusicIdAndLevel(userId: Long, musicId: Int, level: Int): List<Mai2UserPlaylog>
|
||||
fun findByUser_Card_ExtIdAndMusicIdAndUserPlayDate(
|
||||
userCardExtId: Long,
|
||||
musicId: Int,
|
||||
userPlayDate: String
|
||||
): MutableList<Mai2UserPlaylog>
|
||||
}
|
||||
|
||||
interface Mai2UserPrintDetailRepo : JpaRepository<Mai2UserPrintDetail, Long>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user