cheng029 发表于 2016-11-23 10:13:46

feilong

public void testJsonTest(){  
   CrmAddpointCommand crmAddpointCommand = new CrmAddpointCommand();
  

  
   crmAddpointCommand.setBuyerId("123456");
  
   crmAddpointCommand.setConsumptionChannel("feilongstore");
  
   crmAddpointCommand.setOpenId("feilong888888ky");
  
   crmAddpointCommand.setOrderCode("fl123456");
  

  
   //****************************************************************************************
  

  
   JsonFormatConfig jsonFormatConfig = new JsonFormatConfig();
  

  
   Map<Class<?>, PropertyNameProcessor> targetClassAndPropertyNameProcessorMap = newHashMap(1);
  
   targetClassAndPropertyNameProcessorMap.put(CrmAddpointCommand.class, CapitalizePropertyNameProcessor.INSTANCE);
  

  
   jsonFormatConfig.setJsonTargetClassAndPropertyNameProcessorMap(targetClassAndPropertyNameProcessorMap);
  

  
   LOGGER.debug(JsonUtil.format(crmAddpointCommand, jsonFormatConfig));
  
}
页: [1]
查看完整版本: feilong