1
0
mirror of synced 2025-12-23 18:48:00 +08:00

增加查看客服聊天记录的接口 #5

This commit is contained in:
BinaryWang
2016-07-18 12:10:12 +08:00
parent 0c723bbf5c
commit c040ba3929
6 changed files with 220 additions and 32 deletions

View File

@@ -1,7 +1,13 @@
package me.chanjar.weixin.mp.api.impl;
import java.io.File;
import java.util.Date;
import ch.qos.logback.classic.BasicConfigurator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import me.chanjar.weixin.mp.bean.kefu.result.*;
import org.joda.time.DateTime;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;
@@ -14,12 +20,6 @@ import me.chanjar.weixin.mp.api.ApiTestModule;
import me.chanjar.weixin.mp.api.ApiTestModule.WxXmlMpInMemoryConfigStorage;
import me.chanjar.weixin.mp.api.WxMpServiceImpl;
import me.chanjar.weixin.mp.bean.kefu.request.WxMpKfAccountRequest;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfInfo;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfList;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfSessionGetResult;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfSessionList;
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfSessionWaitCaseList;
/**
* 测试客服相关接口
@@ -145,4 +145,14 @@ public class WxMpKefuServiceImplTest {
System.err.println(result);
}
@Test
public void testKfMsgList() throws WxErrorException, JsonProcessingException {
BasicConfigurator.configureDefaultContext();
Date startTime = DateTime.now().minusDays(1).toDate();
Date endTime = DateTime.now().toDate();
WxMpKfMsgList result = this.wxService.getKefuService().kfMsgList(startTime,endTime, 0, 20);
Assert.assertNotNull(result);
System.err.println(new ObjectMapper().writeValueAsString(result));
}
}