From 00e65c8b7558ad61da6b777121f9b3cead748191 Mon Sep 17 00:00:00 2001 From: pikaqiudeshujia Date: Wed, 15 May 2024 16:54:19 +0800 Subject: [PATCH] =?UTF-8?q?release-=20=E6=AD=8C=E6=9B=B2=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=92=8C=E5=AE=A1=E6=A0=B8=E7=9A=84=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luoo_common/src/main/java/enums/UserTypeEnum.java | 14 +++++++------- .../java/com/luoo/music/service/AlbumService.java | 9 ++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/luoo_common/src/main/java/enums/UserTypeEnum.java b/luoo_common/src/main/java/enums/UserTypeEnum.java index 3417a46..3c24abb 100644 --- a/luoo_common/src/main/java/enums/UserTypeEnum.java +++ b/luoo_common/src/main/java/enums/UserTypeEnum.java @@ -13,20 +13,20 @@ import lombok.Getter; @Getter public enum UserTypeEnum { - NORMAL(1, "普通用户"), + NORMAL("1", "普通用户"), - ARTIST_PERSON(2, "音乐人个人"), + ARTIST_PERSON("2", "音乐人个人"), - ARTIST_BAND(3, "音乐人乐队"), + ARTIST_BAND("3", "音乐人乐队"), - LABEL(4, "厂牌"), + LABEL("4", "厂牌"), - ARTIST_MEMBER(5, "乐队成员"); + ARTIST_MEMBER("5", "乐队成员"); - private Integer code; + private String code; private String desc; - UserTypeEnum(Integer code, String desc) { + UserTypeEnum(String code, String desc) { this.code = code; this.desc = desc; } 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 89a0b89..c5de205 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 @@ -341,6 +341,12 @@ public class AlbumService { .type(ApproveTypeEnum.ALBUM.getCode()) .build(); approveDao.save(successApprove); + + List songInfoList = songInfoDao.findByAlbumId(successApprove.getId()); + for (SongInfo songInfo : songInfoList) { + songInfo.setState(SongInfoStateEnum.IN_USE.getCode()); + songInfoDao.save(songInfo); + } break; case 3: // 审核不通过操作 @@ -615,7 +621,8 @@ public class AlbumService { BeanUtils.copyProperties(albumSongAddDTO, songInfo); songInfo.setId(String.valueOf(idWorker.nextId())); songInfo.setAlbum(albumName); - songInfo.setState(SongInfoStateEnum.IN_USE.getCode()); + songInfo.setState(SongInfoStateEnum.NO_USE.getCode()); + songInfo.setUserType(UserTypeEnum.ARTIST_BAND.getCode()); songInfo.setArtist(artistName); if (user != null) { artistAlbum.setCreateUser(user.getUserId());