|
@@ -2,12 +2,16 @@ package com.smcic.api.conference.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.smcic.api.conference.dto.DelBatchDTO;
|
|
|
import com.smcic.api.conference.entity.ConferenceLiveVideo;
|
|
|
import com.smcic.api.conference.mapper.ConferenceLiveVideoMapper;
|
|
|
import com.smcic.api.conference.service.IConferenceLiveVideoService;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.smcic.core.advice.BizException;
|
|
|
+import org.apache.http.util.TextUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
/**
|
|
@@ -21,16 +25,41 @@ import java.time.LocalDateTime;
|
|
|
@Service
|
|
|
public class ConferenceLiveVideoServiceImpl extends ServiceImpl<ConferenceLiveVideoMapper, ConferenceLiveVideo> implements IConferenceLiveVideoService {
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ConferenceAclDataServiceImpl aclDataService;
|
|
|
|
|
|
public ConferenceLiveVideo create(ConferenceLiveVideo conferenceLiveVideo) {
|
|
|
+
|
|
|
+ if(!aclDataService.hasDataAcl(conferenceLiveVideo.getConferenceId())){
|
|
|
+ throw new BizException("没有权限");
|
|
|
+ }
|
|
|
conferenceLiveVideo.setCreateTime(LocalDateTime.now());
|
|
|
- if(conferenceLiveVideo.getType() == 1){
|
|
|
+ if(conferenceLiveVideo.getType() == 1 && TextUtils.isEmpty(conferenceLiveVideo.getCover())){
|
|
|
conferenceLiveVideo.setCover(conferenceLiveVideo.getVideo() + "?x-oss-process=video/snapshot,t_3000,m_fast");
|
|
|
}
|
|
|
save( conferenceLiveVideo);
|
|
|
return conferenceLiveVideo;
|
|
|
}
|
|
|
|
|
|
+ public void del(Long id) {
|
|
|
+ ConferenceLiveVideo video = getById(id);
|
|
|
+ if(!aclDataService.hasDataAcl(video.getConferenceId())){
|
|
|
+ throw new BizException("没有权限");
|
|
|
+ }
|
|
|
+ removeById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ //批量删除
|
|
|
+ public void delBatch(DelBatchDTO dto) {
|
|
|
+
|
|
|
+ if (!aclDataService.hasDataAcl(dto.getCid())){
|
|
|
+ throw new BizException("没有权限");
|
|
|
+ }
|
|
|
+
|
|
|
+ remove(new LambdaQueryWrapper<ConferenceLiveVideo>().in(ConferenceLiveVideo::getId, dto.getIds()).eq(ConferenceLiveVideo::getConferenceId, dto.getCid()));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public Page<ConferenceLiveVideo> videoPage(Long cid, Integer page, Integer pageSize) {
|
|
|
Page<ConferenceLiveVideo> page1 = new Page<>(page, pageSize);
|
|
|
|