Visitar URL original
merge Develop by binarywang · Pull Request #14 · binarywang/WxJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6b2e858
版本号更新为1.3.6-SNAPSHOT
binarywang Jun 30, 2016
a21f152
单元测试中去掉不必要的组依赖
binarywang Jul 4, 2016
8b1f026
修复一些warning
binarywang Jul 4, 2016
1ebcd9c
添加几个依赖,并格式化parent pom文件
binarywang Jul 4, 2016
e169bcc
添加多客服中客服管理的6个接口
binarywang Jul 4, 2016
244df15
重命名客服接口获取方法名称,保证统一
binarywang Jul 5, 2016
f902281
简化优化客服相关接口代码
binarywang Jul 5, 2016
29cfa77
优化客服管理接口的单元测试
binarywang Jul 5, 2016
d29cc98
初步实现一个使用Spring框架的Demo Web模块
binarywang Jul 6, 2016
f73a3d8
将demo移出子模块,以避免不必要的发布生成
binarywang Jul 6, 2016
ab8850c
jetty版本号提出来配置
binarywang Jul 7, 2016
79a41e9
部分代码优化调整
binarywang Jul 7, 2016
1bf35b9
部分代码优化调整
binarywang Jul 7, 2016
62988c1
部分代码优化调整
binarywang Jul 7, 2016
9d2923e
完善Demo,保证其中一个公众号可以正常使用,close #7
binarywang Jul 8, 2016
c16e2fb
更新注释
binarywang Jul 8, 2016
2ea838f
添加客服会话管理的三个事件
binarywang Jul 8, 2016
3ab7e66
微信消息里增加客服会话管理的三个字段
binarywang Jul 8, 2016
06a3ed1
demo中增加对客服会话管理的支持
binarywang Jul 8, 2016
5d96b00
去掉父类已存在的多余的log
binarywang Jul 8, 2016
9ad2283
修正几种菜单按钮类型的命名,保持统一
binarywang Jul 10, 2016
04b3d59
增加菜单按钮类型
kareanyi Jul 11, 2016
2923512
提取pom版本号为配置项,并提升其版本号
binarywang Jul 11, 2016
065156e
换用jdk7自带charset常量类
binarywang Jul 11, 2016
0c2768d
实现多客服会话控制的接口
binarywang Jul 12, 2016
5d95758
修复一些warning,尤其是导致打包warning的不规范或不必要的javadoc
binarywang Jul 12, 2016
55e0653
修复更多的warning,尤其是导致打包warning的不规范或不必要的javadoc
binarywang Jul 12, 2016
754e09e
更新规范单元测试类的命名
binarywang Jul 12, 2016
3534234
按照最新文档对客服管理接口进行修正
binarywang Jul 12, 2016
78f44b2
按照最新微信官方文档对客服会话控制接口进行修正
binarywang Jul 12, 2016
560ae27
修复部分javadoc
binarywang Jul 12, 2016
c13b8ac
修复handler为空时导致的bug
binarywang Jul 13, 2016
42ce9a1
demo 增加对aes消息加密的支持
binarywang Jul 13, 2016
72c46d1
按照最新微信官方文档对客服会话控制接口进行修正
binarywang Jul 13, 2016
95cf37b
加入微信接口中时间类型的序列化转换类,供转换json使用
binarywang Jul 13, 2016
0c723bb
微信消息类型增加小视频的类型
binarywang Jul 15, 2016
c040ba3
增加查看客服聊天记录的接口 #5
binarywang Jul 18, 2016
21dcf17
增加获取客服聊天记录的重载方法,方便一次性获取一定时间间隔内的所有聊天记录
binarywang Jul 18, 2016
48f032c
修正部分代码
binarywang Jul 18, 2016
34d4fa5
编译打包时默认跳过test
binarywang Jul 18, 2016
fe9ed76
去掉有问题的依赖
binarywang Jul 19, 2016
ff80104
清理一些代码
binarywang Jul 19, 2016
b88560d
发送客服消息接口支持以某个客服的名义发送消息
binarywang Jul 19, 2016
fd38444
修复微信的接口格式混乱导致重构代码有问题的问题
binarywang Jul 19, 2016
b033490
Update WxLongTimeJsonSerializer.java
binarywang Jul 20, 2016
73bf3b0
重构代码,将素材管理相关的接口移到单独一个类中管理
binarywang Jul 21, 2016
a3fcaa0
一些小的代码调整
binarywang Jul 21, 2016
175bf9b
重构代码,将菜单管理相关的接口移到单独一个类中管理
binarywang Jul 21, 2016
fcbdc86
重构代码,将用户管理、分组管理以及二维码相关的接口分别移到单独类中管理
binarywang Jul 21, 2016
1d2f2e2
修复接口重构后的相关代码
binarywang Jul 21, 2016
bcbc10d
修复错误重构的代码,主要是api的url地址
binarywang Jul 22, 2016
d8828a2
重构包结构,实现类统一放入impl包中
binarywang Jul 22, 2016
c8c0284
版本号更新为 2.0.0-SNAPSHOT
binarywang Jul 22, 2016
2207497
修复部分单词的拼写错误
binarywang Jul 22, 2016
b8dbf70
Merge branch 'master' into develop
binarywang Jul 22, 2016
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
Prev Previous commit
Next Next commit
按照最新文档对客服管理接口进行修正
  • Loading branch information
