| | |
| | | Map<String, List<ParentPlatform>> parentPlatformMap = new HashMap<>(); |
| | | if (event.getPlatformId() != null) { |
| | | parentPlatform = storager.queryParentPlatByServerGBId(event.getPlatformId()); |
| | | if (!parentPlatform.isStatus())return; |
| | | String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetup.getServerId() + "_Catalog_" + event.getPlatformId(); |
| | | subscribe = redisCatchStorage.getSubscribe(key); |
| | | }else { |
| | |
| | | * @param count |
| | | * @return |
| | | */ |
| | | PageInfo<GbStream> getAll(Integer page, Integer count); |
| | | PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId); |
| | | |
| | | |
| | | /** |
| | |
| | | private EventPublisher eventPublisher; |
| | | |
| | | @Override |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count) { |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId) { |
| | | PageHelper.startPage(page, count); |
| | | List<GbStream> all = gbStreamMapper.selectAll(); |
| | | List<GbStream> all = gbStreamMapper.selectAll(platFormId); |
| | | return new PageInfo<>(all); |
| | | } |
| | | |
| | |
| | | @Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}") |
| | | int del(String app, String stream); |
| | | |
| | | @Select("SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream") |
| | | List<GbStream> selectAll(); |
| | | @Select("SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " + |
| | | "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " + |
| | | "WHERE pgs.platformId is null OR pgs.platformId = #{platformId}") |
| | | List<GbStream> selectAll(String platformId); |
| | | |
| | | @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}") |
| | | StreamProxyItem selectOne(String app, String stream); |
| | |
| | | @Delete("DELETE FROM platform_catalog WHERE platformId=#{platformId}") |
| | | int delByPlatformId(String platformId); |
| | | |
| | | @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id AND platformId=#{platformId}) as childrenCount FROM platform_catalog pc WHERE parentId=#{parentId} AND platformId=#{platformId}") |
| | | @Select("SELECT pc.*, count(pc2.id) as childrenCount FROM platform_catalog pc " + |
| | | "left join platform_catalog pc2 on pc.id = pc2.parentId " + |
| | | "WHERE pc.parentId=#{parentId} AND pc.platformId=#{platformId} group by pc.id") |
| | | List<PlatformCatalog> selectByParentId(String platformId, String parentId); |
| | | |
| | | @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.id=#{id}") |
| | |
| | | "left join platform_gb_channel pgc on " + |
| | | "pp.serverGBId = pgc.platformId " + |
| | | "WHERE " + |
| | | "pgc.channelId = #{channelId} " + |
| | | "pgc.channelId = #{channelId} pp.status = true " + |
| | | "AND pp.serverGBId IN" + |
| | | "<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + |
| | | "</script> ") |
| | |
| | | "from gb_stream gs\n" + |
| | | " left join platform_gb_stream pgs\n" + |
| | | " on gs.app = pgs.app and gs.stream = pgs.stream\n" + |
| | | "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") |
| | | List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatlog(String platformId, String catalogId); |
| | | "where and pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") |
| | | List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); |
| | | |
| | | @Delete("DELETE FROM platform_gb_stream WHERE catalogId=#{id}") |
| | | int delByCatalogId(String id); |
| | |
| | | |
| | | @Override |
| | | public List<PlatformCatalog> queryStreamInParentPlatformAndCatalog(String platformId, String catalogId) { |
| | | List<PlatformCatalog> catalogs = platformGbStreamMapper.queryChannelInParentPlatformAndCatalogForCatlog(platformId, catalogId); |
| | | List<PlatformCatalog> catalogs = platformGbStreamMapper.queryChannelInParentPlatformAndCatalogForCatalog(platformId, catalogId); |
| | | return catalogs; |
| | | } |
| | | |
| | |
| | | * 查询国标通道 |
| | | * @param page 当前页 |
| | | * @param count 每页条数 |
| | | * @param platformId 平台ID |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询国标通道") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "当前页", required = true , dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "count", value = "每页条数", required = true , dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "platformId", value = "平台ID", required = true , dataTypeClass = Integer.class), |
| | | }) |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public PageInfo<GbStream> list(@RequestParam(required = false)Integer page, |
| | | @RequestParam(required = false)Integer count){ |
| | | public PageInfo<GbStream> list(@RequestParam(required = true)Integer page, |
| | | @RequestParam(required = true)Integer count, |
| | | @RequestParam(required = true)String platformId){ |
| | | |
| | | return gbStreamService.getAll(page, count); |
| | | return gbStreamService.getAll(page, count, platformId); |
| | | } |
| | | |
| | | |
| | |
| | | List<PlatformCatalog> platformCatalogList = storager.getChildrenCatalogByPlatform(platformId, parentId); |
| | | // 查询下属的国标通道 |
| | | List<PlatformCatalog> catalogsForChannel = storager.queryChannelInParentPlatformAndCatalog(platformId, parentId); |
| | | // 查询下属的直播流通道 |
| | | List<PlatformCatalog> catalogsForStream = storager.queryStreamInParentPlatformAndCatalog(platformId, parentId); |
| | | platformCatalogList.addAll(catalogsForChannel); |
| | | platformCatalogList.addAll(catalogsForStream); |