|
|
@@ -33,17 +33,15 @@ public class UserService {
|
|
|
private final UserMapper userMapper;
|
|
|
private final AliService aliService;
|
|
|
private final GitlabService gitlabService;
|
|
|
- private final SeecoderGitlabApi gitlabApi;
|
|
|
|
|
|
public UserService(
|
|
|
UserRepository userRepository, PasswordEncoder passwordEncoder,
|
|
|
- UserMapper userMapper, AliService aliService, GitlabService gitlabService, SeecoderGitlabApi gitlabApi) {
|
|
|
+ UserMapper userMapper, AliService aliService, GitlabService gitlabService) {
|
|
|
this.userRepository = userRepository;
|
|
|
this.passwordEncoder = passwordEncoder;
|
|
|
this.userMapper = userMapper;
|
|
|
this.aliService = aliService;
|
|
|
this.gitlabService = gitlabService;
|
|
|
- this.gitlabApi = gitlabApi;
|
|
|
}
|
|
|
|
|
|
public List<User> findAllUsers() {
|
|
|
@@ -214,18 +212,13 @@ public class UserService {
|
|
|
user.setPassword(encodedPassword);
|
|
|
User savedUser = userRepository.save(user);
|
|
|
try {
|
|
|
- user.setPassword(userVO.getUsername());
|
|
|
+ user.setPassword("12345678" + userVO.getUsername());
|
|
|
GitlabUserVO gitlabUserVO = generateGitlabUser(user);
|
|
|
- gitlabApi.changePassword(gitlabUserVO.getUserId(), "12345678" + userVO.getUsername());
|
|
|
} catch (CustomErrorException customErrorException) {
|
|
|
log.error("Yuantu register create gitlab user error");
|
|
|
log.error(customErrorException.getMessage());
|
|
|
userRepository.delete(savedUser);
|
|
|
throw customErrorException;
|
|
|
- } catch (SeecoderGitlabException e) {
|
|
|
- log.error("Yuantu register change password error");
|
|
|
- log.error(e.getMessage());
|
|
|
- throw new RuntimeException(e);
|
|
|
}
|
|
|
log.debug("Created Information for Platform Yuantu User: {}", savedUser);
|
|
|
return userMapper.userToUserVO(savedUser);
|