瀏覽代碼

新增入侵事件直播/回放接口

tags/V1.0.0^2
douzhenjun 1 年之前
父節點
當前提交
2610b41e2a
共有 3 個檔案被更改,包括 27 行新增0 行删除
  1. +9
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/EventController.java
  2. +2
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/EventService.java
  3. +16
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/EventServiceImpl.java

+ 9
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/EventController.java 查看文件

@@ -36,4 +36,13 @@ public class EventController {
return eventService.findListRecent();
}
/**
* 获得直播或回放的url
*/
@RequestMapping("/getVideo")
public JsonResult getVideo(String eventId){
return eventService.getVideo(eventId);
}
}

+ 2
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/EventService.java 查看文件

@@ -15,4 +15,6 @@ public interface EventService extends IService<Event> {
JsonResult findListByPage(EventRequest eventRequest);

JsonResult findListRecent();

JsonResult getVideo(String eventId);
}

+ 16
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/EventServiceImpl.java 查看文件

@@ -11,9 +11,11 @@ import com.tuoheng.admin.mapper.EventMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.request.EventRequest;
import com.tuoheng.admin.service.EventService;
import com.tuoheng.admin.service.InspectionService;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.EventVo;
import com.tuoheng.common.core.enums.MarkEnum;
import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@@ -40,6 +42,9 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private InspectionService inspectionService;
/**
* 分页查询入侵时间, 根据查询条件
@@ -116,6 +121,17 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event>
}
return JsonResult.success(eventVos);
}

@Override
public JsonResult getVideo(String eventId) {
Event event = eventMapper.selectById(eventId);
if(ObjectUtils.isNull(event.getInspectionId())){
throw new ServiceException("该事件还没有绑定飞行巡检任务");
}
Inspection inspection = inspectionMapper.selectById(event.getInspectionId());
return inspectionService.getVideoById(inspection.getId());
}
}



Loading…
取消
儲存