| | |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | |
| | | @Api(tags="直播接口-学员端") |
| | | @RestController |
| | | @CrossOrigin |
| | | @RequestMapping(value = "/stu/live") |
| | | public class StuLiveController { |
| | | |
| | |
| | | public Result readAccessPath(String resId, String attribute) { |
| | | |
| | | Res res = read(Res.class, resId); |
| | | String type="0"; |
| | | // 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(type)? resItemServiceMap.get(type).readAccessPath(res.getItemDestId(), attribute):resItemServiceMap.get(type).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", |
| | | this.classLectureService.readDocPageCount(res.getItemDestId())));//文件的页数 |
| | | }else { |
| | | 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", |
| | | // this.classLectureService.readDocPageCount(res.getItemDestId())));//文件的页数 |
| | | // }else { |
| | | return new Result(true, "success", |
| | | CollectionUtils.newObjectMap("path", path, "name", res.getName(), "coverPageUrl", res.getCoverPageUrl(), "size", 0)); |
| | | } |
| | | // } |
| | | |
| | | } |
| | | |