mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix duplicate uploads
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…
Reference in New Issue