SUPPORT-9359: fix idm

This commit is contained in:
adel.ka 2025-08-28 15:57:41 +03:00
parent 44681d41d3
commit a3e0562473
3 changed files with 7 additions and 11 deletions

View file

@ -20,8 +20,8 @@ public abstract class AbstractIdmValidatorService implements IdmValidatorService
protected RestTemplate restTemplate;
protected SecurityContext securityContext;
@Value("${ervu.url}")
protected String ervuUrl;
@Value("${idm.url}")
protected String idmUrl;
protected AbstractIdmValidatorService(RestTemplate restTemplate, SecurityContext securityContext) {
this.restTemplate = restTemplate;
@ -30,8 +30,7 @@ public abstract class AbstractIdmValidatorService implements IdmValidatorService
protected boolean checkExistsByQuery(String endpoint, String queryParamName, String queryParamValue) {
URI uri = UriComponentsBuilder
.fromHttpUrl(ervuUrl)
.path(PathConstant.IDM_PATH)
.fromHttpUrl(idmUrl)
.pathSegment(PathConstant.PERSONS_PATH)
.path(endpoint)
.queryParam(queryParamName, queryParamValue)

View file

@ -50,8 +50,8 @@ public class AccountFetchService implements EntityFetchService<Account> {
private final RestTemplate restTemplate;
private final ObjectMapper mapper;
private final SecurityContext securityContext;
@Value("${ervu.url}")
private String ervuUrl;
@Value("${idm.url}")
private String idmUrl;
@ObjectRef
public EditableGridColumn editableGridColumnRef;
@ -77,8 +77,7 @@ public class AccountFetchService implements EntityFetchService<Account> {
headers.setBearerAuth(securityContext.getToken());
HttpEntity<SearchRequest> httpEntity = new HttpEntity<>(request, headers);
URI uri = UriComponentsBuilder.fromHttpUrl(ervuUrl)
.path(PathConstant.IDM_PATH)
URI uri = UriComponentsBuilder.fromHttpUrl(idmUrl)
.pathSegment(PathConstant.ACCOUNTS_PATH, "search", "v1")
.build()
.toUri();
@ -118,8 +117,7 @@ public class AccountFetchService implements EntityFetchService<Account> {
}
private Account fetchAccountById(Object id) {
URI uri = UriComponentsBuilder.fromHttpUrl(ervuUrl)
.path(PathConstant.IDM_PATH)
URI uri = UriComponentsBuilder.fromHttpUrl(idmUrl)
.pathSegment(PathConstant.ACCOUNTS_PATH, id.toString(), "v1")
.build()
.toUri();

View file

@ -6,7 +6,6 @@ package ru.micord.ervu.account_applications.service.constant;
public final class PathConstant {
public static final String ACCOUNTS_PATH = "accounts";
public static final String PERSONS_PATH = "persons";
public static final String IDM_PATH = "/service/idm";
private PathConstant() {
}