Skip to content

更新最新代码 #10

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 18 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9850151
:bug: #1856 【微信支付】修复电商收付通查询退款状态的接口地址
f00lish Nov 6, 2020
3b43911
:art: #1857 【企业微信】获取获取部门成员详情接口返回值增加第三方应用专有的open_userid字段
binarywang Nov 8, 2020
6037002
:bookmark: 发布 3.9.8.B 测试版本
binarywang Nov 8, 2020
bf4c8c2
:art: 修复out_trade_no 字段命名不规范问题
Pancratius Nov 10, 2020
e912587
:memo: add more cases
binarywang Nov 10, 2020
4af70b2
:bug: #1861【微信支付】支付分后付费项目请求类的amount属性改为Integer,允许为空
winter4666 Nov 10, 2020
f301912
:bug: #1864 【微信支付】WxPayConfig类的hashCode和equals方法移除 verifier 字段
xJoeWoo Nov 11, 2020
edc04cb
:new: #1863 【小程序】增加删除直播间、编辑直播间、获取直播间推流地址、获取直播间分享二维码等接口
lipengjun92 Nov 11, 2020
a2074a4
:art: #1867【企业微信】优化完善第三方应用的接入代码
xworks Nov 12, 2020
c605330
:new: #1869 【小程序】增加管理直播间小助手的相关接口
GaoMinzhu Nov 13, 2020
30aca49
:new: #1868 【微信支付】增加通用上传图片接口,支持传入流和文件名参数
f00lish Nov 13, 2020
6d556f8
:art: 优化代码,部分类增加序列化接口实现
binarywang Nov 14, 2020
5986698
:art: 增加点单元测试示例代码
binarywang Nov 15, 2020
384dd35
:bookmark: 发布 3.9.9.B 测试版本
binarywang Nov 15, 2020
940f69a
:arrow_up: 升级xstream版本
binarywang Nov 16, 2020
64d67bb
:arrow_up: Bump xstream
dependabot[bot] Nov 17, 2020
c80e77c
:new: #1873 【企业微信】第三方应用增加网页授权登陆获取访问用户身份和获取访问用户敏感信息的接口
huangxm129 Nov 17, 2020
b351ef7
:bug: 修复字段错误问题
binarywang Nov 17, 2020
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
- 维沃吼吼
- 王朝社区(比亚迪新能源社区)
- 极吼吼手机上门回收换新
- 未来信封


#### 公众号:
Expand All @@ -138,6 +139,7 @@
- YshopMall
- 好行景区直通车以及全国40多个公众号
- 我奥篮球公众号
- 未来信封官微

#### 企业号/企业微信:
- HTC企业微信
Expand Down
2 changes: 1 addition & 1 deletion others/weixin-java-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10-java7</version>
<version>1.4.13-java7</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
4 changes: 2 additions & 2 deletions 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.7.B</version>
<version>3.9.9.B</version>
<packaging>pom</packaging>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
Expand Down Expand Up @@ -177,7 +177,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.11.1</version>
<version>1.4.14</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.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.7.B</version>
<version>3.9.9.B</version>
</parent>

<artifactId>weixin-java-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package me.chanjar.weixin.common.util.xml;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.thoughtworks.xstream.converters.basic.StringConverter;


/**
* String 数组转换
* @author chily.lin
*/
public class StringArrayConverter extends StringConverter {
@Override
public boolean canConvert(Class type) {
return type == String[].class;
}

@Override
public String toString(Object obj) {
return "<![CDATA[" + Joiner.on(",").join((String[]) obj) + "]]>";
}

@Override
public Object fromString(String str) {
final Iterable<String> iterable = Splitter.on(",").split(str);
String[] results = Iterables.toArray(iterable, String.class);
return results;
}
}
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.7.B</version>
<version>3.9.9.B</version>
</parent>

