Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
龚小红
oto
Commits
51de9513
Commit
51de9513
authored
Apr 17, 2021
by
别湘灵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理人首页
parent
b24d3bee
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
179 additions
and
3 deletions
+179
-3
HistoryList.java
src/test/java/com/kjj/bean/issue/HistoryList.java
+3
-0
SpokeList.java
src/test/java/com/kjj/bean/issue/SpokeList.java
+11
-0
Spolist.java
src/test/java/com/kjj/bean/issue/Spolist.java
+11
-0
Vo.java
src/test/java/com/kjj/bean/issue/Vo.java
+11
-0
VoList.java
src/test/java/com/kjj/bean/issue/VoList.java
+10
-0
Question.java
src/test/java/com/kjj/cases/live/question/Question.java
+117
-3
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+9
-0
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+7
-0
No files found.
src/test/java/com/kjj/bean/issue/HistoryList.java
View file @
51de9513
...
...
@@ -4,4 +4,7 @@ import lombok.Data;
@Data
public
class
HistoryList
{
private
String
id
;
private
String
question
;
private
String
askNum
;
}
src/test/java/com/kjj/bean/issue/SpokeList.java
0 → 100644
View file @
51de9513
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SpokeList
{
private
String
now
;
private
List
<
Vo
>
vo
;
}
src/test/java/com/kjj/bean/issue/Spolist.java
0 → 100644
View file @
51de9513
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
Spolist
{
private
String
now
;
private
List
<
VoList
>
list
;
}
src/test/java/com/kjj/bean/issue/Vo.java
0 → 100644
View file @
51de9513
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
Vo
{
private
String
time
;
private
List
<
VoList
>
list
;
}
src/test/java/com/kjj/bean/issue/VoList.java
0 → 100644
View file @
51de9513
package
com
.
kjj
.
bean
.
issue
;
import
lombok.Data
;
@Data
public
class
VoList
{
private
String
name
;
private
String
msg
;
}
src/test/java/com/kjj/cases/live/question/Question.java
View file @
51de9513
...
...
@@ -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
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
51de9513
...
...
@@ -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"
;
//红包//
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
51de9513
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment