修复部分代码,使用apache commons里现成的工具方法
This commit is contained in:
@@ -12,7 +12,6 @@ import me.chanjar.weixin.common.session.StandardSessionManager;
|
|||||||
import me.chanjar.weixin.common.session.WxSession;
|
import me.chanjar.weixin.common.session.WxSession;
|
||||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
import me.chanjar.weixin.common.util.RandomUtils;
|
import me.chanjar.weixin.common.util.RandomUtils;
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
|
||||||
import me.chanjar.weixin.common.util.crypto.SHA1;
|
import me.chanjar.weixin.common.util.crypto.SHA1;
|
||||||
import me.chanjar.weixin.common.util.fs.FileUtils;
|
import me.chanjar.weixin.common.util.fs.FileUtils;
|
||||||
import me.chanjar.weixin.common.util.http.*;
|
import me.chanjar.weixin.common.util.http.*;
|
||||||
@@ -22,6 +21,7 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
|
|||||||
import me.chanjar.weixin.cp.bean.WxCpTag;
|
import me.chanjar.weixin.cp.bean.WxCpTag;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpUser;
|
import me.chanjar.weixin.cp.bean.WxCpUser;
|
||||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
import org.apache.http.client.ClientProtocolException;
|
import org.apache.http.client.ClientProtocolException;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ package me.chanjar.weixin.cp.util.json;
|
|||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
import me.chanjar.weixin.common.api.WxConsts;
|
import me.chanjar.weixin.common.api.WxConsts;
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
|
||||||
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
import me.chanjar.weixin.cp.bean.WxCpMessage;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package me.chanjar.weixin.cp.api;
|
package me.chanjar.weixin.cp.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.Guice;
|
import org.testng.annotations.Guice;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
|
||||||
|
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础API测试
|
* 基础API测试
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package me.chanjar.weixin.cp.demo;
|
package me.chanjar.weixin.cp.demo;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
|
||||||
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
|
import me.chanjar.weixin.cp.api.WxCpConfigStorage;
|
||||||
import me.chanjar.weixin.cp.api.WxCpMessageRouter;
|
import me.chanjar.weixin.cp.api.WxCpMessageRouter;
|
||||||
import me.chanjar.weixin.cp.api.WxCpService;
|
import me.chanjar.weixin.cp.api.WxCpService;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;
|
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpXmlOutMessage;
|
import me.chanjar.weixin.cp.bean.WxCpXmlOutMessage;
|
||||||
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
|
import me.chanjar.weixin.cp.util.crypto.WxCpCryptUtil;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Daniel Qian
|
* @author Daniel Qian
|
||||||
|
|||||||
Reference in New Issue
Block a user