4 Commits

Author SHA1 Message Date
Daniel Qian
e84ca8dab9 Merge branch 'develop' 2015-03-23 11:09:32 +08:00
Daniel Qian
eccbf08809 Merge branch 'develop'
Conflicts:
	README.md
2015-03-23 11:07:58 +08:00
Daniel Qian
b2179faf3e fix README 2015-02-26 15:10:33 +08:00
Daniel Qian
0cd6033205 Merge branch 'develop' 2015-02-25 15:33:17 +08:00
10 changed files with 13 additions and 40 deletions

View File

@@ -17,7 +17,7 @@ weixin-java-tools
<dependency>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
</dependency>
```
@@ -27,7 +27,7 @@ weixin-java-tools
<dependency>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-cp</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
</dependency>
```

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
<packaging>pom</packaging>
<name>WeiXin Java Tools - Parent</name>
<description>微信公众号、企业号上级POM</description>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
</parent>
<artifactId>weixin-java-common</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
</parent>
<artifactId>weixin-java-cp</artifactId>

View File

@@ -7,7 +7,6 @@ import com.google.gson.JsonPrimitive;
import com.google.gson.internal.Streams;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.sun.media.sound.SoftTuning;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.bean.WxMenu;
@@ -47,7 +46,6 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.UUID;
@@ -447,7 +445,7 @@ public class WxCpServiceImpl implements WxCpService {
@Override
public String[] oauth2getUserInfo(String code) throws WxErrorException {
return oauth2getUserInfo(wxCpConfigStorage.getAgentId(), code);
return oauth2getUserInfo(code, wxCpConfigStorage.getAgentId());
}
@Override
@@ -628,12 +626,4 @@ public class WxCpServiceImpl implements WxCpService {
this.sessionManager = sessionManager;
}
public static void main(String[] args) {
Float a = 3.1f;
System.out.println(3.1d);
System.out.println(new BigDecimal(3.1d));
System.out.println(new BigDecimal(a));
System.out.println(a.toString());
System.out.println(a.doubleValue());
}
}

View File

@@ -34,7 +34,7 @@ public class WxCpMessageGsonAdapter implements JsonSerializer<WxCpMessage> {
messageJson.addProperty("toparty", message.getToParty());
}
if (StringUtils.isNotBlank(message.getToTag())) {
messageJson.addProperty("totag", message.getToTag());
messageJson.addProperty("totag", message.getToUser());
}
if (WxConsts.CUSTOM_MSG_TEXT.equals(message.getMsgType())) {
JsonObject text = new JsonObject();

View File

@@ -19,17 +19,17 @@ import java.lang.reflect.Type;
*/
public class WxCpTagGsonAdapter implements JsonSerializer<WxCpTag>, JsonDeserializer<WxCpTag> {
public JsonElement serialize(WxCpTag tag, Type typeOfSrc, JsonSerializationContext context) {
public JsonElement serialize(WxCpTag group, Type typeOfSrc, JsonSerializationContext context) {
JsonObject o = new JsonObject();
o.addProperty("tagid", tag.getId());
o.addProperty("tagname", tag.getName());
o.addProperty("tagid", group.getId());
o.addProperty("tagname", group.getName());
return o;
}
public WxCpTag deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
JsonObject jsonObject = json.getAsJsonObject();
return new WxCpTag(GsonHelper.getString(jsonObject, "tagid"), GsonHelper.getString(jsonObject, "tagname"));
return new WxCpTag(GsonHelper.getString(jsonObject, "tagid"), GsonHelper.getString(jsonObject, "name"));
}
}

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>me.chanjar</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.1.4</version>
<version>1.1.3</version>
</parent>
<artifactId>weixin-java-mp</artifactId>
<name>WeiXin Java Tools - MP</name>

View File

@@ -387,18 +387,6 @@ public interface WxMpService {
*/
public String oauth2buildAuthorizationUrl(String scope, String state);
/**
* <pre>
* 构造oauth2授权的url连接
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
* </pre>
* @param redirectURI
* 用户授权完成后的重定向链接无需urlencode, 方法内会进行encode
* @param scope
* @param state
* @return code
*/
public String oauth2buildAuthorizationUrl(String redirectURI, String scope, String state);
/**
* <pre>
* 用code换取oauth2的access token

View File

@@ -363,14 +363,9 @@ public class WxMpServiceImpl implements WxMpService {
@Override
public String oauth2buildAuthorizationUrl(String scope, String state) {
return this.oauth2buildAuthorizationUrl(wxMpConfigStorage.getOauth2redirectUri(), scope, state);
}
@Override
public String oauth2buildAuthorizationUrl(String redirectURI, String scope, String state) {
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?" ;
url += "appid=" + wxMpConfigStorage.getAppId();
url += "&redirect_uri=" + URIUtil.encodeURIComponent(redirectURI);
url += "&redirect_uri=" + URIUtil.encodeURIComponent(wxMpConfigStorage.getOauth2redirectUri());
url += "&response_type=code";
url += "&scope=" + scope;
if (state != null) {