binarywang committed Jul 12, 2016
commit 3534234d917b883266fc88ba00fccb3ace97bb5e
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface WxMpKefuService {
/**
* <pre>
* 获取客服基本信息
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN
* </pre>
*/
Expand All @@ -33,7 +33,7 @@ public interface WxMpKefuService {
/**
* <pre>
* 获取在线客服接待信息
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN
* </pre>
*/
Expand All @@ -42,25 +42,34 @@ public interface WxMpKefuService {
/**
* <pre>
* 添加客服账号
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN
* </pre>
*/
boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException;

/**
* <pre>
* 设置客服信息(更新)
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 设置客服信息(即更新客服信息)
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/update?access_token=ACCESS_TOKEN
* </pre>
*/
boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException;

/**
* <pre>
* 设置客服信息(即更新客服信息)
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/inviteworker?access_token=ACCESS_TOKEN
* </pre>
*/
boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException;

/**
* <pre>
* 上传客服头像
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
* </pre>
*/
Expand All @@ -70,7 +79,7 @@ boolean kfAccountUploadHeadImg(String kfAccount, File imgFile)
/**
* <pre>
* 删除客服账号
* 详情请见:<a href="http://mp.weixin.qq.com/wiki/18/749901f4e123170fb8a4d447ae6040ba.html">客服管理</a>
* 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
* 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
* </pre>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ public boolean kfAccountUpdate(WxMpKfAccountRequest request)
return true;
}

@Override
public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException {
String url = "https://api.weixin.qq.com/customservice/kfaccount/inviteworker";
this.wxMpService.execute(new SimplePostRequestExecutor(), url,
request.toJson());
return true;
}

@Override
public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile)
throws WxErrorException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@ public class WxMpKfAccountRequest implements Serializable {
*/
@SerializedName("nickname")
private String nickName;

/**
* password 客服账号登录密码,格式为密码明文的32位加密MD5值
*/
@SerializedName("password")
private String password;


/**
* rawPassword 客服账号登录密码,明文密码,仅用于辅助操作
* invite_wx 接收绑定邀请的客服微信号
*/
@SerializedName("rawPassword")
private String rawPassword;
@SerializedName("invite_wx")
private String inviteWx;

@Override
public String toString() {
Expand All @@ -61,31 +55,22 @@ public void setNickName(String nickName) {
this.nickName = nickName;
}

public String getPassword() {
return this.password;
}

public void setPassword(String password) {
this.password = password;
}

public String getRawPassword() {
return this.rawPassword;
public static Builder builder() {
return new Builder();
}

public void setRawPassword(String rawPassword) {
this.rawPassword = rawPassword;
public String getInviteWx() {
return this.inviteWx;
}

public static Builder builder() {
return new Builder();
public void setInviteWx(String inviteWx) {
this.inviteWx = inviteWx;
}

public static class Builder {
private String kfAccount;
private String nickName;
private String password;
private String rawPassword;
private String inviteWx;

@SuppressWarnings("hiding")
public Builder kfAccount(String kfAccount) {
Expand All @@ -100,32 +85,23 @@ public Builder nickName(String nickName) {
}

@SuppressWarnings("hiding")
public Builder password(String password) {
this.password = password;
return this;
}

@SuppressWarnings("hiding")
public Builder rawPassword(String rawPassword) {
this.rawPassword = rawPassword;
this.password(Md5Crypt.md5Crypt(rawPassword.getBytes()));
return this;
public Builder inviteWx(String inviteWx) {
this.inviteWx = inviteWx;
return this;
}

public Builder from(WxMpKfAccountRequest origin) {
this.kfAccount(origin.kfAccount);
this.nickName(origin.nickName);
this.password(origin.password);
this.rawPassword(origin.rawPassword);
this.inviteWx(origin.inviteWx);
return this;
}

public WxMpKfAccountRequest build() {
WxMpKfAccountRequest m = new WxMpKfAccountRequest();
m.kfAccount = this.kfAccount;
m.nickName = this.nickName;
m.password = this.password;
m.rawPassword = this.rawPassword;
m.inviteWx = this.inviteWx;
return m;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,34 @@ public class WxMpKfInfo implements Serializable {
private String nick;

/**
* status 客服在线状态 1:pc在线,2:手机在线。若pc和手机同时在线则为 1+2=3
* kf_wx 如果客服帐号已绑定了客服人员微信号,则此处显示微信号
*/
@SerializedName("status")
private Integer status;
@SerializedName("kf_wx")
private String wxAccount;

/**
* auto_accept 客服设置的最大自动接入数
* invite_wx 如果客服帐号尚未绑定微信号,但是已经发起了一个绑定邀请,则此处显示绑定邀请的微信号
*/
@Expose
@SerializedName("auto_accept")
private Integer autoAccept;
@SerializedName("invite_wx")
private String inviteWx;

/**
* invite_expire_time 如果客服帐号尚未绑定微信号,但是已经发起过一个绑定邀请,则此处显示为邀请的过期时间,为unix 时间戳
*/
@SerializedName("invite_expire_time")
private Long inviteExpireTime;

/**
* invite_status 邀请的状态,有等待确认“waiting”,被拒绝“rejected”,过期“expired”
*/
@SerializedName("invite_status")
private String inviteStatus;

/**
* status 客服在线状态,目前为:1、web 在线
*/
@SerializedName("status")
private Integer status;

/**
* accepted_case 客服当前正在接待的会话数
Expand All @@ -68,14 +85,6 @@ public void setStatus(Integer status) {
this.status = status;
}

public Integer getAutoAccept() {
return this.autoAccept;
}

public void setAutoAccept(Integer autoAccept) {
this.autoAccept = autoAccept;
}

public Integer getAcceptedCase() {
return this.acceptedCase;
}
Expand Down Expand Up @@ -120,4 +129,36 @@ public void setNick(String nick) {
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}

public String getWxAccount() {
return this.wxAccount;
}

public void setWxAccount(String wxAccount) {
this.wxAccount = wxAccount;
}

public String getInviteWx() {
return this.inviteWx;
}

public void setInviteWx(String inviteWx) {
this.inviteWx = inviteWx;
}

public Long getInviteExpireTime() {
return this.inviteExpireTime;
}

public void setInviteExpireTime(Long inviteExpireTime) {
this.inviteExpireTime = inviteExpireTime;
}

public String getInviteStatus() {
return this.inviteStatus;
}

public void setInviteStatus(String inviteStatus) {
this.inviteStatus = inviteStatus;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,26 @@ public Object[][] getKfAccount() {
@Test(dataProvider = "getKfAccount")
public void testKfAccountAdd(String kfAccount) throws WxErrorException {
WxMpKfAccountRequest request = WxMpKfAccountRequest.builder()
.kfAccount(kfAccount).nickName("我晕").rawPassword("123").build();
.kfAccount(kfAccount).nickName("我晕").build();
Assert.assertTrue(this.wxService.getKefuService().kfAccountAdd(request));
}

@Test(dependsOnMethods = {
"testKfAccountAdd" }, dataProvider = "getKfAccount")
public void testKfAccountUpdate(String kfAccount) throws WxErrorException {
WxMpKfAccountRequest request = WxMpKfAccountRequest.builder()
.kfAccount(kfAccount).nickName("我晕").rawPassword("123").build();
.kfAccount(kfAccount).nickName("我晕").build();
Assert.assertTrue(this.wxService.getKefuService().kfAccountUpdate(request));
}

@Test(dependsOnMethods = {
"testKfAccountAdd" }, dataProvider = "getKfAccount")
public void testKfAccountInviteWorker(String kfAccount) throws WxErrorException {
WxMpKfAccountRequest request = WxMpKfAccountRequest.builder()
.kfAccount(kfAccount).inviteWx("www_ucredit_com").build();
Assert.assertTrue(this.wxService.getKefuService().kfAccountInviteWorker(request));
}

@Test(dependsOnMethods = {
"testKfAccountUpdate" }, dataProvider = "getKfAccount")
public void testKfAccountUploadHeadImg(String kfAccount)
Expand Down