| | |
| | | package com.ruoyi.media.service.impl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.camera.service.ICameraSdkService; |
| | | import com.ruoyi.media.service.IMediaService; |
| | | import com.ruoyi.utils.forest.MediaClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.media.mapper.VtduMapper; |
| | | import com.ruoyi.media.domain.Vtdu; |
| | | import com.ruoyi.media.service.IVtduService; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | |
| | | * @date 2023-08-29 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | @Slf4j(topic = "vtdu") |
| | | public class VtduServiceImpl implements IVtduService { |
| | | @Resource |
| | | private VtduMapper vtduMapper; |
| | |
| | | */ |
| | | @Override |
| | | public int insertVtdu(Vtdu vtdu) { |
| | | log.info("流媒体【" + vtdu.getName() + "】通道添加"); |
| | | log.debug("流媒体【" + vtdu.getName() + "】通道添加"); |
| | | Map<String, String> map = mediaService.addPath(vtdu.getName(), vtdu.getRtspSource(), vtdu.getMode(), vtdu.getIsCode()); |
| | | vtdu.setRtspUrl(map.get("rtspUrl")); |
| | | vtdu.setRtmpUrl(map.get("rtmpUrl")); |
| | |
| | | @Override |
| | | public int updateVtdu(Vtdu vtdu) { |
| | | |
| | | log.info("流媒体【" + vtdu.getName() + "】通道更新"); |
| | | log.debug("流媒体【" + vtdu.getName() + "】通道更新"); |
| | | Map<String, String> map = mediaService.editPath(vtdu.getName(), vtdu.getRtspSource(), vtdu.getMode(), vtdu.getIsCode()); |
| | | vtdu.setName(vtdu.getName()); |
| | | vtdu.setRtspSource(vtdu.getRtspSource()); |
| | |
| | | */ |
| | | @Override |
| | | public int deleteVtduByNames(String[] names) { |
| | | for (String name : names) { |
| | | log.debug("流媒体【" + name + "】通道删除"); |
| | | } |
| | | mediaService.removePath(names); |
| | | return vtduMapper.deleteVtduByNames(names); |
| | | } |
| | |
| | | @Override |
| | | public int deleteVtduByName(String name) { |
| | | mediaService.removePath(name); |
| | | log.debug("流媒体【" + name + "】通道删除"); |
| | | return vtduMapper.deleteVtduByName(name); |
| | | } |
| | | |