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