Merge branch 'dev' into INFRA-1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
### MODULES
|
||||
|
||||
-api
|
||||
- register +
|
||||
- logut +
|
||||
- login +
|
||||
- check-demo-status
|
||||
- check-token-balance
|
||||
- content
|
||||
- dismiss-notification
|
||||
- download
|
||||
- download-certificate
|
||||
- download-pdf-tracked
|
||||
- export-report
|
||||
- forgor-password
|
||||
- generate-certificate
|
||||
- get-pdf-tracking-token
|
||||
- get-user-data
|
||||
- login ?
|
||||
- logaut ?
|
||||
- notifications-api
|
||||
- preview-certificate
|
||||
- register
|
||||
- reports
|
||||
- reset-password
|
||||
- token-manager
|
||||
- track-pdf-open
|
||||
- upload
|
||||
- validate-upload
|
||||
- verify-video
|
||||
- violations
|
||||
|
||||
infra
|
||||
-grafana/prom +
|
||||
- ci/cd
|
||||
|
||||
@@ -16,6 +16,7 @@ services:
|
||||
|
||||
app:
|
||||
image: popovtsev/ncp
|
||||
# build: .
|
||||
container_name: no_copy_app
|
||||
environment:
|
||||
POSTGRES_DB: no_copy_
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package ru.soune.no_copy.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ru.soune.no_copy.dto.UserDTO;
|
||||
import ru.soune.no_copy.repository.UserRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/user")
|
||||
@RequiredArgsConstructor
|
||||
public class UserController {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<List<UserDTO>> getAllUsers() {
|
||||
List<UserDTO> allUsers = userRepository.findAll().stream()
|
||||
.map(u -> new UserDTO(u.getFirstName(), u.getEmail(), u.getIsActive()))
|
||||
.toList();
|
||||
|
||||
return ResponseEntity.ok(allUsers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package ru.soune.no_copy.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class UserDTO {
|
||||
private String fullName;
|
||||
private String email;
|
||||
private boolean isActive;
|
||||
}
|
||||
@@ -53,6 +53,6 @@ public class User {
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Column(name = "is_active")
|
||||
private Boolean isActive;
|
||||
private Boolean isActive = true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user