<artifactId>weixin-java-cp</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,24 @@ public interface WxCpUserService {
* </pre>
*
* @param userId 用户id
* @throws WxErrorException the wx error exception
*/
void authenticate(String userId) throws WxErrorException;

/**
* <pre>
* 获取部门成员(详情).
* 获取部门成员详情
* 请求方式:GET(HTTPS)
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD
*
* http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E8.8E.B7.E5.8F.96.E9.83.A8.E9.97.A8.E6.88.90.E5.91.98.28.E8.AF.A6.E6.83.85.29
* 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/90201
* </pre>
*
* @param departId 必填。部门id
* @param fetchChild 非必填。1/0:是否递归获取子部门下面的成员
* @param status 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加
* @return the list
* @throws WxErrorException the wx error exception
*/
List<WxCpUser> listByDepartment(Long departId, Boolean fetchChild, Integer status) throws WxErrorException;

Expand All @@ -51,20 +56,24 @@ public interface WxCpUserService {
* @param departId 必填。部门id
* @param fetchChild 非必填。1/0:是否递归获取子部门下面的成员
* @param status 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加
* @return the list
* @throws WxErrorException the wx error exception
*/
List<WxCpUser> listSimpleByDepartment(Long departId, Boolean fetchChild, Integer status) throws WxErrorException;

/**
* 新建用户.
*
* @param user 用户对象
* @throws WxErrorException the wx error exception
*/
void create(WxCpUser user) throws WxErrorException;

/**
* 更新用户.
*
* @param user 用户对象
* @throws WxErrorException the wx error exception
*/
void update(WxCpUser user) throws WxErrorException;

Expand All @@ -75,13 +84,16 @@ public interface WxCpUserService {
* </pre>
*
* @param userIds 员工UserID列表。对应管理端的帐号
* @throws WxErrorException the wx error exception
*/
void delete(String... userIds) throws WxErrorException;

/**
* 获取用户.
*
* @param userid 用户id
* @return the by id
* @throws WxErrorException the wx error exception
*/
WxCpUser getById(String userid) throws WxErrorException;

Expand All @@ -97,6 +109,8 @@ public interface WxCpUserService {
* @param userIds 成员ID列表, 最多支持1000个。
* @param partyIds 部门ID列表,最多支持100个。
* @param tagIds 标签ID列表,最多支持100个。
* @return the wx cp invite result
* @throws WxErrorException the wx error exception
*/
WxCpInviteResult invite(List<String> userIds, List<String> partyIds, List<String> tagIds) throws WxErrorException;

Expand All @@ -114,9 +128,8 @@ public interface WxCpUserService {
*
* @param userId 企业内的成员id
* @param agentId 非必填,整型,仅用于发红包。其它场景该参数不要填,如微信支付、企业转账、电子发票
* @return map对象,可能包含以下值:
* - openid 企业微信成员userid对应的openid,若有传参agentid,则是针对该agentid的openid。否则是针对企业微信corpid的openid
* - appid 应用的appid,若请求包中不包含agentid则不返回appid。该appid在使用微信红包时会用到
* @return map对象 ,可能包含以下值: - openid 企业微信成员userid对应的openid,若有传参agentid,则是针对该agentid的openid。否则是针对企业微信corpid的openid - appid 应用的appid,若请求包中不包含agentid则不返回appid。该appid在使用微信红包时会用到
* @throws WxErrorException the wx error exception
*/
Map<String, String> userId2Openid(String userId, Integer agentId) throws WxErrorException;

Expand All @@ -134,6 +147,7 @@ public interface WxCpUserService {
*
* @param openid 在使用微信支付、微信红包和企业转账之后,返回结果的openid
* @return userid 该openid在企业微信对应的成员userid
* @throws WxErrorException the wx error exception
*/
String openid2UserId(String openid) throws WxErrorException;

Expand All @@ -149,7 +163,7 @@ public interface WxCpUserService {
* </pre>
*
* @param mobile 手机号码。长度为5~32个字节
* @return userid mobile对应的成员userid
* @return userid mobile对应的成员userid
* @throws WxErrorException .
*/
String getUserId(String mobile) throws WxErrorException;
Expand All @@ -164,7 +178,7 @@ public interface WxCpUserService {
* </pre>
*
* @param userId 外部联系人的userid
* @return 联系人详情
* @return 联系人详情 external contact
* @throws WxErrorException .
*/
WxCpExternalContactInfo getExternalContact(String userId) throws WxErrorException;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package me.chanjar.weixin.cp.bean;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

/**
*
* @author huangxiaoming
*/
@Data
public class WxCpTpUserDetail extends WxCpBaseResp {

private static final long serialVersionUID = -5028321625140879571L;
/**
* 用户所属企业的corpid
*/
@SerializedName("corpid")
private String corpId;

/**
* 成员UserID
*/
@SerializedName("userid")
private String userId;

/**
* 成员姓名
*/
@SerializedName("name")
private String name;

/**
* 性别。0表示未定义,1表示男性,2表示女性
*/
@SerializedName("gender")
private String gender;

/**
* 头像url。仅在用户同意snsapi_privateinfo授权时返回
*/
@SerializedName("avatar")
private String avatar;

/**
* 员工个人二维码(扫描可添加为外部联系人),仅在用户同意snsapi_privateinfo授权时返回
*/
@SerializedName("qr_code")
private String qrCode;

public static WxCpTpUserDetail fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserDetail.class);
}

public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package me.chanjar.weixin.cp.bean;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

/**
* @author huangxiaoming
*/
@Data
public class WxCpTpUserInfo extends WxCpBaseResp {

private static final long serialVersionUID = -5028321625140879571L;

/**
* 用户所属企业的corpid
*/
@SerializedName("CorpId")
private String corpId;

/**
* 用户在企业内的UserID,如果该企业与第三方应用有授权关系时,返回明文UserId,否则返回密文UserId
*/
@SerializedName("UserId")
private String userId;

/**
* 手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响)
*/
@SerializedName("DeviceId")
private String deviceId;

/**
* 成员票据,最大为512字节。
* scope为snsapi_userinfo或snsapi_privateinfo,且用户在应用可见范围之内时返回此参数。
* 后续利用该参数可以获取用户信息或敏感信息,参见:https://work.weixin.qq.com/api/doc/90001/90143/91122
*/
@SerializedName("user_ticket")
private String userTicket;

/**
* user_ticket的有效时间(秒),随user_ticket一起返回
*/
@SerializedName("expires_in")
private String expiresIn;

/**
* 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取
*/
@SerializedName("open_userid")
private String openUserId;

public static WxCpTpUserInfo fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserInfo.class);
}

public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class WxCpUser implements Serializable {
private String avatar;
private String thumbAvatar;
private String mainDepartment;
/**
* 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取
*/
private String openUserId;

/**
* 地址。长度最大128个字符
Expand Down
Loading