@@ -47,7 +47,7 @@ public class UserController {
|
|||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
public ResponseEntity<List<UserDTO>> getAllUsers() {
|
public ResponseEntity<List<UserDTO>> getAllUsers() {
|
||||||
List<UserDTO> allUsers = userRepository.findAll().stream()
|
List<UserDTO> allUsers = userRepository.findAll().stream()
|
||||||
.map(u -> new UserDTO(u.getFullName(), u.getCompany().getCompanyName(), u.getEmail(), u.isActive(),
|
.map(u -> new UserDTO(u.getFullName(), u.getCompanyName(), u.getEmail(), u.isActive(),
|
||||||
u.getPhone(), u.getGenderType(),
|
u.getPhone(), u.getGenderType(),
|
||||||
u.getBirthday(), u.getCreatedAt(), u.getSubscriptionType()))
|
u.getBirthday(), u.getCreatedAt(), u.getSubscriptionType()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@@ -90,6 +90,14 @@ public class User {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private ProtectedFileCheck protectedFileCheck;
|
private ProtectedFileCheck protectedFileCheck;
|
||||||
|
|
||||||
|
public String getCompanyName() {
|
||||||
|
if (company != null) {
|
||||||
|
return company.getCompanyName();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "company_id")
|
@JoinColumn(name = "company_id")
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ public class FileEntityService {
|
|||||||
.fileName(fileEntity.getOriginalFileName())
|
.fileName(fileEntity.getOriginalFileName())
|
||||||
.ownerName(user.getFullName())
|
.ownerName(user.getFullName())
|
||||||
.ownerEmail(user.getEmail())
|
.ownerEmail(user.getEmail())
|
||||||
.ownerCompany(user.getCompany().getCompanyName())
|
.ownerCompany(user.getCompanyName())
|
||||||
//TODO fix after add logic for check for protect file
|
//TODO fix after add logic for check for protect file
|
||||||
.checksCount(0)
|
.checksCount(0)
|
||||||
.fileUploadDate(fileEntity.getCreatedAt())
|
.fileUploadDate(fileEntity.getCreatedAt())
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class UserService {
|
|||||||
return UserDTO.builder()
|
return UserDTO.builder()
|
||||||
.fullName(user.getFullName())
|
.fullName(user.getFullName())
|
||||||
.email(user.getEmail())
|
.email(user.getEmail())
|
||||||
.company(user.getCompany().getCompanyName())
|
.company(user.getCompanyName())
|
||||||
.phone(user.getPhone())
|
.phone(user.getPhone())
|
||||||
.genderType(user.getGenderType())
|
.genderType(user.getGenderType())
|
||||||
.birthday(user.getBirthday())
|
.birthday(user.getBirthday())
|
||||||
|
|||||||
Reference in New Issue
Block a user