GetPropByPjProcessor.java 1.2 KB

12345678910111213141516171819202122232425262728
  1. package com.sagacloud.route.processors;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.sagacloud.cache.ProPasCache;
  4. import com.sagacloud.route.InitEnvRoute;
  5. import com.sagacloud.utils.Const;
  6. import org.apache.camel.Exchange;
  7. import org.apache.camel.Processor;
  8. /**
  9. * Created by Xiaoyu on 2018/7/12
  10. */
  11. public class GetPropByPjProcessor implements Processor {
  12. @Override
  13. public void process(Exchange exchange) throws Exception {
  14. String jsonStr = exchange.getIn().getBody(String.class);
  15. JSONObject json = JSONObject.parseObject(jsonStr);
  16. String projectId = json.getString(Const.HEADER_PROJECT);
  17. String secret = ProPasCache.getPjSecret(projectId);
  18. exchange.getIn().setBody("{\"venderInfo\":true,\"criteria\":{\"family\":[]}}");
  19. exchange.getIn().setHeader(Exchange.HTTP_CHARACTER_ENCODING, "UTF-8");
  20. // exchange.getIn().setBody("{\"criteria\":{\"family\":[]}}");
  21. exchange.getIn().setHeader(Exchange.HTTP_URI, Const.dataPlatform+"/property/relation_query?method=POST");
  22. exchange.getIn().setHeader(Exchange.HTTP_QUERY,Const.HEADER_PROJECT + "=" + projectId + "&"+ Const.HEADER_SECRET+ "="+ secret);
  23. System.out.println("进入C");
  24. }
  25. }