added lastName on users
This commit is contained in:
@@ -9,6 +9,7 @@ public class UserResponseDto {
|
||||
private Long id;
|
||||
private String login;
|
||||
private String name;
|
||||
private String lastName;
|
||||
private String phone;
|
||||
private String email;
|
||||
private String avatar;
|
||||
|
||||
@@ -10,7 +10,6 @@ import jakarta.persistence.EntityNotFoundException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -48,11 +47,11 @@ public class UserService {
|
||||
User user = repository.findById(id)
|
||||
.orElseThrow(() -> new EntityNotFoundException("User not found"));
|
||||
|
||||
user.setLogin(dto.getLogin());
|
||||
user.setName(dto.getFirstName());
|
||||
user.setLogin(dto.getLastName());
|
||||
user.setLastName(dto.getLastName());
|
||||
user.setPhone(dto.getPhone());
|
||||
user.setEmail(dto.getEmail());
|
||||
user.setLogin(dto.getLogin());
|
||||
|
||||
MultipartFile avatar = dto.getAvatar();
|
||||
if (avatar != null && !avatar.isEmpty()) {
|
||||
@@ -74,6 +73,7 @@ public class UserService {
|
||||
.name(user.getName())
|
||||
.phone(user.getPhone())
|
||||
.email(user.getEmail())
|
||||
.lastName(user.getLastName())
|
||||
.avatar(user.getAvatarUrl())
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user