release/2025-02-20-10-46
This commit is contained in:
parent
d826b80c26
commit
75e925419a
@ -23,23 +23,22 @@ public class AdminController {
|
||||
private void amIAdmin() {}
|
||||
|
||||
@PostMapping("/panel/get-employee-info")
|
||||
private EmployeeDataDto getEmployeeInfo(@RequestParam("employee-login") String employeeLogin) {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private EmployeeDataDto getEmployeeInfo(@RequestParam("employee-login") String employeeLogin, Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
return adminService.getEmployeeInfo(employeeLogin, login);
|
||||
}
|
||||
|
||||
@PostMapping("/panel/set-block-condition")
|
||||
private void setBlockCondition(@RequestParam("employee-login") String employeeLogin,
|
||||
@RequestParam("block-condition") boolean blockCondition) {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
@RequestParam("block-condition") boolean blockCondition,
|
||||
Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
adminService.setBlockCondition(employeeLogin, blockCondition, login);
|
||||
}
|
||||
|
||||
@PostMapping("/panel/get-employee-entry-list")
|
||||
private List<EntryDto> getEmployeeEntryList(@RequestParam("employee-login") String employeeLogin) {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private List<EntryDto> getEmployeeEntryList(@RequestParam("employee-login") String employeeLogin,
|
||||
Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
return adminService.getEmployeeEntryList(employeeLogin, login);
|
||||
}
|
||||
|
@ -20,29 +20,25 @@ public class EmployeeController {
|
||||
private void auth() {}
|
||||
|
||||
@PostMapping("/info")
|
||||
private EmployeeDataDto info() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private EmployeeDataDto info(Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
return employeeService.info(login);
|
||||
}
|
||||
|
||||
@PostMapping("/open")
|
||||
private void open(@RequestParam("value") long value) {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private void open(@RequestParam("value") long value, Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
employeeService.open(login, value);
|
||||
}
|
||||
|
||||
@PostMapping("/get-entry-list")
|
||||
private List<EntryDto> getEntryList() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private List<EntryDto> getEntryList(Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
return employeeService.getEntryList(login);
|
||||
}
|
||||
|
||||
@PostMapping("/am-i-blocked")
|
||||
private boolean amIBlocked() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
private boolean amIBlocked(Authentication authentication) {
|
||||
String login = authentication.getName();
|
||||
return employeeService.amIBlocked(login);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user