Authored by mali

Merge branch 'dev_vedio' into test6.9.0

... ... @@ -22,4 +22,6 @@ public interface QiniuLiveRecordMapper {
int insertInitRecord(QiniuLiveRecord record);
int updateVideoUrl(@Param("id")Integer id, @Param("vedioUrl")String vedioUrl, @Param("updateTime")Integer updateTime);
List<QiniuLiveRecord> selectByTime(@Param("startTime")Integer startTime, @Param("endTime")Integer endTime);
}
\ No newline at end of file
... ...
... ... @@ -101,4 +101,9 @@
set video_url = #{vedioUrl,jdbcType=VARCHAR}, update_time =#{updateTime, jdbcType=INTEGER}
where id = #{id, jdbcType=INTEGER}
</update>
<select id="selectByTime">
select id, order_code, start_time, end_time, camera_code from qiniu_live_record
where create_time &gt;= #{startTime, jdbcType=INTEGER} and create_time &lt; #{endTime, jdbcType=INTEGER} and show_flag = 1
</select>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.controller;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.impl.AsynVideoLiveService;
import com.yoho.ufo.order.service.impl.UfoLiveService;
... ... @@ -141,4 +142,22 @@ public class UfoLiveController {
return new ApiResponse.ApiResponseBuilder().code(result > 0 ? 200 : 400).message(result > 0 ? "更新成功" : "更新失败").build();
}
/**
* 薛超使用的查询系统中当前时间段的录制视频的任务
* 包含StartTime 不含EndTime
* @param req
* @return
*/
@RequestMapping(value = "/queryVideoInfo")
public ApiResponse queryVideoInfo(QNliveReq req) {
LOGGER.info("queryVideoInfo method in. req is {}", req);
if (null == req.getStartTime() || null == req.getEndTime() || req.getEndTime() - req.getStartTime() > 86400) {
return new ApiResponse.ApiResponseBuilder().code(500).message("时间格式不对").build();
}
List<QiniuLiveRecord> result = ufoLiveService.queryVideoInfo(req.getStartTime(), req.getEndTime());
return new ApiResponse.ApiResponseBuilder().code(200).data(result).build();
}
}
... ...
... ... @@ -266,4 +266,8 @@ public class UfoLiveService {
public int updateVideoUrl(Integer id, String vedioUrl) {
return qiniuLiveRecordMapper.updateVideoUrl(id, vedioUrl, DateUtil.getCurrentTimeSeconds());
}
public List<QiniuLiveRecord> queryVideoInfo(Integer startTime, Integer endTime) {
return qiniuLiveRecordMapper.selectByTime(startTime, endTime);
}
}
... ...