|
|
@ -11,6 +11,7 @@ import constants.Constants;
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import util.IdWorker;
|
|
|
|
import util.IdWorker;
|
|
|
@ -44,6 +45,9 @@ public class ArtistService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IdWorker idWorker;
|
|
|
|
private IdWorker idWorker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private BCryptPasswordEncoder encoder;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 音乐人注册
|
|
|
|
* 音乐人注册
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -52,7 +56,7 @@ public class ArtistService {
|
|
|
|
public void artistRegister(ArtistRegisterDto artistRegisterDto) {
|
|
|
|
public void artistRegister(ArtistRegisterDto artistRegisterDto) {
|
|
|
|
|
|
|
|
|
|
|
|
UserInfo userInfoByUserName = userInfoDao.findUserInfoByUserName(artistRegisterDto.getUserName());
|
|
|
|
UserInfo userInfoByUserName = userInfoDao.findUserInfoByUserName(artistRegisterDto.getUserName());
|
|
|
|
if(userInfoByUserName == null) {
|
|
|
|
if(userInfoByUserName != null) {
|
|
|
|
throw new RuntimeException("该用户名已存在,请重新输入!");
|
|
|
|
throw new RuntimeException("该用户名已存在,请重新输入!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -66,7 +70,7 @@ public class ArtistService {
|
|
|
|
.thumbnail(Constants.DEFAULT_USER_THUMBNAIL)
|
|
|
|
.thumbnail(Constants.DEFAULT_USER_THUMBNAIL)
|
|
|
|
.signature(Constants.DEFAULT_USER_SIGNATURE)
|
|
|
|
.signature(Constants.DEFAULT_USER_SIGNATURE)
|
|
|
|
.userName(artistRegisterDto.getUserName())
|
|
|
|
.userName(artistRegisterDto.getUserName())
|
|
|
|
.password(artistRegisterDto.getPassword())
|
|
|
|
.password(encoder.encode(artistRegisterDto.getPassword()))
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
userInfoDao.save(userInfo);
|
|
|
|
|
|
|
|
|
|
|
@ -83,6 +87,7 @@ public class ArtistService {
|
|
|
|
|
|
|
|
|
|
|
|
// 新增音乐人负责人信息
|
|
|
|
// 新增音乐人负责人信息
|
|
|
|
ArtistResponsible artistResponsible = ArtistResponsible.builder()
|
|
|
|
ArtistResponsible artistResponsible = ArtistResponsible.builder()
|
|
|
|
|
|
|
|
.id(String.valueOf(idWorker.nextId()))
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
.userId(userInfo.getId())
|
|
|
|
.sex(artistRegisterDto.getSex())
|
|
|
|
.sex(artistRegisterDto.getSex())
|
|
|
|
.name(artistRegisterDto.getNickName())
|
|
|
|
.name(artistRegisterDto.getNickName())
|
|
|
|