将WxAccessToken放到common里

This commit is contained in:
Daniel Qian 2014-10-21 19:09:24 +08:00
parent 7becf8e4f2
commit 137601edee
29 changed files with 50 additions and 54 deletions

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.enterprise.bean; package me.chanjar.weixin.common.bean;
import me.chanjar.weixin.enterprise.util.json.WxCpGsonBuilder; import me.chanjar.weixin.enterprise.util.json.WxCpGsonBuilder;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common; package me.chanjar.weixin.common.util;
import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlAdapter;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common; package me.chanjar.weixin.common.util;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;

View File

@ -6,7 +6,7 @@
* arose from modification of the original source, or other redistribution of this source * arose from modification of the original source, or other redistribution of this source
* is not permitted without written permission of the KINGSTAR MEDIA SOLUTIONS LTD. * is not permitted without written permission of the KINGSTAR MEDIA SOLUTIONS LTD.
*/ */
package me.chanjar.weixin.common; package me.chanjar.weixin.common.util;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common; package me.chanjar.weixin.common.util;
import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlAdapter;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common; package me.chanjar.weixin.common.util;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.api; package me.chanjar.weixin.enterprise.api;
import me.chanjar.weixin.enterprise.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxAccessToken;
/** /**
* 微信客户端配置存储 * 微信客户端配置存储

View File

@ -8,6 +8,7 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.enterprise.bean.*; import me.chanjar.weixin.enterprise.bean.*;
import me.chanjar.weixin.enterprise.util.http.SimpleGetRequestExecutor; import me.chanjar.weixin.enterprise.util.http.SimpleGetRequestExecutor;
import me.chanjar.weixin.enterprise.util.crypto.SHA1; import me.chanjar.weixin.enterprise.util.crypto.SHA1;
@ -25,7 +26,7 @@ import me.chanjar.weixin.enterprise.bean.result.WxError;
import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult; import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.enterprise.bean.result.WxUser; import me.chanjar.weixin.enterprise.bean.result.WxUser;
import me.chanjar.weixin.enterprise.exception.WxErrorException; import me.chanjar.weixin.enterprise.exception.WxErrorException;
import me.chanjar.weixin.common.FileUtils; import me.chanjar.weixin.common.util.FileUtils;
import me.chanjar.weixin.enterprise.util.http.MediaDownloadRequestExecutor; import me.chanjar.weixin.enterprise.util.http.MediaDownloadRequestExecutor;
import me.chanjar.weixin.enterprise.util.http.MediaUploadRequestExecutor; import me.chanjar.weixin.enterprise.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.enterprise.util.http.RequestExecutor; import me.chanjar.weixin.enterprise.util.http.RequestExecutor;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.api; package me.chanjar.weixin.enterprise.api;
import me.chanjar.weixin.enterprise.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxAccessToken;
/** /**
* 基于内存的微信配置provider在实际生产环境中应该将这些配置持久化 * 基于内存的微信配置provider在实际生产环境中应该将这些配置持久化

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.enterprise.bean; package me.chanjar.weixin.enterprise.bean;
import me.chanjar.weixin.enterprise.api.WxCpConfigStorage; import me.chanjar.weixin.enterprise.api.WxCpConfigStorage;
import me.chanjar.weixin.common.AdapterCDATA; import me.chanjar.weixin.common.util.AdapterCDATA;
import me.chanjar.weixin.common.XmlTransformer; import me.chanjar.weixin.common.util.XmlTransformer;
import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil; import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts; import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.MediaIdMarshaller; import me.chanjar.weixin.common.util.MediaIdMarshaller;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -14,8 +14,8 @@ import me.chanjar.weixin.enterprise.bean.outxmlbuilder.TextBuilder;
import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VideoBuilder; import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VideoBuilder;
import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VoiceBuilder; import me.chanjar.weixin.enterprise.bean.outxmlbuilder.VoiceBuilder;
import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil; import me.chanjar.weixin.enterprise.util.crypto.WxCryptUtil;
import me.chanjar.weixin.common.AdapterCDATA; import me.chanjar.weixin.common.util.AdapterCDATA;
import me.chanjar.weixin.common.XmlTransformer; import me.chanjar.weixin.common.util.XmlTransformer;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -11,7 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts; import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA; import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts; import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA; import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts; import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.AdapterCDATA; import me.chanjar.weixin.common.util.AdapterCDATA;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import me.chanjar.weixin.enterprise.api.WxCpConsts; import me.chanjar.weixin.enterprise.api.WxCpConsts;
import me.chanjar.weixin.common.MediaIdMarshaller; import me.chanjar.weixin.common.util.MediaIdMarshaller;
@XmlRootElement(name = "xml") @XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)

View File

@ -15,7 +15,7 @@ import org.apache.http.entity.ContentType;
import me.chanjar.weixin.enterprise.bean.result.WxError; import me.chanjar.weixin.enterprise.bean.result.WxError;
import me.chanjar.weixin.enterprise.exception.WxErrorException; import me.chanjar.weixin.enterprise.exception.WxErrorException;
import me.chanjar.weixin.common.FileUtils; import me.chanjar.weixin.common.util.FileUtils;
/** /**
* 下载媒体文件请求执行器请求的参数是String, 返回的结果是File * 下载媒体文件请求执行器请求的参数是String, 返回的结果是File

View File

@ -9,8 +9,8 @@
package me.chanjar.weixin.enterprise.util.json; package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*; import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxAccessToken;
import java.lang.reflect.Type; import java.lang.reflect.Type;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxCpDepart; import me.chanjar.weixin.enterprise.bean.WxCpDepart;
import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializationContext;

View File

@ -3,6 +3,7 @@ package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.enterprise.bean.*; import me.chanjar.weixin.enterprise.bean.*;
import me.chanjar.weixin.enterprise.bean.result.*; import me.chanjar.weixin.enterprise.bean.result.*;

View File

@ -9,7 +9,7 @@
package me.chanjar.weixin.enterprise.util.json; package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*; import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult; import me.chanjar.weixin.enterprise.bean.result.WxMediaUploadResult;
import java.lang.reflect.Type; import java.lang.reflect.Type;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.WxCpMenu; import me.chanjar.weixin.enterprise.bean.WxCpMenu;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxUser; import me.chanjar.weixin.enterprise.bean.result.WxUser;
import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializationContext;

View File

@ -10,7 +10,7 @@ package me.chanjar.weixin.enterprise.util.json;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxUserList; import me.chanjar.weixin.enterprise.bean.result.WxUserList;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;

View File

@ -9,7 +9,7 @@
package me.chanjar.weixin.enterprise.util.json; package me.chanjar.weixin.enterprise.util.json;
import com.google.gson.*; import com.google.gson.*;
import me.chanjar.weixin.common.GsonHelper; import me.chanjar.weixin.common.util.GsonHelper;
import me.chanjar.weixin.enterprise.bean.result.WxError; import me.chanjar.weixin.enterprise.bean.result.WxError;
import java.lang.reflect.Type; import java.lang.reflect.Type;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.enterprise.bean; package me.chanjar.weixin.common.bean;
import me.chanjar.weixin.enterprise.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxAccessToken;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.Test; import org.testng.annotations.Test;

View File

@ -16,7 +16,7 @@ import com.google.inject.Inject;
*/ */
@Test(groups = "baseAPI") @Test(groups = "baseAPI")
@Guice(modules = ApiTestModule.class) @Guice(modules = ApiTestModule.class)
public class WxBaseAPITest { public class WxCpBaseAPITest {
@Inject @Inject
protected WxCpServiceImpl wxService; protected WxCpServiceImpl wxService;

View File

@ -18,8 +18,7 @@ import me.chanjar.weixin.enterprise.exception.WxErrorException;
* @author Daniel Qian * @author Daniel Qian
* *
*/ */
//@Test(groups="menuAPI", dependsOnGroups="baseAPI") @Test(groups="menuAPI", dependsOnGroups="baseAPI")
@Test
@Guice(modules = ApiTestModule.class) @Guice(modules = ApiTestModule.class)
public class WxCpMenuAPITest { public class WxCpMenuAPITest {

View File

@ -3,33 +3,28 @@
<suite name="Weixin-java-tool-suite" verbose="1"> <suite name="Weixin-java-tool-suite" verbose="1">
<test name="API_Test"> <test name="API_Test">
<classes> <classes>
<class name="WxBaseAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxCpBaseAPITest" />
<class name="WxCustomMessageAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxCpMessageAPITest" />
<class name="WxMenuAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxCpMenuAPITest" />
<class name="WxGroupAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxGroupAPITest" />
<class name="WxMassMessageAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxMediaAPITest" />
<class name="WxMediaAPITest" /> <class name="me.chanjar.weixin.enterprise.api.WxCpMessageRouterTest" />
<class name="WxUserAPITest" />
<class name="WxQrCodeAPITest" />
<class name="WxShortUrlAPITest" />
<class name="WxMessageRouterTest" />
</classes> </classes>
</test> </test>
<test name="Bean_Test"> <test name="Bean_Test">
<classes> <classes>
<class name="WxAccessTokenTest" /> <class name="me.chanjar.weixin.common.bean.WxAccessTokenTest" />
<class name="WxCustomMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpMessageTest" />
<class name="WxErrorTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxErrorTest" />
<class name="WxMenuTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpMenuTest" />
<class name="WxXmlMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlMessageTest" />
<class name="WxXmlOutImageMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutImageMessageTest" />
<class name="WxXmlOutMusicMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutNewsMessageTest" />
<class name="WxXmlOutNewsMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutVideoMessageTest" />
<class name="WxXmlOutVideoMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutVoiceMessageTest" />
<class name="WxXmlOutVoiceMessageTest" /> <class name="me.chanjar.weixin.enterprise.bean.WxCpXmlOutTextMessageTest" />
<class name="WxXmlOutTextMessageTest" /> <class name="me.chanjar.weixin.enterprise.util.crypto.WxCryptUtilTest" />
<class name="WxCryptUtilTest" />
</classes> </classes>
</test> </test>
</suite> </suite>