Commit 51de9513 authored by 别湘灵's avatar 别湘灵

代理人首页

parent b24d3bee
......@@ -4,4 +4,7 @@ import lombok.Data;
@Data
public class HistoryList {
private String id;
private String question;
private String askNum;
}
package com.kjj.bean.issue;
import lombok.Data;
import java.util.List;
@Data
public class SpokeList {
private String now;
private List<Vo> vo;
}
package com.kjj.bean.issue;
import lombok.Data;
import java.util.List;
@Data
public class Spolist {
private String now;
private List<VoList> list;
}
package com.kjj.bean.issue;
import lombok.Data;
import java.util.List;
@Data
public class Vo {
private String time;
private List<VoList> list;
}
package com.kjj.bean.issue;
import lombok.Data;
@Data
public class VoList {
private String name;
private String msg;
}
......@@ -2,6 +2,8 @@ package com.kjj.cases.live.question;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.issue.QuestionList;
import com.kjj.bean.issue.SpokeList;
import com.kjj.bean.issue.Spolist;
import com.kjj.bean.issue.issuelist;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
......@@ -79,7 +81,7 @@ public class Question implements AdminAuthorization {
questionId=list.getLastList().get(0).getId();
System.out.println(questionIds);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_QuesClueList, "助播端查询问题列表失败", response.body().asString()));
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_QuesClueList, "访客端查询问题列表失败", response.body().asString()));
}
@Test(description = "访客端发起问题", priority = 5)
......@@ -98,7 +100,7 @@ public class Question implements AdminAuthorization {
//代理端
/*代理端查询问题列表*/
@Test(description = "代理端查询问题列表", priority = 6)
public void 代理端查询问题列表()
public void 代理端查询问题列表()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
......@@ -106,7 +108,7 @@ public class Question implements AdminAuthorization {
Response response = network.getResponse(params, BasicConfig.MOBILE_QuesClueList);
QuestionList list= JsonUtil.parseResponseToBean(response, QuestionList.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_QuesClueList, "助播端查询问题列表失败", response.body().asString()));
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_QuesClueList, "代理端查询问题列表失败", response.body().asString()));
}
......@@ -176,4 +178,116 @@ public class Question implements AdminAuthorization {
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_ClueNotice, "代理人端公告查询失败", response.body().asString()));
}
public String time;
//***************评论***************//
//助播端历史评论200条
@Test(description = "助播端历史评论200条", priority = 12)
public void 助播端查询历史评论()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeAdmin);
SpokeList list= JsonUtil.parseResponseToBean1(response, SpokeList.class);
time=list.getVo().get(0).getTime();
System.out.println(time);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeAdmin, "助播端评论查询失败", response.body().asString()));
}
//助播端评论区实时评论查询
@Test(description = "助播端评论区实时评论查询", priority = 13)
public void 助播端评论区实时评论查询()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("time", time);
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeList);
Spolist list= JsonUtil.parseResponseToBean1(response, Spolist.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeList, "助播端评论区实时评论查询失败", response.body().asString()));
}
//访客端评论区历史评论
@Test(description = "访客端评论区历史评论", priority = 14)
public void 访客端评论区历史评论()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeHistoryList);
SpokeList list= JsonUtil.parseResponseToBean1(response, SpokeList.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeHistoryList, "访客端评论区历史评论失败", response.body().asString()));
}
//直播间访客发送给评论
@Test(description = "直播间访客发送给评论", priority = 15)
public void 直播间访客发送给评论()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("msg", "主播真有气质");
Response response = network.postResponse(params, BasicConfig.MOBILE_SpokeSend);
System.out.println(response);
Assert.assertNotNull(response, network.message(params, BasicConfig.MOBILE_SpokeSend, "直播间访客发送给评论失败", response.body().asString()));
}
//直播间访客查询实时评论
@Test(description = "直播间访客查询实时评论", priority = 16)
public void 直播间访客查询实时评论()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("time", time);
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeList);
Spolist list= JsonUtil.parseResponseToBean1(response, Spolist.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeList, "直播间访客查询实时评论失败", response.body().asString()));
}
//代理端评论区历史评论
@Test(description = "代理端评论区历史评论", priority = 17)
public void 代理端评论区历史评论()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeHistoryList);
SpokeList list= JsonUtil.parseResponseToBean1(response, SpokeList.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeHistoryList, "代理端评论区历史评论失败", response.body().asString()));
}
//代理端访客发送给评论
@Test(description = "直播间代理端发送给评论", priority = 18)
public void 直播间代理端发送给评论()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("msg", "主播真有气质");
Response response = network.postResponse(params, BasicConfig.MOBILE_SpokeSend);
System.out.println(response);
Assert.assertNotNull(response, network.message(params, BasicConfig.MOBILE_SpokeSend, "直播间访客发送给评论失败", response.body().asString()));
}
//直播间代理端查询实时评论
@Test(description = "直播间代理端查询实时评论", priority = 19)
public void 直播间代理端查询实时评论()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("time", time);
Response response = network.getResponse(params, BasicConfig.MOBILE_SpokeList);
Spolist list= JsonUtil.parseResponseToBean1(response, Spolist.class);
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_SpokeList, "直播间访客查询实时评论失败", response.body().asString()));
}
}
......@@ -47,6 +47,7 @@ public class BasicConfig {
//手机端地址
public static final String MOBILE_HOST = "https://live.duibatest.com.cn";
public static final String MOBILE_HOST1 = "https://kjj.m.duibatest.com.cn";
public static final String MOBILE_SPOKEHOST = "https://tt.duibatest.com.cn";
// *************** 开启&结束直播 ***************
public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open";
......@@ -192,6 +193,14 @@ public class BasicConfig {
public static final String MOBILE_LiveNotice = MOBILE_HOST + "/conf/live/info/notice";
public static final String MOBILE_ClueNotice = MOBILE_HOST + "/clue/info/notice";
//评论
public static final String MOBILE_SpokeAdmin = MOBILE_SPOKEHOST + "/spoke/adminList";
public static final String MOBILE_SpokeList = MOBILE_SPOKEHOST + "/spoke/list";
public static final String MOBILE_SpokeTime = MOBILE_SPOKEHOST + "/spoke/time";
public static final String MOBILE_SpokeHistoryList = MOBILE_SPOKEHOST + "/spoke/historyList";
public static final String MOBILE_SpokeSend = MOBILE_SPOKEHOST + "/spoke/send";
//红包//
......
......@@ -46,4 +46,11 @@ public class JsonUtil {
String str = new JsonBuilder(data).toString();
return JSON.parseArray(str, tClass);
}
public static <T> T parseResponseToBean1(Response response, Class<T> tClass){
Object data = response.jsonPath().getJsonObject("d");
String str = new JsonBuilder(data).toString();
return JSON.parseObject(str, tClass);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment