| | |
| | | |
| | | @Autowired |
| | | private ApplicationContext appContext; |
| | | |
| | | |
| | | @Autowired |
| | | private IClassLectureService classLectureService; |
| | | |
| | |
| | | public Result readAccessPath(String resId, String attribute) { |
| | | |
| | | Res res = read(Res.class, resId); |
| | | |
| | | Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())?JSONObject.parse(resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)):CollectionUtils.newObjectMap("path", resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)); |
| | | |
| | | // Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())? JSONObject.parse(resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)):CollectionUtils.newObjectMap("path", resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute)); |
| | | Object path = Res.FILE_TYPE_VIDEO.equals(res.getType())? resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute):resItemServiceMap.get(res.getType()).readAccessPath(res.getItemDestId(), attribute); |
| | | if(Res.FILE_TYPE_DOC.equals(res.getType())) { |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("path", path, "name", res.getName(), "coverPageUrl", res.getCoverPageUrl(), "size", |
| | |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("path", path, "name", res.getName(), "coverPageUrl", res.getCoverPageUrl(), "size", 0)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.qxueyou.scc.teach.res.model.ResItemVideo; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | String mediaVideoId = addVideoConverTask(file); |
| | | ResItemAudio audio = new ResItemAudio(); |
| | | TraceUtils.setCreateTrace(audio); |
| | | |
| | | audio.setStatus(ResItemAudio.STATUS_LINEUP); |
| | | audio.setFileId(fileId); |
| | | audio.setName(name); |
| | | audio.setMediaVideoId(mediaVideoId); |
| | |
| | | ResItemAudio resItemAudio = read(ResItemAudio.class, resId); |
| | | |
| | | if (resItemAudio != null && resItemAudio.getStatus() != ResItemAudio.STATUS_DRAFT) { |
| | | return null; |
| | | ResFile resFile = read(ResFile.class,resItemAudio.getFileId()); |
| | | return resFile.getPath(); |
| | | //return null; |
| | | } |
| | | |
| | | MediaVideo video = read(MediaVideo.class, resItemAudio.getMediaVideoId()); |
| | |
| | | HandoutConverTask task = new HandoutConverTask(); |
| | | |
| | | task.setCreateTime(new Date()); |
| | | task.setUpdateTime(new Date()); |
| | | task.setHandoutId(handout.getHandoutId()); |
| | | task.setHandoutUrl(handout.getFullPath()); |
| | | task.setStatus(HandoutConverTask.STATUS_DRAFT); |
| | |
| | | public String readAccessPath(String resId, String attribute) { |
| | | ResItemDoc resItemDoc = read(ResItemDoc.class, resId); |
| | | if (ResItemDoc.STATUS_DRAFT != resItemDoc.getStatus()) { |
| | | return null; |
| | | ResFile resFile = read(ResFile.class,resItemDoc.getOrigFileId()); |
| | | return resFile.getPath(); |
| | | // return null; |
| | | } |
| | | SchHandout schHandout = read(SchHandout.class, resItemDoc.getHandoutId()); |
| | | |
| | |
| | | ResItemVideo resItemVideo = read(ResItemVideo.class, resId); |
| | | |
| | | if (resItemVideo != null && resItemVideo.getStatus() != ResItemVideo.STATUS_DRAFT) { |
| | | return null; |
| | | ResFile resFile = read(ResFile.class,resItemVideo.getFileId()); |
| | | return resFile.getPath(); |
| | | // return null; |
| | | } |
| | | |
| | | MediaVideo video = read(MediaVideo.class, resItemVideo.getMediaVideoId()); |
| | |
| | | |
| | | return JSONObject.toJSONString(CollectionUtils.newObjectMap("hd",video.getAndroidHD(), "sd", video.getAndroidSD(), "ld", video.getAndroidLD(), "path",StringUtils.isNotEmpty(video.getAndroidHD()) ? video.getAndroidHD() |
| | | : StringUtils.isNotEmpty(video.getAndroidSD()) ? video.getAndroidSD() : video.getAndroidLD())); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (StringUtils.isBlank(mediaVideoId)) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | MediaVideo mediaVideo = read(MediaVideo.class, mediaVideoId); |
| | | if (mediaVideo.getStatus() == MediaVideo.STATUS_DRAFT) { |
| | | if (mediaVideo.getType().equals("video")) { |