Skip to content

同步最新代码 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 代码贡献指南
1. 首先非常欢迎和感谢对本项目发起Pull Request的同学
1. **特别提示:请务必在develop分支提交PR,master分支目前仅是正式版的代码,即发布正式版本后才会从develop分支进行合并。**
1. 首先非常欢迎和感谢对本项目发起`Pull Request`的同学
1. **特别提示:请务必在 `develop` 分支提交 `PR`,`release` 分支目前仅是正式版的代码,即发布正式版本后才会从 `develop` 分支进行合并。**
1. 本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
1. 为了便于设置,本项目引入editorconfig支持,请使用Eclipse的同学在贡献代码前安装相关插件,而IntelliJ IDEA新版本自带支持,如果没有可自行安装插件。
1. 为了便于设置,本项目引入`editorconfig`支持,请使用Eclipse的同学在贡献代码前安装相关插件,而`IntelliJ IDEA`新版本自带支持,如果没有可自行安装插件。
1. **提交代码前,请检查代码是否已经格式化,并且保证新增加或者修改的方法都有完整的参数说明,而public方法必须拥有相应的单元测试并通过测试。**
1. 本项目可以采用两种方式接受代码贡献:
- 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文,推荐使用此种方式贡献代码。
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</table>

### 重要信息
1. **2020-08-24 发布 [【3.9.0正式版】](https://mp.weixin.qq.com/s/1YvMLcSOzhDHhIeX1bLRuQ)**!
1. **2020-08-24 发布 [【3.9.0正式版】](https://mp.weixin.qq.com/s/xkT7P79SVwkpk85d-2fCUw)**!
1. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;另外微信开发新手请务必阅读[【开发文档 Wiki 首页】](https://github.com/Wechat-Group/WxJava/wiki)的常见问题部分,可以少走很多弯路,节省不少时间。
1. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
1. 付费QQ群:(**注意:刚入群会有5分钟禁言,稍等片刻即可正常发言**) [![加入QQ群](https://img.shields.io/badge/QQ群-343954419-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=731dc3e7ea31ebe25376cc1a791445468612c63fd0e9e05399b088ec81fd9e15) 或 [![加入QQ群](https://img.shields.io/badge/QQ群-343954419-blue.svg)](http://jq.qq.com/?_wv=1027&k=40lRskK),或者请自行搜索群号`343954419`进行添加;当然由于某种原因无法入群的,可关注公众号后获取其他群的加入方式;
Expand All @@ -52,7 +52,7 @@
1. 如有新功能需求,发现BUG,或者由于微信官方接口调整导致的代码问题,可以直接在[【Issues】](https://github.com/Wechat-Group/WxJava/issues)页提出issue,便于讨论追踪问题;
1. 如果需要贡献代码,请务必在提交PR之前先仔细阅读[【代码贡献指南】](CONTRIBUTING.md),谢谢理解配合;
1. 目前本`SDK`最新版本要求的`JDK`最低版本是`8`,使用`7`的同学可以使用`WxJava` `3.8.0`及以前版本,而还在使用`JDK`6的用户请参考[【此项目】]( https://github.com/binarywang/weixin-java-tools-for-jdk6) ,而其他更早的JDK版本则需要自己改造实现。
1. [开源中国本项目的首页](https://www.oschina.net/p/weixin-java-tools-new),欢迎大家积极留言评分 🙂
1. [本项目在开源中国的页面](https://www.oschina.net/p/weixin-java-tools-new),欢迎大家积极留言评分 🙂
1. SDK开发文档请查阅 [【开发文档Wiki】](https://github.com/wechat-group/WxJava/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
1. **如果本开发工具包对您有所帮助,欢迎对我们的努力进行肯定,可以直接前往[【托管于码云的项目首页】](http://gitee.com/binary/weixin-java-tools),在页尾部分找到“捐助”按钮进行打赏,多多益善 😄。非常感谢各位打赏和捐助的同学!**
1. 各个模块的Javadoc可以在线查看:[weixin-java-miniapp](http://binary.ac.cn/weixin-java-miniapp-javadoc/)、[weixin-java-pay](http://binary.ac.cn/weixin-java-pay-javadoc/)、[weixin-java-mp](http://binary.ac.cn/weixin-java-mp-javadoc/)、[weixin-java-common](http://binary.ac.cn/weixin-java-common-javadoc/)、[weixin-java-cp](http://binary.ac.cn/weixin-java-cp-javadoc/)、[weixin-java-open](http://binary.ac.cn/weixin-java-open-javadoc/)
Expand Down
4 changes: 2 additions & 2 deletions demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### `Spring Boot Starter` 实现
- 微信支付:[点击查看使用方法](https://github.com/Wechat-Group/WxJava/tree/master/spring-boot-starters/wx-java-pay-spring-boot-starter)
- 微信公众号:[点击查看使用方法](https://github.com/Wechat-Group/WxJava/tree/master/spring-boot-starters/wx-java-mp-spring-boot-starter)
- 微信公众号:[点击查看使用方法](https://github.com/Wechat-Group/WxJava/tree/master/spring-boot-starters/wx-java-mp-spring-boot-starter) ,[使用该 starter 实现的公众号 Demo](https://github.com/binarywang/wx-java-mp-demo) [![Build Status](https://travis-ci.org/binarywang/wx-java-mp-demo.svg?branch=master)](https://travis-ci.org/binarywang/wx-java-mp-demo)
- 微信小程序:[点击查看使用方法](https://github.com/Wechat-Group/WxJava/tree/master/spring-boot-starters/wx-java-miniapp-spring-boot-starter)

### Demo 列表
Expand All @@ -17,6 +17,6 @@
1. 开放平台 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-open-demo)、[码云](http://gitee.com/binary/weixin-java-open-demo) [![Build Status](https://travis-ci.org/Wechat-Group/weixin-java-open-demo.svg?branch=master)](https://travis-ci.org/Wechat-Group/weixin-java-open-demo)
1. 公众号 Demo:
- 使用 `Spring MVC` 实现的公众号 Demo:[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springmvc)、[码云](https://gitee.com/binary/weixin-java-mp-demo) [![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springmvc.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springmvc)
- 使用 `Spring Boot` 实现的公众号 Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springboot)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot) [![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot)
- 使用 `Spring Boot` 实现的公众号 Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springboot)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot) [![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot)
- 含公众号和部分微信支付代码的 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-demo-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc) [![Build Status](https://travis-ci.org/Wechat-Group/weixin-java-demo-springmvc.svg?branch=master)](https://travis-ci.org/Wechat-Group/weixin-java-demo-springmvc)

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
<packaging>pom</packaging>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-starters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>
<packaging>pom</packaging>
<artifactId>wx-java-spring-boot-starters</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
5 changes: 3 additions & 2 deletions spring-boot-starters/wx-java-mp-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
#wx.mp.hosts.mp-host=http://proxy.com/
```
3. 自动注入的类型
- `WxMpService`以及~~相关的服务类, 比如: `wxMpService.getXxxService`。~~
- `WxMpService`
- `WxMpConfigStorage`


4、参考demo:
https://github.com/binarywang/wx-java-mp-demo



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion weixin-graal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>

<artifactId>weixin-graal</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion weixin-java-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>

<artifactId>weixin-java-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.common.api;
package me.chanjar.weixin.common.service;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.api;
package me.chanjar.weixin.common.service;

import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.chanjar.weixin.common.api;
package me.chanjar.weixin.common.service;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.bean.ocr.WxOcrBankCardResult;
Expand Down
2 changes: 1 addition & 1 deletion weixin-java-cp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.5.B</version>
<version>3.9.6.B</version>
</parent>

<artifactId>weixin-java-cp</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,31 @@ public interface WxCpExternalContactService {
*/
WxCpUserExternalContactInfo getContactDetail(String userId) throws WxErrorException;

/**
* 批量获取客户详情.
* <pre>
*
* 企业/第三方可通过此接口获取指定成员添加的客户信息列表。
*
* 请求方式:POST(HTTPS)
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/batch/get_by_user?access_token=ACCESS_TOKEN
*
* 权限说明:
*
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?);
* 第三方/自建应用调用时,返回的跟进人follow_user仅包含应用可见范围之内的成员。
* </pre>
*
* @param userId 企业成员的userid,注意不是外部联系人的帐号
* @param cursor the cursor
* @param limit the limit
* @return wx cp user external contact batch info
* @throws WxErrorException .
*/
WxCpUserExternalContactBatchInfo getContactDetailBatch(String userId, String cursor,
Integer limit)
throws WxErrorException;

/**
* 修改客户备注信息.
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,27 @@ public WxCpUserExternalContactInfo getContactDetail(String userId) throws WxErro
return WxCpUserExternalContactInfo.fromJson(responseContent);
}

@Override
public WxCpUserExternalContactBatchInfo getContactDetailBatch(String userId,
String cursor,
Integer limit)
throws WxErrorException {
final String url =
this.mainService
.getWxCpConfigStorage()
.getApiUrl(GET_CONTACT_DETAIL_BATCH);
JsonObject json = new JsonObject();
json.addProperty("userid", userId);
if (StringUtils.isNotBlank(cursor)) {
json.addProperty("cursor", cursor);
}
if (limit != null) {
json.addProperty("limit", limit);
}
String responseContent = this.mainService.post(url, json.toString());
return WxCpUserExternalContactBatchInfo.fromJson(responseContent);
}

@Override
public void updateRemark(WxCpUpdateRemarkRequest request) throws WxErrorException {
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPDATE_REMARK);
Expand Down Expand Up @@ -162,10 +183,10 @@ public WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pa
if (ArrayUtils.isNotEmpty(userIds) || ArrayUtils.isNotEmpty(partyIds)) {
JsonObject ownerFilter = new JsonObject();
if (ArrayUtils.isNotEmpty(userIds)) {
json.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray());
ownerFilter.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray());
}
if (ArrayUtils.isNotEmpty(partyIds)) {
json.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray());
ownerFilter.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray());
}
json.add("owner_filter", ownerFilter);
}
Expand Down Expand Up @@ -212,10 +233,10 @@ public WxCpUserExternalGroupChatStatistic getGroupChatStatistic(Date startTime,
if (ArrayUtils.isNotEmpty(userIds) || ArrayUtils.isNotEmpty(partyIds)) {
JsonObject ownerFilter = new JsonObject();
if (ArrayUtils.isNotEmpty(userIds)) {
json.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray());
ownerFilter.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray());
}
if (ArrayUtils.isNotEmpty(partyIds)) {
json.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray());
ownerFilter.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray());
}
json.add("owner_filter", ownerFilter);
}
Expand Down
Loading