新增电视剧分集查询接口并更新第三方接口文档
- 新增 /openapi/partner/media/episodes 接口,通过父级 contentcode 查询电视剧分集列表,分集 contentcode 可作为 programCode 传入 SDK 获取播放地址 - JetsenMediaClient 新增 getEpisodes 方法,调橘视厅 getcontentlist.do 传 contentcode 参数获取分集 - API_DOC.md 补充 /list 多栏目查询、/list-all 全量聚合、/episodes 分集查询三个接口的详细文档
This commit is contained in:
@@ -293,6 +293,39 @@ public class OpenApiMediaController {
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分集列表(通过父级 contentcode)
|
||||
* <p>传入电视剧的 contentcode,返回其下各分集列表,分集的 contentcode 可作为 programCode 传入 SDK 获取播放地址。</p>
|
||||
* <p>三级授权:CONTENT(校验contentcode在授权范围内) > CATALOG/FULL(直接返回)</p>
|
||||
*/
|
||||
@ApiOperation("分集列表(通过父级contentcode)")
|
||||
@GetMapping("/episodes")
|
||||
public R episodes(@RequestParam String contentcode,
|
||||
@RequestParam(defaultValue = "1") int pageindex,
|
||||
@RequestParam(defaultValue = "20") int pagesize,
|
||||
HttpServletRequest req) {
|
||||
long start = System.currentTimeMillis();
|
||||
String partnerId = partnerIdFrom(req);
|
||||
ContentPackageEntity pkg = contentPackageService.getByPartnerId(partnerId);
|
||||
Set<String> contentCodes = parseContentCodes(pkg);
|
||||
|
||||
// CONTENT级别:校验 contentcode 在授权范围内
|
||||
if (contentCodes != null && !contentCodes.contains(contentcode)) {
|
||||
logCall(req, "/episodes", "GET", 400, start);
|
||||
return R.error("contentcode不在授权范围内");
|
||||
}
|
||||
|
||||
JSONObject resp = jetsenMediaClient.getEpisodes(contentcode, pageindex, pagesize);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("list", extractList(resp));
|
||||
data.put("totalCount", resp.getIntValue("sizetotal"));
|
||||
data.put("currPage", pageindex);
|
||||
data.put("pageSize", pagesize);
|
||||
data.put("totalPage", resp.getIntValue("pagetotal"));
|
||||
logCall(req, "/episodes", "GET", 0, start);
|
||||
return R.dataSuccess(data);
|
||||
}
|
||||
|
||||
/** 搜索(按授权过滤) */
|
||||
@ApiOperation("搜索")
|
||||
@GetMapping("/search")
|
||||
|
||||
Reference in New Issue
Block a user