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())) {
|
||||
throw new IllegalStateException(String.format("Task %s not support request with body", taskEnum.getCode()));
|
||||
}
|
||||
LauncherNew launcherCommand = new LauncherNew();
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
String username = KeycloakUtils.getUserNameFromAuthentication(authentication);
|
||||
User user = userImdg.getSingleObjectByFieldValues(Map.of("identifier", username));
|
||||
if (user == null) {
|
||||
throw new IllegalStateException("cannot obtain userId from logged in user " + username);
|
||||
}
|
||||
launcherCommand.setTask(launcherNew.getTask());
|
||||
launcherCommand.setUserId(user.getId());
|
||||
launcherCommand.setCompanyId(launcherNew.getCompanyId());
|
||||
launcherCommand.setSecurityId(launcherNew.getSecurityId());
|
||||
return processRequest(Consts.LAUNCHER_NEW, launcherCommand);
|
||||
launcherNew.setUserId(user.getId());
|
||||
return processRequest(Consts.LAUNCHER_NEW, launcherNew);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue