Skip to content

Commit

Permalink
2.8.30
Browse files Browse the repository at this point in the history
  • Loading branch information
liyi committed Dec 11, 2019
2 parents 646afc7 + bc44ef1 commit 499b248
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ weixin-popular 已支持的微信平台
<dependency>
<groupId>com.github.liyiorg</groupId>
<artifactId>weixin-popular</artifactId>
<version>2.8.29</version>
<version>2.8.30</version>
</dependency>
```
* [升级注意事项](https://github.com/liyiorg/weixin-popular/wiki/jar_update)
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ WEIXIN-POPULAR CHANGELOG
===========================
https://github.com/liyiorg/weixin-popular

Changes in version 2.8.30 (2019-12-11)
-------------------------------------
* #210 SecapiPayProfitsharingfinishResult 缺少JAXB注解
# #220 WxaAPI 新增接口, 小程序审核撤回、小程序版本回退、生成临时小程序码接口

Changes in version 2.8.29 (2019-10-29)
-------------------------------------
* #215 添加HttpClient 代理配置
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.liyiorg</groupId>
<artifactId>weixin-popular</artifactId>
<version>2.8.29</version>
<version>2.8.30</version>

<name>weixin-popular</name>
<description>The weixin-popular is a JAVA SDK for weixin. Weixin web url is https://mp.weixin.qq.com.</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/weixin/popular/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface Version {

String VERSION = "2.8.29";
String VERSION = "2.8.30";
}
83 changes: 82 additions & 1 deletion src/main/java/weixin/popular/api/WxaAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

import javax.imageio.ImageIO;

Expand Down Expand Up @@ -273,6 +274,38 @@ public static BaseResult release(String access_token){
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
}

/**
* 代码管理<br>
* 小程序审核撤回(仅供第三方代小程序调用)
* @since 2.8.30
* @param access_token access_token
* @return result
*/
public static BaseResult undocodeaudit(String access_token) {
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setHeader(jsonHeader)
.setUri(BASE_URI + "/wxa/undocodeaudit")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
}

/**
* 代码管理<br>
* 小程序版本回退(仅供第三方代小程序调用)
* @since 2.8.30
* @param access_token access_token
* @return result
*/
public static BaseResult revertcoderelease(String access_token) {
HttpUriRequest httpUriRequest = RequestBuilder.get()
.setHeader(jsonHeader)
.setUri(BASE_URI + "/wxa/revertcoderelease")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
}

/**
* 代码管理<br>
Expand Down Expand Up @@ -364,7 +397,55 @@ public static BufferedImage getwxacodeunlimit(String access_token,Getwxacodeunli
}
return null;
}


/**
* 获取小程序码 B<br>
* 适用于需要的码数量极多,或仅临时使用的业务场景<br>
* 注意:通过该接口生成的小程序码,永久有效,数量暂无限制。用户扫描该码进入小程序后,将统一打开首页,开发者需在首页根据获取的码中 scene 字段的值,再做处理逻辑。
* @since 2.8.30
* @param access_token access_token
* @param getwxacodeunlimit getwxacodeunlimit
* @return WxaCodeResult WxaCodeResult
*/
public static WxaCodeResult getwxacodeunlimitresult(String access_token,Getwxacodeunlimit getwxacodeunlimit){
String json = JsonUtil.toJSONString(getwxacodeunlimit);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI + "/wxa/getwxacodeunlimit")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
.setEntity(new StringEntity(json,Charset.forName("utf-8")))
.build();
CloseableHttpResponse httpResponse = LocalHttpClient.execute(httpUriRequest);
try {
int status = httpResponse.getStatusLine().getStatusCode();
WxaCodeResult wxaCodeResult;
byte[] bytes = null;
if (status == 200) {
bytes = EntityUtils.toByteArray(httpResponse.getEntity());
BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(bytes));
if(bufferedImage != null) {
wxaCodeResult = new WxaCodeResult();
wxaCodeResult.setBufferedImage(bufferedImage);
return wxaCodeResult;
}
}
if (status >= 200 && status < 300 && bytes != null) {
String str = new String(bytes, StandardCharsets.UTF_8);
wxaCodeResult = JsonUtil.parseObject(str, WxaCodeResult.class);
return wxaCodeResult;
}
} catch (IOException e) {
logger.error("", e);
} finally {
try {
httpResponse.close();
} catch (IOException e) {
logger.error("", e);
}
}
return null;
}

/**
* 附近 添加地点
* @since 2.8.18
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package weixin.popular.bean.paymch;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class SecapiPayProfitsharingfinishResult extends MchBase {

private String transaction_id;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/weixin/popular/bean/wxa/WxaCodeResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package weixin.popular.bean.wxa;

import weixin.popular.bean.BaseResult;

import java.awt.image.BufferedImage;

public class WxaCodeResult extends BaseResult {

private BufferedImage bufferedImage;

public BufferedImage getBufferedImage() {
return bufferedImage;
}

public void setBufferedImage(BufferedImage bufferedImage) {
this.bufferedImage = bufferedImage;
}
}

0 comments on commit 499b248

Please sign in to comment.