fix LauncherController fix specific method
This commit is contained in:
parent
e110b10cb9
commit
e84a75016e
1 changed files with 2 additions and 6 deletions
|
|
@ -103,18 +103,14 @@ public class LauncherController extends AbstractQueueController {
|
||||||
if (!Task.startOfClearing.getKey().equals(taskEnum.getCode())) {
|
if (!Task.startOfClearing.getKey().equals(taskEnum.getCode())) {
|
||||||
throw new IllegalStateException(String.format("Task %s not support request with body", taskEnum.getCode()));
|
throw new IllegalStateException(String.format("Task %s not support request with body", taskEnum.getCode()));
|
||||||
}
|
}
|
||||||
LauncherNew launcherCommand = new LauncherNew();
|
|
||||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
String username = KeycloakUtils.getUserNameFromAuthentication(authentication);
|
String username = KeycloakUtils.getUserNameFromAuthentication(authentication);
|
||||||
User user = userImdg.getSingleObjectByFieldValues(Map.of("identifier", username));
|
User user = userImdg.getSingleObjectByFieldValues(Map.of("identifier", username));
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
throw new IllegalStateException("cannot obtain userId from logged in user " + username);
|
throw new IllegalStateException("cannot obtain userId from logged in user " + username);
|
||||||
}
|
}
|
||||||
launcherCommand.setTask(launcherNew.getTask());
|
launcherNew.setUserId(user.getId());
|
||||||
launcherCommand.setUserId(user.getId());
|
return processRequest(Consts.LAUNCHER_NEW, launcherNew);
|
||||||
launcherCommand.setCompanyId(launcherNew.getCompanyId());
|
|
||||||
launcherCommand.setSecurityId(launcherNew.getSecurityId());
|
|
||||||
return processRequest(Consts.LAUNCHER_NEW, launcherCommand);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue