bug--代码规范优化,升级fastjson1.2.73
This commit is contained in:
@ -31,8 +31,7 @@ public class WxMaConfiguration {
|
||||
}
|
||||
@Autowired
|
||||
public WxMaConfiguration(RedisUtils redisUtils) {
|
||||
this.redisUtils = redisUtils;
|
||||
this.wxMaMessageHandler = wxMaMessageHandler;
|
||||
WxMaConfiguration.redisUtils = redisUtils;
|
||||
}
|
||||
|
||||
public static WxMaService getWxMaService() {
|
||||
@ -67,10 +66,10 @@ public class WxMaConfiguration {
|
||||
final WxMaMessageRouter router = new WxMaMessageRouter(service);
|
||||
router
|
||||
.rule().handler(wxMaMessageHandler).next()
|
||||
.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT).event(SystemConfigConstants.BINDSTATECHANGE).handler(bindstatechangeHandler).end();
|
||||
.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT).event(SystemConfigConstants.BINDSTATECHANGE).handler(BINDSTATECHANGE_HANDLER).end();
|
||||
return router;
|
||||
}
|
||||
private static final WxMaMessageHandler bindstatechangeHandler = (wxMessage, context, service, sessionManager) -> {
|
||||
private static final WxMaMessageHandler BINDSTATECHANGE_HANDLER = (wxMessage, context, service, sessionManager) -> {
|
||||
wxMessage.getFromUser();
|
||||
wxMessage.getContent();
|
||||
return null;
|
||||
|
@ -48,8 +48,9 @@ public class ExpressService implements Serializable {
|
||||
*/
|
||||
public String getVendorName(String vendorCode) {
|
||||
for (Map<String, String> item : properties.getVendors()) {
|
||||
if (item.get("code").equals(vendorCode))
|
||||
if (item.get("code").equals(vendorCode)) {
|
||||
return item.get("name");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -24,12 +24,14 @@ public class ExpressAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
public ExpressAutoConfiguration(RedisUtils redisUtil) {
|
||||
this.redisUtil = redisUtil;
|
||||
ExpressAutoConfiguration.redisUtil = redisUtil;
|
||||
}
|
||||
|
||||
public static ExpressService expressService() {
|
||||
ExpressService expressService = (ExpressService)redisUtil.get(ShopConstants.YSHOP_EXPRESS_SERVICE);
|
||||
if(expressService != null) return expressService;
|
||||
if(expressService != null) {
|
||||
return expressService;
|
||||
}
|
||||
|
||||
ExpressProperties properties = new ExpressProperties();
|
||||
String enable = redisUtil.getY("exp_enable");
|
||||
|
@ -26,8 +26,9 @@ public class JacksonUtil {
|
||||
try {
|
||||
node = mapper.readTree(body);
|
||||
JsonNode leaf = node.get(field);
|
||||
if (leaf != null)
|
||||
if (leaf != null) {
|
||||
return leaf.asText();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
@ -42,9 +43,10 @@ public class JacksonUtil {
|
||||
node = mapper.readTree(body);
|
||||
JsonNode leaf = node.get(field);
|
||||
|
||||
if (leaf != null)
|
||||
if (leaf != null) {
|
||||
return mapper.convertValue(leaf, new TypeReference<List<String>>() {
|
||||
});
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
@ -57,8 +59,9 @@ public class JacksonUtil {
|
||||
try {
|
||||
node = mapper.readTree(body);
|
||||
JsonNode leaf = node.get(field);
|
||||
if (leaf != null)
|
||||
if (leaf != null) {
|
||||
return leaf.asInt();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
@ -72,9 +75,10 @@ public class JacksonUtil {
|
||||
node = mapper.readTree(body);
|
||||
JsonNode leaf = node.get(field);
|
||||
|
||||
if (leaf != null)
|
||||
if (leaf != null) {
|
||||
return mapper.convertValue(leaf, new TypeReference<List<Integer>>() {
|
||||
});
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
@ -88,8 +92,9 @@ public class JacksonUtil {
|
||||
try {
|
||||
node = mapper.readTree(body);
|
||||
JsonNode leaf = node.get(field);
|
||||
if (leaf != null)
|
||||
if (leaf != null) {
|
||||
return leaf.asBoolean();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user