From 72c46d1beca40d0c71544f042f479c4d84a63289 Mon Sep 17 00:00:00 2001 From: BinaryWang Date: Wed, 13 Jul 2016 18:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=9C=80=E6=96=B0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=AE=98=E6=96=B9=E6=96=87=E6=A1=A3=E5=AF=B9=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E4=BC=9A=E8=AF=9D=E6=8E=A7=E5=88=B6=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/mp/api/WxMpKefuService.java | 4 ++-- .../mp/api/impl/WxMpKefuServiceImpl.java | 10 ++++----- .../kefu/request/WxMpKfSessionRequest.java | 21 ++----------------- .../mp/api/impl/WxMpKefuServiceImplTest.java | 4 ++-- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpKefuService.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpKefuService.java index 7e2a41128..fc927bc4f 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpKefuService.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpKefuService.java @@ -94,7 +94,7 @@ public interface WxMpKefuService { * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/create?access_token=ACCESS_TOKEN * */ - boolean kfSessionCreate(String openid, String kfAccount, String text) throws WxErrorException; + boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException; /** *
@@ -104,7 +104,7 @@ public interface WxMpKefuService {
    * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/close?access_token=ACCESS_TOKEN
    * 
*/ - boolean kfSessionClose(String openid, String kfAccount, String text) throws WxErrorException; + boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException; /** *
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImpl.java
index 12eec6c0e..c78c873da 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImpl.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImpl.java
@@ -88,10 +88,9 @@ public class WxMpKefuServiceImpl implements WxMpKefuService {
   }
 
   @Override
-  public boolean kfSessionCreate(String openid, String kfAccount, String text)
+  public boolean kfSessionCreate(String openid, String kfAccount)
       throws WxErrorException {
-    WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid,
-        text);
+    WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid);
     String url = "https://api.weixin.qq.com/customservice/kfsession/create";
     this.wxMpService.execute(new SimplePostRequestExecutor(), url,
         request.toJson());
@@ -99,10 +98,9 @@ public class WxMpKefuServiceImpl implements WxMpKefuService {
   }
 
   @Override
-  public boolean kfSessionClose(String openid, String kfAccount, String text)
+  public boolean kfSessionClose(String openid, String kfAccount)
       throws WxErrorException {
-    WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid,
-        text);
+    WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid);
     String url = "https://api.weixin.qq.com/customservice/kfsession/close";
     this.wxMpService.execute(new SimplePostRequestExecutor(), url,
         request.toJson());
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/kefu/request/WxMpKfSessionRequest.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/kefu/request/WxMpKfSessionRequest.java
index aaf9e98c8..e821916ef 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/kefu/request/WxMpKfSessionRequest.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/kefu/request/WxMpKfSessionRequest.java
@@ -23,19 +23,10 @@ public class WxMpKfSessionRequest implements Serializable {
    */
   @SerializedName("openid")
   private String openid;
-  
-  /**
-   * text 附加信息,文本会展示在客服人员的多客服客户端
-   * 目前看起来无用,主要是老版的多客服客户端使用
-   */
-  @SerializedName("text")
-  @Deprecated
-  private String text;
-  
-  public WxMpKfSessionRequest(String kfAccount, String openid, String text) {
+
+  public WxMpKfSessionRequest(String kfAccount, String openid) {
     this.kfAccount = kfAccount;
     this.openid = openid;
-    this.text = text;
   }
 
   @Override
@@ -55,12 +46,4 @@ public class WxMpKfSessionRequest implements Serializable {
     this.kfAccount = kfAccount;
   }
 
-  public String getText() {
-    return this.text;
-  }
-
-  public void setText(String text) {
-    this.text = text;
-  }
-
 }
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImplTest.java
index 8007b8759..f02649cc8 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImplTest.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpKefuServiceImplTest.java
@@ -108,7 +108,7 @@ public class WxMpKefuServiceImplTest {
   public void testKfSessionCreate(String kfAccount, String openid)
       throws WxErrorException {
     boolean result = this.wxService.getKefuService().kfSessionCreate(openid,
-        kfAccount, "welcome");
+        kfAccount);
     Assert.assertTrue(result);
   }
 
@@ -116,7 +116,7 @@ public class WxMpKefuServiceImplTest {
   public void testKfSessionClose(String kfAccount, String openid)
       throws WxErrorException {
     boolean result = this.wxService.getKefuService().kfSessionClose(openid,
-        kfAccount, "bye bye");
+        kfAccount);
     Assert.assertTrue(result);
   }