mirror of https://github.com/hykilpikonna/AquaDX
[+] Support setting favourite music
parent
8c7fd78bd4
commit
03ed3f13f4
|
@ -127,6 +127,18 @@ class UpsertUserAllHandler(
|
|||
}.sortedBy { it.sortNumber })
|
||||
}
|
||||
|
||||
if(req.isNewFavoritemusicList.equals("0"))
|
||||
// According to code, 0 here represents favourite differ and will send complete new list via userFavoritemusicList.
|
||||
// Or userFavoritemusicList will be empty
|
||||
req.userFavoritemusicList?.let { news ->
|
||||
val key = "favorite_music"
|
||||
val data = repos.userGeneralData.findByUserAndPropertyKey(u, key)()
|
||||
?: Mai2UserGeneralData().apply { user = u; propertyKey = key }
|
||||
repos.userGeneralData.save(data.apply {
|
||||
propertyValue = news.map { it.id }.joinToString(",")
|
||||
})
|
||||
}
|
||||
|
||||
return SUCCESS
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public class UserAll implements Serializable {
|
|||
private List<Mai2UserFavorite> userFavoriteList;
|
||||
private List<Mai2UserActivity> userActivityList;
|
||||
private List<Map<String, Object>> userGamePlaylogList;
|
||||
private List<UserFavoriteItem> userFavoritemusicList;
|
||||
private String isNewCharacterList;
|
||||
private String isNewMapList;
|
||||
private String isNewLoginBonusList;
|
||||
|
@ -42,4 +43,5 @@ public class UserAll implements Serializable {
|
|||
private String isNewCourseList;
|
||||
private String isNewFavoriteList;
|
||||
private String isNewFriendSeasonRankingList;
|
||||
private String isNewFavoritemusicList;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package icu.samnyan.aqua.sega.maimai2.model.request.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserFavoriteItem implements Serializable {
|
||||
private int orderId;
|
||||
private int id;
|
||||
}
|
Loading…
Reference in New Issue