[+] Support setting favourite music

pull/47/head
Clansty 2024-07-28 00:56:18 +08:00
parent 8c7fd78bd4
commit 03ed3f13f4
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
3 changed files with 29 additions and 0 deletions

View File

@ -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
}

View File

@ -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;
}

View File

@ -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;
}