refactor(music): 优化歌单相关功能
- 初始化歌单属性默认值,避免空值- 调整歌单信息布局,优化界面显示 -修复歌单播放次数空值问题,提升数据准确性
This commit is contained in:
@@ -57,25 +57,25 @@ public class Playlist {
|
||||
* 是否官方歌单:0-否,1-是
|
||||
*/
|
||||
@Column
|
||||
private Integer isOfficial;
|
||||
private Integer isOfficial = 0;
|
||||
|
||||
/**
|
||||
* 收藏数
|
||||
*/
|
||||
@Column
|
||||
private Integer collectCount;
|
||||
private Integer collectCount = 0;
|
||||
|
||||
/**
|
||||
* 评论数
|
||||
*/
|
||||
@Column
|
||||
private Integer commentCount;
|
||||
private Integer commentCount = 0;
|
||||
|
||||
/**
|
||||
* 播放次数
|
||||
*/
|
||||
@Column
|
||||
private Long playCount;
|
||||
private Long playCount = 0L;
|
||||
|
||||
/**
|
||||
* 歌单中的音乐
|
||||
|
||||
@@ -546,6 +546,9 @@ public class PlaylistServiceImpl implements PlaylistService {
|
||||
PlaylistDTO playlistDTO = new PlaylistDTO();
|
||||
BeanUtils.copyProperties(playlist, playlistDTO);
|
||||
playlistDTO.setHotScore(playlist.getHotScore());
|
||||
if (playlist.getPlayCount() == null) {
|
||||
playlistDTO.setPlayCount(0L);
|
||||
}
|
||||
|
||||
// 设置创建者信息
|
||||
if (playlist.getCreator() != null) {
|
||||
|
||||
Reference in New Issue
Block a user