| | |
| | | import com.ruoyi.device.camera.service.ICameraSdkService;
|
| | | import com.ruoyi.media.service.IMediaService;
|
| | | import com.ruoyi.media.service.impl.MediaServiceImpl;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | |
| | | * @author ard
|
| | | * @date 2023-08-29
|
| | | */
|
| | | @Api(tags = "流媒体管理")
|
| | | @RestController
|
| | | @RequestMapping("/vtdu/media")
|
| | | public class VtduController extends BaseController {
|
| | |
| | | List<Vtdu> list = vtduService.selectVtduList(vtdu);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询流媒体管理列表(不校验权限)
|
| | | */
|
| | | @GetMapping("/list/noPerm")
|
| | | public TableDataInfo listNoPerm(Vtdu vtdu) {
|
| | | startPage();
|
| | | List<Vtdu> list = vtduService.selectVtduList(vtdu);
|
| | | return getDataTable(list);
|
| | | }
|
| | | /**
|
| | | * 导出流媒体管理列表
|
| | | */
|
| | |
| | | /**
|
| | | * 获取流媒体管理详细信息
|
| | | */
|
| | | @ApiOperation(value = "获取流媒体管理详细信息")
|
| | | @PreAuthorize("@ss.hasPermi('vtdu:media:query')")
|
| | | @GetMapping(value = "/{name}")
|
| | | public AjaxResult getInfo(@PathVariable("name") String name) {
|
| | |
| | | */
|
| | | @GetMapping(value = "/{name}/noPerm")
|
| | | public AjaxResult getInfoNoPerm(@PathVariable("name") String name) {
|
| | | Vtdu vtdu = vtduService.selectVtduByName(name);
|
| | | if (vtdu != null) {
|
| | | String cameraId = name.split("_")[0];
|
| | | Integer chanNo = Integer.valueOf(name.split("_")[1]);
|
| | | CameraCmd cmd = new CameraCmd(cameraId, chanNo);
|
| | | Map<String, Object> videoCompressionCfg = cameraSdkService.getVideoCompressionCfg(cmd);
|
| | | String videoEncType = (String) videoCompressionCfg.get("videoEncType");
|
| | | if (videoEncType != null) {
|
| | | if (!videoEncType.equals("标准h264")) {
|
| | | vtdu.setIsCode("1");
|
| | | } else {
|
| | | vtdu.setIsCode("0");
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | vtdu.setIsCode("0");
|
| | | }
|
| | | //流媒体不存在新增,存在更新
|
| | | if (!mediaService.checkNameExist(name)) {
|
| | | mediaService.addPath(name, vtdu.getRtspSource(), vtdu.getMode(), vtdu.getIsCode());
|
| | | } else {
|
| | | vtduService.updateVtdu(vtdu);
|
| | | }
|
| | | }
|
| | | return success(vtdu);
|
| | | return success(vtduService.selectVtduByName(name));
|
| | | }
|
| | | /**
|
| | | * 新增流媒体管理
|