This commit is contained in:
@@ -53,17 +53,6 @@ public class UserController {
|
||||
|
||||
private final FileStatsService fileStatsService;
|
||||
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<List<UserDTO>> getAllUsers() {
|
||||
List<UserDTO> allUsers = userRepository.findAll().stream()
|
||||
.map(u -> new UserDTO(u.getFullName(), u.getCompanyName(), u.getEmail(), u.isActive(),
|
||||
u.getPhone(), u.getGenderType(),
|
||||
u.getBirthday(), u.getCreatedAt(), u.getSubscriptionType(), tariffService.getAllTariffs(),
|
||||
null, null, u.getVerificationStatus()))
|
||||
.toList();
|
||||
|
||||
return ResponseEntity.ok(allUsers);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<UserDTO> getUser(@RequestParam("email") String email,
|
||||
@@ -121,23 +110,16 @@ public class UserController {
|
||||
.build();
|
||||
|
||||
userDTO.setTariffInfo(infoDTO);
|
||||
|
||||
userDTO.setSubscriptionType(infoDTO.getTariffName());
|
||||
}
|
||||
|
||||
userDTO.setPhone(user.getPhone());
|
||||
userDTO.setGenderType(user.getGenderType());
|
||||
userDTO.setBirthday(user.getBirthday());
|
||||
userDTO.setCreatedAt(user.getCreatedAt());
|
||||
userDTO.setSubscriptionType(user.getSubscriptionType());
|
||||
userDTO.setActive(user.isActive());
|
||||
userDTO.setPermission(user.getUserPermissions());
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
System.out.println("userDTO: " + userDTO);
|
||||
|
||||
return ResponseEntity.ok(userDTO);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class UserDTO {
|
||||
private GenderType genderType;
|
||||
private LocalDate birthday;
|
||||
private LocalDateTime createdAt;
|
||||
private SubscriptionType subscriptionType;
|
||||
private String subscriptionType;
|
||||
private List<TariffDTO> tariffs;
|
||||
private TariffInfoDTO tariffInfo;
|
||||
private Long permission;
|
||||
|
||||
@@ -49,10 +49,6 @@ public class User {
|
||||
@Column(unique = true)
|
||||
private String phone;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "subscription_type", nullable = false, length = 20)
|
||||
private SubscriptionType subscriptionType = SubscriptionType.DEMO;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "gender")
|
||||
private GenderType genderType = GenderType.MALE;
|
||||
|
||||
Reference in New Issue
Block a user