Compare commits
No commits in common. "feature/RED-10196" and "main" have entirely different histories.
feature/RE
...
main
@ -18,5 +18,4 @@ deploy:
|
|||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
- if: $CI_COMMIT_BRANCH =~ /^release/
|
- if: $CI_COMMIT_BRANCH =~ /^release/
|
||||||
- if: $CI_COMMIT_BRANCH =~ /^feature/
|
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
@ -1,7 +0,0 @@
|
|||||||
package com.knecon.fforesight.tenantcommons;
|
|
||||||
|
|
||||||
public enum TenantApplicationType {
|
|
||||||
RedactManager,
|
|
||||||
DocuMine,
|
|
||||||
Clarifynd
|
|
||||||
}
|
|
||||||
@ -15,6 +15,4 @@ public interface TenantProvider {
|
|||||||
|
|
||||||
List<TenantResponse> getTenants();
|
List<TenantResponse> getTenants();
|
||||||
|
|
||||||
TenantApplicationType getTenantApplicationType(String tenantId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ public interface TenantsClient extends TenantProvider {
|
|||||||
String TENANT_ID_PARAM = "tenantId";
|
String TENANT_ID_PARAM = "tenantId";
|
||||||
String DETAILS_PATH = "/details";
|
String DETAILS_PATH = "/details";
|
||||||
String TENANT_ID_PATH_PARAM = "/{" + TENANT_ID_PARAM + "}";
|
String TENANT_ID_PATH_PARAM = "/{" + TENANT_ID_PARAM + "}";
|
||||||
String APPLICATION_TYPE_PATH = "/application-type";
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value = TENANT_PATH + TENANT_ID_PATH_PARAM + DETAILS_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
@PostMapping(value = TENANT_PATH + TENANT_ID_PATH_PARAM + DETAILS_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ -38,8 +37,4 @@ public interface TenantsClient extends TenantProvider {
|
|||||||
@GetMapping(value = TENANT_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
@GetMapping(value = TENANT_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
List<TenantResponse> getTenants();
|
List<TenantResponse> getTenants();
|
||||||
|
|
||||||
|
|
||||||
@GetMapping(value = TENANT_PATH + TENANT_ID_PATH_PARAM + APPLICATION_TYPE_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
TenantApplicationType getTenantApplicationType(@PathVariable(TENANT_ID_PARAM) String tenantId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,6 @@ package com.knecon.fforesight.tenantcommons.model;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.knecon.fforesight.tenantcommons.TenantApplicationType;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -28,6 +26,5 @@ public class TenantResponse implements ITenantEvent {
|
|||||||
private AuthDetails authDetails;
|
private AuthDetails authDetails;
|
||||||
|
|
||||||
private Map<String, Object> details = new HashMap<>();
|
private Map<String, Object> details = new HashMap<>();
|
||||||
private TenantApplicationType applicationType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,10 @@ package com.knecon.fforesight.tenantcommons.utils;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.knecon.fforesight.tenantcommons.TenantApplicationType;
|
|
||||||
import com.knecon.fforesight.tenantcommons.TenantProvider;
|
import com.knecon.fforesight.tenantcommons.TenantProvider;
|
||||||
import com.knecon.fforesight.tenantcommons.listener.ITenantEventHandler;
|
import com.knecon.fforesight.tenantcommons.listener.ITenantEventHandler;
|
||||||
import com.knecon.fforesight.tenantcommons.model.TenantCreatedEvent;
|
import com.knecon.fforesight.tenantcommons.model.TenantCreatedEvent;
|
||||||
@ -27,10 +27,7 @@ public class TestTenantProvider implements TenantProvider, ITenantEventHandler<T
|
|||||||
@Override
|
@Override
|
||||||
public TenantResponse getTenant(String s) {
|
public TenantResponse getTenant(String s) {
|
||||||
|
|
||||||
return tenants.stream()
|
return tenants.stream().filter(t -> t.getTenantId().equals(s)).findFirst().orElse(null);
|
||||||
.filter(t -> t.getTenantId().equals(s))
|
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,21 +38,12 @@ public class TestTenantProvider implements TenantProvider, ITenantEventHandler<T
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TenantApplicationType getTenantApplicationType(String s) {
|
|
||||||
|
|
||||||
return tenants.stream()
|
|
||||||
.filter(t -> t.getTenantId().equals(s))
|
|
||||||
.findFirst()
|
|
||||||
.map(TenantResponse::getApplicationType)
|
|
||||||
.orElse(TenantApplicationType.RedactManager);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(TenantCreatedEvent event) {
|
public void handle(TenantCreatedEvent event) {
|
||||||
|
|
||||||
tenants.add(TenantResponse.builder().tenantId(event.getTenantId()).build());
|
tenants.add(TenantResponse.builder()
|
||||||
|
.tenantId(event.getTenantId())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user