|
@@ -2,6 +2,7 @@ package org.hswebframework.web.workflow.dimension.parser;
|
|
|
|
|
|
import lombok.Getter;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
import lombok.Setter;
|
|
|
|
+import org.hswebframework.web.workflow.dimension.DimensionContext;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -13,14 +14,16 @@ public interface CandidateDimensionParserStrategy {
|
|
String DIMENSION_POSITION = "position";
|
|
String DIMENSION_POSITION = "position";
|
|
String DIMENSION_DEPARTMENT = "department";
|
|
String DIMENSION_DEPARTMENT = "department";
|
|
String DIMENSION_ORG = "org";
|
|
String DIMENSION_ORG = "org";
|
|
|
|
+ String DIMENSION_RELATION = "relation";
|
|
|
|
|
|
boolean support(String dimension);
|
|
boolean support(String dimension);
|
|
|
|
|
|
- List<String> parse(StrategyConfig config);
|
|
|
|
|
|
+ List<String> parse(DimensionContext context, StrategyConfig config);
|
|
|
|
|
|
@Getter
|
|
@Getter
|
|
@Setter
|
|
@Setter
|
|
class StrategyConfig {
|
|
class StrategyConfig {
|
|
|
|
+
|
|
private List<String> idList;
|
|
private List<String> idList;
|
|
|
|
|
|
private Map<String, Object> config;
|
|
private Map<String, Object> config;
|
|
@@ -28,5 +31,12 @@ public interface CandidateDimensionParserStrategy {
|
|
public Optional<Object> getConfig(String name) {
|
|
public Optional<Object> getConfig(String name) {
|
|
return config == null ? Optional.empty() : Optional.ofNullable(config.get(name));
|
|
return config == null ? Optional.empty() : Optional.ofNullable(config.get(name));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public Optional<String> getStringConfig(String name) {
|
|
|
|
+ return config == null ?
|
|
|
|
+ Optional.empty() :
|
|
|
|
+ Optional.ofNullable(config.get(name))
|
|
|
|
+ .map(String::valueOf);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|