mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
实现多客服会话控制的接口
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package me.chanjar.weixin.mp.bean.customerservice.request;
|
||||
package me.chanjar.weixin.mp.bean.kefu.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package me.chanjar.weixin.mp.bean.kefu.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
public class WxMpKfSessionRequest implements Serializable {
|
||||
private static final long serialVersionUID = -5451863610674856927L;
|
||||
|
||||
/**
|
||||
* kf_account 完整客服账号,格式为:账号前缀@公众号微信号
|
||||
*/
|
||||
@SerializedName("kf_account")
|
||||
private String kfAccount;
|
||||
|
||||
/**
|
||||
* openid 客户openid
|
||||
*/
|
||||
@SerializedName("openid")
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* text 附加信息,文本会展示在客服人员的多客服客户端
|
||||
* 目前看起来无用,主要是老版的多客服客户端使用
|
||||
*/
|
||||
@SerializedName("text")
|
||||
@Deprecated
|
||||
private String text;
|
||||
|
||||
public WxMpKfSessionRequest(String kfAccount, String openid, String text) {
|
||||
this.kfAccount = kfAccount;
|
||||
this.openid = openid;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
return WxMpGsonBuilder.INSTANCE.create().toJson(this);
|
||||
}
|
||||
|
||||
public String getKfAccount() {
|
||||
return this.kfAccount;
|
||||
}
|
||||
|
||||
public void setKfAccount(String kfAccount) {
|
||||
this.kfAccount = kfAccount;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package me.chanjar.weixin.mp.bean.customerservice.result;
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@@ -20,38 +21,38 @@ public class WxMpKfInfo implements Serializable {
|
||||
*/
|
||||
@SerializedName("kf_account")
|
||||
private String account;
|
||||
|
||||
|
||||
/**
|
||||
* kf_headimgurl 客服头像地址
|
||||
*/
|
||||
@SerializedName("kf_headimgurl")
|
||||
private String headImgUrl;
|
||||
|
||||
|
||||
/**
|
||||
* kf_id 客服工号
|
||||
*/
|
||||
@SerializedName("kf_id")
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* kf_nick 客服昵称
|
||||
*/
|
||||
@SerializedName("kf_nick")
|
||||
private String nick;
|
||||
|
||||
|
||||
/**
|
||||
* status 客服在线状态 1:pc在线,2:手机在线。若pc和手机同时在线则为 1+2=3
|
||||
*/
|
||||
@SerializedName("status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* auto_accept 客服设置的最大自动接入数
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("auto_accept")
|
||||
private Integer autoAccept;
|
||||
|
||||
|
||||
/**
|
||||
* accepted_case 客服当前正在接待的会话数
|
||||
* @return
|
||||
@@ -118,6 +119,6 @@ public class WxMpKfInfo implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package me.chanjar.weixin.mp.bean.customerservice.result;
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class WxMpKfList {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public List<WxMpKfInfo> getKfList() {
|
||||
@@ -1,8 +1,9 @@
|
||||
package me.chanjar.weixin.mp.bean.customerservice.result;
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class WxMpKfOnlineList {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public List<WxMpKfInfo> getKfOnlineList() {
|
||||
@@ -0,0 +1,61 @@
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
public class WxMpKfSession {
|
||||
/**
|
||||
* kf_account 正在接待的客服,为空表示没有人在接待
|
||||
*/
|
||||
@SerializedName("kf_account")
|
||||
private String kfAccount;
|
||||
|
||||
/**
|
||||
* createtime 会话接入的时间 或者 来访时间,UNIX时间戳
|
||||
*/
|
||||
@SerializedName("createtime")
|
||||
private long createTime;
|
||||
|
||||
/**
|
||||
* openid 客户openid
|
||||
*/
|
||||
@SerializedName("openid")
|
||||
private String openid;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public String getKfAccount() {
|
||||
return this.kfAccount;
|
||||
}
|
||||
|
||||
public void setKfAccount(String kfAccount) {
|
||||
this.kfAccount = kfAccount;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return this.openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
public class WxMpKfSessionGetResult {
|
||||
/**
|
||||
* kf_account 正在接待的客服,为空表示没有人在接待
|
||||
*/
|
||||
@SerializedName("kf_account")
|
||||
private String kfAccount;
|
||||
|
||||
/**
|
||||
* createtime 会话接入的时间 ,UNIX时间戳
|
||||
*/
|
||||
@SerializedName("createtime")
|
||||
private long createTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public static WxMpKfSessionGetResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpKfSessionGetResult.class);
|
||||
}
|
||||
|
||||
public String getKfAccount() {
|
||||
return this.kfAccount;
|
||||
}
|
||||
|
||||
public void setKfAccount(String kfAccount) {
|
||||
this.kfAccount = kfAccount;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(long createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
public class WxMpKfSessionList {
|
||||
/**
|
||||
* 会话列表
|
||||
*/
|
||||
@SerializedName("sessionlist")
|
||||
private List<WxMpKfSession> kfSessionList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public static WxMpKfSessionList fromJson(String json) {
|
||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json,
|
||||
WxMpKfSessionList.class);
|
||||
}
|
||||
|
||||
public List<WxMpKfSession> getKfSessionList() {
|
||||
return this.kfSessionList;
|
||||
}
|
||||
|
||||
public void setKfSessionList(List<WxMpKfSession> kfSessionList) {
|
||||
this.kfSessionList = kfSessionList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package me.chanjar.weixin.mp.bean.kefu.result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Binary Wang
|
||||
*
|
||||
*/
|
||||
public class WxMpKfSessionWaitCaseList {
|
||||
/**
|
||||
* count 未接入会话数量
|
||||
*/
|
||||
@SerializedName("count")
|
||||
private Long count;
|
||||
|
||||
/**
|
||||
* waitcaselist 未接入会话列表,最多返回100条数据
|
||||
*/
|
||||
@SerializedName("waitcaselist")
|
||||
private List<WxMpKfSession> kfSessionWaitCaseList;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
|
||||
}
|
||||
|
||||
public static WxMpKfSessionWaitCaseList fromJson(String json) {
|
||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(json,
|
||||
WxMpKfSessionWaitCaseList.class);
|
||||
}
|
||||
|
||||
public List<WxMpKfSession> getKfSessionWaitCaseList() {
|
||||
return this.kfSessionWaitCaseList;
|
||||
}
|
||||
|
||||
public void setKfSessionWaitCaseList(List<WxMpKfSession> kfSessionWaitCaseList) {
|
||||
this.kfSessionWaitCaseList = kfSessionWaitCaseList;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user