refactor(music): 优化歌单相关功能

- 初始化歌单属性默认值,避免空值- 调整歌单信息布局,优化界面显示
-修复歌单播放次数空值问题,提升数据准确性
This commit is contained in:
ikmkj
2025-07-28 21:37:15 +08:00
parent 7950a12855
commit 01bbf8204c
3 changed files with 9 additions and 5 deletions

View File

@@ -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;
/**
* 歌单中的音乐

View File

@@ -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) {

View File

@@ -503,7 +503,8 @@ onMounted(() => {
transition: opacity 0.3s;
display: flex;
flex-direction: column;
justify-content: space-between;
justify-content: flex-start;
gap: 5px;
padding: 15px;
}