|
|
|
@ -35,6 +35,7 @@ public class CamelRouter extends RouteBuilder {
|
|
|
|
|
|
|
|
|
|
@PostConstruct
|
|
|
|
|
private void init() {
|
|
|
|
|
org.apache.ibatis.logging.LogFactory.useSlf4jLogging();
|
|
|
|
|
jdbcTemplate.execute(createUserSql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -73,8 +74,8 @@ public class CamelRouter extends RouteBuilder {
|
|
|
|
|
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findUsers"))
|
|
|
|
|
.to("mybatis:com.example.sbcamel.mapper.UserMapper.findUsers?statementType=SelectList")
|
|
|
|
|
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findUser"))
|
|
|
|
|
.to("mybatis:com.example.sbcamel.mapper.UserMapper.findUser?statementType=SelectOne").end().marshal()
|
|
|
|
|
.json(JsonLibrary.Jackson);
|
|
|
|
|
.to("mybatis:com.example.sbcamel.mapper.UserMapper.findUser?statementType=SelectOne")
|
|
|
|
|
.end().marshal().json(JsonLibrary.Jackson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|