diff --git a/luoo_common/src/main/java/enums/SongInfoChargeEnum.java b/luoo_common/src/main/java/enums/SongInfoChargeEnum.java index 1d61307..82428f4 100644 --- a/luoo_common/src/main/java/enums/SongInfoChargeEnum.java +++ b/luoo_common/src/main/java/enums/SongInfoChargeEnum.java @@ -13,7 +13,7 @@ import lombok.Getter; @Getter public enum SongInfoChargeEnum { CHARGE(1, "收费"), - FREE(2, "收费"); + FREE(2, "免费"); private Integer code; diff --git a/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumAddDTO.java b/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumAddDTO.java index 7d6c306..de5683a 100644 --- a/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumAddDTO.java +++ b/luoo_music/src/main/java/com/luoo/music/dto/response/AlbumAddDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -53,7 +54,7 @@ public class AlbumAddDTO implements Serializable { */ @ApiModelProperty("发行日期") @NotNull(message = "发行日期不能为空") - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date publishDate; /** @@ -90,6 +91,7 @@ public class AlbumAddDTO implements Serializable { * 歌曲新增对象 */ @ApiModelProperty("歌曲新增对象") + @Valid private List songAddList; } diff --git a/luoo_music/src/main/java/com/luoo/music/pojo/ArtistAlbum.java b/luoo_music/src/main/java/com/luoo/music/pojo/ArtistAlbum.java index 6c8ca95..7800171 100644 --- a/luoo_music/src/main/java/com/luoo/music/pojo/ArtistAlbum.java +++ b/luoo_music/src/main/java/com/luoo/music/pojo/ArtistAlbum.java @@ -64,7 +64,7 @@ public class ArtistAlbum implements Serializable { * 发行日期 */ @ApiModelProperty("发行日期") - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date publishDate; /** @@ -88,7 +88,7 @@ public class ArtistAlbum implements Serializable { /** * 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @CreatedDate @ApiModelProperty("创建时间") private LocalDateTime createTime; @@ -96,7 +96,7 @@ public class ArtistAlbum implements Serializable { /** * 修改时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @LastModifiedDate @ApiModelProperty("修改时间") private LocalDateTime updateTime; @@ -144,5 +144,8 @@ public class ArtistAlbum implements Serializable { @ApiModelProperty("专辑状态-中文") private String stateStr; + @ApiModelProperty("专辑版本") + private Integer version; + } diff --git a/luoo_music/src/main/java/com/luoo/music/pojo/SongInfo.java b/luoo_music/src/main/java/com/luoo/music/pojo/SongInfo.java index ab4c4cf..e56f094 100644 --- a/luoo_music/src/main/java/com/luoo/music/pojo/SongInfo.java +++ b/luoo_music/src/main/java/com/luoo/music/pojo/SongInfo.java @@ -66,13 +66,13 @@ public class SongInfo implements Serializable { /** * 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @CreatedDate private LocalDateTime createTime; /** * 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @LastModifiedDate private LocalDateTime updateTime; /** diff --git a/luoo_music/src/main/java/com/luoo/music/pojo/Tag.java b/luoo_music/src/main/java/com/luoo/music/pojo/Tag.java index c560f0d..7f0bd03 100644 --- a/luoo_music/src/main/java/com/luoo/music/pojo/Tag.java +++ b/luoo_music/src/main/java/com/luoo/music/pojo/Tag.java @@ -1,6 +1,7 @@ package com.luoo.music.pojo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -84,6 +85,7 @@ public class Tag implements Serializable { * 创建时间 */ @CreatedDate + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; /** @@ -95,6 +97,7 @@ public class Tag implements Serializable { * 更新时间 */ @LastModifiedDate + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime updateTime; @Override diff --git a/luoo_music/src/main/java/com/luoo/music/service/AlbumService.java b/luoo_music/src/main/java/com/luoo/music/service/AlbumService.java index d6f396f..f0309b1 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/AlbumService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/AlbumService.java @@ -420,7 +420,7 @@ public class AlbumService { */ private void addSongForAlbum(@Validated AlbumSongAddDTO albumSongAddDTO, UserLoginDto user, ArtistAlbum artistAlbum) { - if(ObjectUtils.notEqual(SongInfoChargeEnum.CHARGE.getCode(), albumSongAddDTO.getCharge())) { + if(ObjectUtils.equals(SongInfoChargeEnum.CHARGE.getCode(), albumSongAddDTO.getCharge())) { if(albumSongAddDTO.getPrice() == null) { // 定价不能为空 throw new BizException(ErrorConstants.PRICE_CAN_NOT_BE_EMPTY);