Channel Service
1、创建研讨会频道(旧版后台)
描述
创建频道并进行相关设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/basic/create
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testCreateChannel() throws IOException, NoSuchAlgorithmException {
SeminarCreateChannelRequest seminarCreateChannelRequest = new SeminarCreateChannelRequest();
SeminarCreateChannelResponse seminarCreateChannelResponse;
try {
SeminarCreateChannelRequest.BasicSetting basicSetting = new SeminarCreateChannelRequest.BasicSetting();
basicSetting.setName("测试SDK创建研讨会")
.setChannelPasswd(super.getRandomString(6))
.setCategoryId(super.getCategory());
SeminarCreateChannelRequest.AuthSetting authSetting = new SeminarCreateChannelRequest.AuthSetting();
authSetting.setRank(1)
.setEnabled(SeminarConstant.Flag.YES.getFlag())
.setAuthType(SeminarConstant.AuthType.CODE.getCode())
.setAuthCode("123");
seminarCreateChannelRequest.setBasicSetting(basicSetting).setAuthSettings(Arrays.asList(authSetting));
seminarCreateChannelResponse = new SeminarChannelServiceImpl().createChannel(seminarCreateChannelRequest);
Assert.assertNotNull(seminarCreateChannelResponse);
if (seminarCreateChannelResponse != null) {
//to do something ......
log.debug("测试创建研讨会频道(旧版后台)成功 {}", JSON.toJSONString(seminarCreateChannelResponse));
//TODO 此处创建完成后删除了频道,正式使用需删除该语句
super.deleteChannel(seminarCreateChannelResponse.getChannelId());
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarCreateChannelResponse对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
name
true
String
频道名称
channelPasswd
true
String
频道密码,(可以通过频道号+频道密码登录该频道)长度不能超过16位,必须同时包含字母和数字
categoryId
false
Integer
新建频道的所属分类,如果不提交,则为默认分类(分类ID可通过“查询直播分类”接口得到)
coverImg
false
String
封面图片地址
likes
false
Long
点赞数
pageView
false
Long
累积观看数
subAccount
false
String
子账号邮箱,填写时频道会创建在该子账号下(子账号不能被删除或者禁用),暂无法通过接口获取
rank
true
Integer
主要观看条件为1,次要观看条件为2
enabled
true
String
是否开启条件观看 N:关闭 Y:开启
authType
false
String
pay:付费观看 code:验证码观看 phone:白名单观看 info:登记观看 custom:自定义授权观看 external:外部授权观看 direct:独立授权观看
payAuthTips
false
String
当authType为pay时,设置参数,必填。欢迎语标题
price
false
Float
当authType为pay时,设置参数,必填。价格,单位为元
watchEndTime
false
Date
当authType为pay时,设置参数,非必填。付费有效截止日期
validTimePeriod
false
Integer
当authType为pay时,设置参数,非必填。付费有效时长,单位天。当watchEndTime和validTimePeriod都为空时,表示付费永久有效
authCode
false
String
当authType为code时,设置参数,必填。验证码
qcodeTips
false
String
当authType为code时,设置参数,非必填。提示文案
qcodeImg
false
String
当authType为code时,设置参数,非必填。公众号二维码地址
authTips
false
String
当authType为phone时,设置参数,非必填。提示文案
externalKey
false
String
当authType为external时,设置参数,必填。SecretKey
externalUri
false
String
当authType为external时,设置参数,必填。自定义url
externalRedirectUri
false
String
当authType为external时,设置参数,非必填。跳转地址
customKey
false
String
当authType为custom时,设置参数,必填。SecretKey
customUri
false
String
当authType为custom时,设置参数,必填。自定义url
directKey
false
String
当authType为direct时,设置参数,必填。独立授权SecretKey
name
false
String
登记信息名,最多为8字符
type
true
String
登记类型,姓名-name,文本-text,手机号码-mobile,数字-number,下拉选项-option,登记观看时该字段必填
options
false
String
下拉选项时,下拉的选项值,以英文逗号分割。选项个数上限为8个;选项内容最多为8字符
placeholder
false
String
文本框输入提示,最多为8字符
sms
false
String
短信验证开关,Y 开启,N 关闭
返回对象描述
channelId
String
直播频道号
userId
String
POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置)
name
String
直播频道名称
publisher
String
主持人
description
String
直播频道描述
scene
String
直播场景 seminar:研讨会
channelPasswd
String
频道密码
currentTimeMillis
Date
当前时间
2、创建研讨会频道(新版后台)
描述
根据直播默认模板创建频道
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/create
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testCreateChannelV2() throws IOException, NoSuchAlgorithmException {
SeminarCreateChannelV2Request seminarCreateChannelV2Request = new SeminarCreateChannelV2Request();
SeminarCreateChannelV2Response seminarCreateChannelV2Response;
try {
seminarCreateChannelV2Request.setName("测试SDK创建研讨会")
.setSeminarHostPassword(super.getRandomString(6))
.setSeminarAttendeePassword(super.getRandomString(8))
.setCategoryId(super.getCategory())
.setStartTime(super.getDate(System.currentTimeMillis() + 600 * 1000))
.setLinkMicLimit(15);
seminarCreateChannelV2Response = new SeminarChannelServiceImpl().createChannelV2(
seminarCreateChannelV2Request);
Assert.assertNotNull(seminarCreateChannelV2Response);
if (seminarCreateChannelV2Response != null) {
//to do something ......
log.debug("测试创建研讨会频道(新版后台)成功 {}", JSON.toJSONString(seminarCreateChannelV2Response));
//TODO 此处创建完成后删除了频道,正式使用需删除该语句
super.deleteChannel(String.valueOf(seminarCreateChannelV2Response.getChannelId()));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarCreateChannelV2Response对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
name
true
String
直播名称,最大长度100
seminarHostPassword
false
String
研讨会主持人密码,仅直播场景是研讨会时有效,长度6-16位,不传则由系统随机生成。研讨会主持人密码和参会人密码不能相同。
seminarAttendeePassword
false
String
研讨会参会人密码,仅直播场景是研讨会时有效,长度6-16位,不传则由系统随机生成。研讨会主持人密码和参会人密码不能相同。
categoryId
false
Integer
分类ID,可通过“查询直播分类”接口获取
startTime
false
Date
开始时间
subAccount
false
String
子账号邮箱,填写时频道会创建在该子账号下(子账号不能被删除或者禁用),暂无法通过接口获取
linkMicLimit
false
Integer
参会人数 1-47:代表参会人数
返回对象描述
channelId
String
频道ID
userId
String
POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置)
seminarHostPassword
String
研讨会主持人密码,仅直播场景是研讨会时不为null,长度6-16位
seminarAttendeePassword
String
研讨会参会人密码,仅直播场景是研讨会时不为null,长度6-16位
3、获取研讨会频道录制设置
描述
获取研讨会频道录制设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/setting/get-record
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testGetRecordSetting() throws IOException, NoSuchAlgorithmException {
SeminarGetRecordSettingRequest seminarGetRecordSettingRequest = new SeminarGetRecordSettingRequest();
SeminarGetRecordSettingResponse seminarGetRecordSettingResponse;
try {
String channelId = super.getChannelId();
seminarGetRecordSettingRequest.setChannelId(channelId);
seminarGetRecordSettingResponse = new SeminarChannelServiceImpl().getRecordSetting(
seminarGetRecordSettingRequest);
Assert.assertNotNull(seminarGetRecordSettingResponse);
if (seminarGetRecordSettingResponse != null) {
//to do something ......
log.debug("测试获取研讨会频道录制设置成功 {}", JSON.toJSONString(seminarGetRecordSettingResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarGetRecordSettingResponse对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道ID
返回对象描述
enabled
String
录制开关,Y开启、N关闭
mode
String
录制模式,auto自动、manual手动
channelId
String
直播频道号
userId
String
POLYV用户ID,通过注册保利威官网获取,路径:官网->登录->直播(开发设置)
resolution
String
分辨率
4、修改研讨会频道录制设置
描述
修改研讨会频道录制设置
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/setting/set-record
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testSetRecordSetting() throws IOException, NoSuchAlgorithmException {
SeminarSetRecordSettingRequest seminarSetRecordSettingRequest = new SeminarSetRecordSettingRequest();
Boolean seminarSetRecordSettingResponse;
try {
String channelId = super.getChannelId();
seminarSetRecordSettingRequest.setChannelId(channelId)
.setRecordMode(SeminarConstant.RecordMode.manual.getModel())
.setEnabled(SeminarConstant.Flag.YES.getFlag());
seminarSetRecordSettingResponse = new SeminarChannelServiceImpl().setRecordSetting(
seminarSetRecordSettingRequest);
Assert.assertTrue(seminarSetRecordSettingResponse);
if (seminarSetRecordSettingResponse) {
//to do something ......
log.debug("测试修改研讨会频道录制设置成功");
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回Boolean对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道ID
enabled
true
String
录制开关,Y开启、N关闭
recordMode
true
String
录制模式,auto自动、manual手动
返回对象描述
修改研讨会频道录制设置返回实体
5、获取研讨会直播间参会者统计数据
描述
获取研讨会直播间参会者统计数据
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/seminar/statistics/listViewLogs
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testGetViewLog() throws IOException, NoSuchAlgorithmException {
SeminarGetViewLogRequest seminarGetViewLogRequest = new SeminarGetViewLogRequest();
SeminarGetViewLogResponse seminarGetViewLogResponse;
try {
String channelId = super.getChannelId();
seminarGetViewLogRequest.setChannelId(channelId)
.setStartTime(super.getDate(System.currentTimeMillis() - 20 * 86400000))
.setEndTime(super.getDate(System.currentTimeMillis()))
.setPageSize(20)
.setCurrentPage(1);
seminarGetViewLogResponse = new SeminarChannelServiceImpl().getViewLog(seminarGetViewLogRequest);
Assert.assertNotNull(seminarGetViewLogResponse);
if (seminarGetViewLogResponse != null) {
//to do something ......
log.debug("测试获取研讨会直播间参会者统计数据成功 {}", JSON.toJSONString(seminarGetViewLogResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarGetViewLogResponse对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道ID
startTime
true
Date
开始时间
endTime
true
Date
结束时间(最多只能查询60天内的数据)
currentPage
false
Integer
页数,默认为1【对应api文档的pageNumber字段】
pageSize
false
Integer
每页显示的数据条数,默认每页显示20条数据
返回对象描述
pageSize
Integer
每页显示的数据条数,默认每页显示20条数据
currentPage
Integer
当前页【对应api文档的pageNumber字段】
totalItems
Integer
记录总条数
totalPage
Integer
总页数【对应api文档的totalPages字段】
viewerId
String
UID
nickName
String
昵称
country
String
国家
province
String
地区
city
String
城市
ipAddress
String
参会人IP
startTime
Date
进入时间
endTime
Date
退出时间
stayDuration
Integer
进入时长(单位:秒)
micCount
Integer
连麦次数
micDuration
Integer
连麦时长(单位:秒)
showCount
Integer
演示次数
showDuration
Integer
演示时长(单位:秒)
isMobile
String
是否移动端,取值Y 移动端; N PC端
6、获取直播间观众统计数据
描述
获取直播间观众统计数据
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/statistics/listViewLogs
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testGetCdnViewLog() throws IOException, NoSuchAlgorithmException {
SeminarGetCdnViewLogRequest seminarGetCdnViewLogRequest = new SeminarGetCdnViewLogRequest();
SeminarGetCdnViewLogResponse seminarGetCdnViewLogResponse;
try {
String channelId = super.getChannelId();
seminarGetCdnViewLogRequest.setChannelId(channelId)
.setStartTime(super.getDate(System.currentTimeMillis() + 600 * 1000))
.setEndTime(super.getDate(System.currentTimeMillis() + 600 * 1000));
seminarGetCdnViewLogResponse = new SeminarChannelServiceImpl().getCdnViewLog(seminarGetCdnViewLogRequest);
Assert.assertNotNull(seminarGetCdnViewLogResponse);
if (seminarGetCdnViewLogResponse != null) {
//to do something ......
log.debug("测试获取直播间观众统计数据成功 {}", JSON.toJSONString(seminarGetCdnViewLogResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarGetCdnViewLogResponse对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道ID
startTime
true
Date
开始时间
endTime
true
Date
结束时间(只能查询开始时间所在当月的数据;如需跨月查询,请分开请求查询)
currentPage
false
Integer
页数,默认为1【对应api文档的pageNumber字段】
pageSize
false
Integer
每页显示的数据条数,默认每页显示20条数据
返回对象描述
pageSize
Integer
每页显示的数据条数,默认每页显示20条数据
currentPage
Integer
当前页【对应api文档的pageNumber字段】
totalItems
Integer
记录总条数
totalPage
Integer
总页数【对应api文档的totalPages字段】
viewerId
String
用户ID【对应api文档的param1字段】
viewerName
String
用户昵称【对应api文档的param2字段】
logType
String
观看类型 vod:回放; live:直播【对应api文档的param3字段】
province
String
地区
city
String
城市
ipAddress
String
观众IP
createdTime
Date
进入时间
endTime
Date
退出时间
playDuration
Integer
观看时长(单位:秒)
browser
String
观看终端
sessionId
String
场次
7、删除单个频道
描述
删除单个直播频道
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channels/%s/delete
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testDeleteChannel() throws IOException, NoSuchAlgorithmException {
SeminarDeleteChannelRequest seminarDeleteChannelRequest = new SeminarDeleteChannelRequest();
Boolean seminarDeleteChannelResponse;
try {
seminarDeleteChannelRequest.setChannelId("2801915");
seminarDeleteChannelResponse = new SeminarChannelServiceImpl().deleteChannel(seminarDeleteChannelRequest);
Assert.assertTrue(seminarDeleteChannelResponse);
if (seminarDeleteChannelResponse) {
//to do something ......
log.debug("测试删除单个频道成功");
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回Boolean对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
userId
true
String
POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置)
channelId
true
String
频道号
返回对象描述
删除单个频道返回实体
8、批量删除频道
描述
批量删除直播频道,如果响应失败,则表示全部频道都失败,不会有部份成功、部份失败的结果
接口地址(仅做说明使用):https://api.polyv.net/live/v3/channel/basic/batch-delete
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testBatchDeleteChannel() throws IOException, NoSuchAlgorithmException {
SeminarBatchDeleteChannelRequest seminarBatchDeleteChannelRequest = new SeminarBatchDeleteChannelRequest();
Boolean seminarBatchDeleteChannelResponse;
try {
seminarBatchDeleteChannelRequest.setChannelIds(Arrays.asList("2802164", "2798162"));
seminarBatchDeleteChannelResponse = new SeminarChannelServiceImpl().batchDeleteChannel(
seminarBatchDeleteChannelRequest);
Assert.assertTrue(seminarBatchDeleteChannelResponse);
if (seminarBatchDeleteChannelResponse) {
//to do something ......
log.debug("测试批量删除频道成功");
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回Boolean对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelIds
true
Array
请求体参数,频道号列表,每次最多删除100个频道, 必须放在请求体中
返回对象描述
批量删除频道返回实体
9、查询研讨会会议类型
描述
查询研讨会会议类型
接口地址(仅做说明使用):https://api.polyv.net/meet/v1/channel/live-type/get
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testGetLiveType() throws IOException, NoSuchAlgorithmException {
SeminarGetLiveTypeRequest seminarGetLiveTypeRequest = new SeminarGetLiveTypeRequest();
SeminarGetLiveTypeResponse seminarGetLiveTypeResponse;
try {
String channelId = super.getChannelId();
seminarGetLiveTypeRequest.setChannelId(channelId);
seminarGetLiveTypeResponse = new SeminarChannelServiceImpl().getLiveType(seminarGetLiveTypeRequest);
Assert.assertNotNull(seminarGetLiveTypeResponse);
if (seminarGetLiveTypeResponse != null) {
//to do something ......
log.debug("测试查询研讨会会议类型成功 {}", JSON.toJSONString(seminarGetLiveTypeResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回SeminarGetLiveTypeResponse对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道号
返回对象描述
seminarLiveType
String
会议类型 private 对内研讨(默认) public 对外直播
10、修改研讨会会议类型
描述
修改研讨会会议类型
接口地址(仅做说明使用):https://api.polyv.net/meet/v1/channel/live-type/update
调用约束
1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@Test
public void testUpdateLiveType() throws IOException, NoSuchAlgorithmException {
SeminarUpdateLiveTypeRequest seminarUpdateLiveTypeRequest = new SeminarUpdateLiveTypeRequest();
Boolean seminarUpdateLiveTypeResponse;
try {
String channelId = super.getChannelId();
seminarUpdateLiveTypeRequest.setChannelId(channelId);
seminarUpdateLiveTypeRequest.setSeminarLiveType("private");
seminarUpdateLiveTypeResponse = new SeminarChannelServiceImpl().updateLiveType(
seminarUpdateLiveTypeRequest);
Assert.assertNotNull(seminarUpdateLiveTypeResponse);
if (seminarUpdateLiveTypeResponse != null) {
//to do something ......
log.debug("测试修改研讨会会议类型成功 {}", JSON.toJSONString(seminarUpdateLiveTypeResponse));
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
单元测试说明
1、请求正确,返回Boolean对象,B端依据此对象处理业务逻辑;
2、请求参数校验不合格,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 输入参数 [xxx.chat.LivexxxRequest]对象校验失败,失败字段 [pic不能为空 / msg不能为空] ]
3、服务器处理异常,抛出PloyvSdkException,错误信息见PloyvSdkException.getMessage(),如 [ 保利威请求返回数据错误,请求流水号:66e7ad29fd04425a84c2b2b562d2025b,错误原因: invalid signature. ]
请求入参描述
channelId
true
String
频道号
seminarLiveType
true
String
会议类型 private 对内研讨 public 对外直播
返回对象描述
修改研讨会会议类型返回实体
Last updated
Was this helpful?