|
@@ -5,6 +5,8 @@ import com.sagacloud.Exceptions.InvalidPostException;
|
|
|
import com.sagacloud.route.processors.GetInsuranceNoListProcessor;
|
|
|
import com.sagacloud.route.processors.GetPropByPjProcessor;
|
|
|
import com.sagacloud.utils.Const;
|
|
|
+import com.sagacloud.utils.VendersUtil;
|
|
|
+import org.apache.camel.Exchange;
|
|
|
import org.apache.camel.builder.RouteBuilder;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
@@ -68,18 +70,6 @@ public class Route extends RouteBuilder {
|
|
|
.route()
|
|
|
.process();
|
|
|
|
|
|
-// from("direct:getPropertiesByPj")
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- protected void configExceptionHandler(){
|
|
|
- onException(InvalidPostException.class).handled(true).process(new org.apache.camel.Processor() {
|
|
|
- @Override
|
|
|
- public void process(Exchange exchange) throws Exception {
|
|
|
- Exception exception = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
|
|
|
- exchange.getOut().setBody(VendersUtil.errorJsonMsg(exception.getMessage()));
|
|
|
- }
|
|
|
- });
|
|
|
//body位JSONObject,含有projectId字段
|
|
|
from("direct:getPropertiesByPj")
|
|
|
.process(new GetPropByPjProcessor())
|
|
@@ -92,5 +82,18 @@ public class Route extends RouteBuilder {
|
|
|
.produces(MediaType.APPLICATION_JSON)
|
|
|
.route()
|
|
|
.to("direct:getPropertiesByPj");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void configExceptionHandler(){
|
|
|
+ onException(InvalidPostException.class).handled(true).process(new org.apache.camel.Processor() {
|
|
|
+ @Override
|
|
|
+ public void process(Exchange exchange) throws Exception {
|
|
|
+ Exception exception = (Exception) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
|
|
|
+ exchange.getOut().setBody(VendersUtil.errorJsonMsg(exception.getMessage()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|