Skip to content

Commit 7416e6a

Browse files
authored
Merge pull request #14 from lvyahui8/develop
Develop merge into master
2 parents 6e927f0 + d36784c commit 7416e6a

File tree

11 files changed

+27
-11
lines changed

11 files changed

+27
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
<groupId>io.github.lvyahui8</groupId>
2222
<artifactId>spring-boot-data-aggregator</artifactId>
23-
<version>1.1.1</version>
23+
<version>1.1.2</version>
2424
<modules>
2525
<module>spring-boot-data-aggregator-core</module>
2626
<module>spring-boot-data-aggregator-autoconfigure</module>

spring-boot-data-aggregator-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.1</version>
8+
<version>1.1.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

spring-boot-data-aggregator-autoconfigure/src/main/java/io/github/lvyahui8/spring/autoconfigure/BeanAggregateAutoConfiguration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ public DataBeanAggregateQueryService dataBeanAggregateQueryService (
128128

129129
DataBeanAggregateQueryServiceImpl service = new DataBeanAggregateQueryServiceImpl();
130130
RuntimeSettings runtimeSettings = new RuntimeSettings();
131-
runtimeSettings.setEnableLogging(properties.getEnableLogging() != null
132-
? properties.getEnableLogging() : false);
133131
runtimeSettings.setIgnoreException(properties.isIgnoreException());
134132
runtimeSettings.setTimeout(properties.getDefaultTimeout());
135133
service.setRepository(dataProviderRepository);

spring-boot-data-aggregator-autoconfigure/src/main/java/io/github/lvyahui8/spring/autoconfigure/BeanAggregateProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class BeanAggregateProperties {
3535
/**
3636
* Allow output log
3737
*/
38+
@Deprecated
3839
private Boolean enableLogging = true;
3940
/**
4041
* Ignore exception thrown by asynchronous execution, method returns null value

spring-boot-data-aggregator-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.1</version>
8+
<version>1.1.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

spring-boot-data-aggregator-core/src/main/java/io/github/lvyahui8/spring/aggregate/config/RuntimeSettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
@Data
1010
public class RuntimeSettings {
11-
private boolean enableLogging;
1211
private boolean ignoreException;
1312
private Long timeout;
1413
}

spring-boot-data-aggregator-core/src/main/java/io/github/lvyahui8/spring/aggregate/service/impl/DataBeanAggregateQueryServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private <T> T innerGet(DataProvideDefinition provider, Map<String, Object> invo
128128
return resultType.cast(interceptorChain.applyQueryAfter(context,provider,result));
129129
} catch (Exception e) {
130130
interceptorChain.applyExceptionHandle(context,provider,e);
131-
return null;
131+
throw e;
132132
}
133133
}
134134

@@ -169,7 +169,7 @@ public Object execute() throws Exception {
169169
for (Map.Entry<String,Future<?>> item : futureMap.entrySet()) {
170170
Future<?> future = item.getValue();
171171
Object value = null;
172-
DataConsumeDefinition consumeDefinition = consumeDefinitionMap.get(item.getKey());
172+
DataConsumeDefinition consumeDefinition = consumeDefinitionMap.get(item.getKey().substring(0,item.getKey().indexOf('_')));
173173
try {
174174
value = future.get();
175175
} catch (ExecutionException e) {

spring-boot-data-aggregator-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.1</version>
8+
<version>1.1.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

spring-boot-data-aggregator-example/src/main/java/io/github/lvyahui8/spring/example/interceptor/SampleAggregateQueryInterceptor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public void queryBefore(AggregationContext aggregationContext, DataProvideDefini
2828

2929
@Override
3030
public Object queryAfter(AggregationContext aggregationContext, DataProvideDefinition provideDefinition, Object result) {
31-
log.info("query after. provider:{},result:{}",provideDefinition.getMethod().getName(),result.toString());
31+
log.info("query after. provider:{},result:{}",provideDefinition.getMethod().getName(),result != null ?
32+
result.toString() : "null");
3233
return result;
3334
}
3435

spring-boot-data-aggregator-example/src/test/java/io/github/lvyahui8/spring/example/DataBeanAggregateQueryFacadeTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,21 @@ public Object apply(
178178
System.out.println(specialUserCollection);
179179
}
180180

181+
@Test
182+
public void testParameterTypeException() throws Exception {
183+
try{
184+
dataBeanAggregateQueryFacade.get(Collections.singletonMap("userId", "1"),
185+
new Function2<User, List<Post>, User>() {
186+
@Override
187+
public User apply(@DataConsumer("user") User user,
188+
@DataConsumer("posts") List<Post> posts) {
189+
return user;
190+
}
191+
});
192+
throw new IllegalStateException("must throw IllegalArgumentException");
193+
} catch (Exception e) {
194+
log.error("eMsg:",e);
195+
Assert.isTrue(e instanceof IllegalArgumentException,"e must be typeof IllegalArgumentException");
196+
}
197+
}
181198
}

0 commit comments

Comments
 (0)