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