|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.luoo.music.service;
|
|
|
|
|
|
|
|
|
|
import api.PageResult;
|
|
|
|
|
import com.luoo.music.client.UserClient;
|
|
|
|
|
import com.luoo.music.dao.*;
|
|
|
|
|
import com.luoo.music.dto.response.*;
|
|
|
|
|
import com.luoo.music.pojo.*;
|
|
|
|
@ -10,6 +11,7 @@ import dto.UserLoginDto;
|
|
|
|
|
import enums.AlbumStateEnum;
|
|
|
|
|
import enums.SongInfoChargeEnum;
|
|
|
|
|
import enums.SongInfoStateEnum;
|
|
|
|
|
import enums.UserTypeEnum;
|
|
|
|
|
import exception.BizException;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
@ -69,6 +71,9 @@ public class AlbumService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private S3Service s3Service;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserClient userClient;
|
|
|
|
|
|
|
|
|
|
public PageResult<ArtistAlbum> getList(AlbumSearchDTO albumSearchDTO, Integer page, Integer size) {
|
|
|
|
|
List<ArtistAlbum> result = new ArrayList<>();
|
|
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "createTime");
|
|
|
|
@ -248,6 +253,20 @@ public class AlbumService {
|
|
|
|
|
artistAlbum.setId(String.valueOf(idWorker.nextId()));
|
|
|
|
|
UserLoginDto user = jwtUtil.getUserLoginDto(token);
|
|
|
|
|
if (user != null) {
|
|
|
|
|
Integer type = artistAlbum.getType();
|
|
|
|
|
if(ObjectUtils.notEqual(UserTypeEnum.ARTIST_PERSON.getCode(), type) &&
|
|
|
|
|
ObjectUtils.notEqual(UserTypeEnum.ARTIST_BAND.getCode(), type)
|
|
|
|
|
) {
|
|
|
|
|
throw new BizException(ErrorConstants.USER_IS_NOT_ARTIST);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验是否通过实名认证
|
|
|
|
|
Boolean realNameInfo = userClient.getRealNameInfo(user.getUserId());
|
|
|
|
|
if(!realNameInfo) {
|
|
|
|
|
// 未通过实名认证
|
|
|
|
|
throw new BizException(ErrorConstants.THE_REAL_NAME_AUTHENTICATION_IS_NOT_PASSED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
artistAlbum.setCreateUser(user.getUserId());
|
|
|
|
|
} else {
|
|
|
|
|
// 用户校验失败,请重新登录
|
|
|
|
@ -265,6 +284,10 @@ public class AlbumService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkRealNameType(String userId) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改专辑信息
|
|
|
|
|
*
|
|
|
|
|