-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
698e4fa
commit e75fa42
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/com/stefan/security/user/UserController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.stefan.security.user; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@AllArgsConstructor | ||
@Validated | ||
public class UserController { | ||
private final UserService userService; | ||
|
||
@GetMapping("/api/get-all-users") | ||
public List<User> getAllUsers() { | ||
return userService.getAllUsers(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.stefan.security.user; | ||
|
||
|
||
import java.util.List; | ||
|
||
public interface UserService { | ||
List<User> getAllUsers(); | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/stefan/security/user/UserServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.stefan.security.user; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.validation.annotation.Validated; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
@AllArgsConstructor | ||
@Validated | ||
public class UserServiceImpl implements UserService { | ||
|
||
private final UserRepository userRepository; | ||
|
||
@Override | ||
public List<User> getAllUsers() { | ||
return userRepository.findAll(); | ||
} | ||
} |