派生自 projectDept/qhighschool

yn147
2023-10-26 3970ced88b5b456f03fe277c254ca761f05492e0
直播是否发布门户
5个文件已修改
39 ■■■■ 已修改文件
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/live/model/MediaVideoLive.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/live/service/IMediaLiveService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java
@@ -83,9 +83,9 @@
     */
    @ApiOperation(value = "获取创建人的直播列表")
    @GetMapping(value = "list")
    public Result list(String keyword, Integer pageNum, Integer pageSize) {
    public Result list(String keyword,String portalStatus, Integer pageNum, Integer pageSize) {
        
        List<MediaVideoLive> data = liveService.listOfMine(keyword, pageNum, pageSize);
        List<MediaVideoLive> data = liveService.listOfMine(keyword,portalStatus, pageNum, pageSize);
        int count = liveService.listCountOfMine(keyword);
        return new Result(true, "success", CollectionUtils.newObjectMap("videoLiveCount", count, 
@@ -102,7 +102,8 @@
                        "pushUrl","rtmpPushUrl",
                        "hlsPullUrl","hlsPullUrl",
                        "previewImgUrl","previewImgUrl",
                        "courseId","courseId"
                        "courseId","courseId",
                        "portalStatus","portalStatus"
                        ))));
    }
@@ -138,7 +139,7 @@
    @ApiOperation(value = "创建编辑直播")
    @PostMapping(value = "addOrUpdate")
    public Result addOrUpdate(String videoLiveId, String name, String content,String teacherId,String teacherName,String subjectId,
            String subjectName,String definition,String imgPath, long startTime,long endTime, boolean isPlayBack, String classIds) throws Exception {
            String subjectName,String definition,String imgPath, long startTime,long endTime, boolean isPlayBack, String classIds,String portalStatus) throws Exception {
        MTCloud client = new MTCloud();
        HashMap<Object,Object> options = new HashMap<Object,Object>();
        options.put("barrage", 1);
@@ -159,7 +160,7 @@
        JSONObject data = jsonObject.getJSONObject("data");
        if(jsonObject.getString("code").equals("0")) {
            String course_id = (String) data.get("course_id");
            liveService.add(name, content,teacherId,teacherName,subjectId,subjectName,definition,imgPath, new Date(startTime), new Date(endTime),Integer.parseInt(course_id), isPlayBack, StringUtils.isEmpty(classIds)?null:CollectionUtils.newList(String.class,classIds.split(",")));
            liveService.add(name, content,teacherId,teacherName,subjectId,subjectName,definition,imgPath, new Date(startTime), new Date(endTime),Integer.parseInt(course_id), isPlayBack, StringUtils.isEmpty(classIds)?null:CollectionUtils.newList(String.class,classIds.split(",")),portalStatus);
            return new Result(true, "成功", s);
        }
        return new Result(false,jsonObject.getString("msg"));
src/main/java/com/qxueyou/scc/teach/live/model/MediaVideoLive.java
@@ -319,6 +319,10 @@
    
    @Column(name="SUBJECT_NAME")
    private String subjectName;
    /**  状态 0:发布到门户,1:不发布 */
    @Column(name="PORTAL_STATUS")
    private String portalStatus;
    
    @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinColumn(name = "SUBJECT_ID",referencedColumnName="SUBJECT_ID",updatable=false,insertable=false)
@@ -731,6 +735,13 @@
    public void setCourseId(int courseId) {
        this.courseId = courseId;
    }
    public String getPortalStatus() {
        return portalStatus;
    }
    public void setPortalStatus(String portalStatus) {
        this.portalStatus = portalStatus;
    }
    public void setSubject(Subject subject) {
        this.subject = subject;
src/main/java/com/qxueyou/scc/teach/live/service/IMediaLiveService.java
@@ -19,7 +19,7 @@
     * @param classId 班级ids
     * @return
     */
    Result add(String name,String content,String teacherId,String teacherName,String subjectId,String subjectName,String definition,String imgPath,Date startTime,Date endTime,Integer courseId,boolean record,List<String> classIds);
    Result add(String name,String content,String teacherId,String teacherName,String subjectId,String subjectName,String definition,String imgPath,Date startTime,Date endTime,Integer courseId,boolean record,List<String> classIds,String portalStatus);
    /**
     * 查询直播
@@ -44,7 +44,7 @@
     * @param pageSize 每页数据大小
     * @return
     */
    List<MediaVideoLive> listOfMine(String keyword,Integer pageNum, Integer pageSize);
    List<MediaVideoLive> listOfMine(String keyword,String portalStatus,Integer pageNum, Integer pageSize);
    /**
     * 查询直播总数
src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java
@@ -54,7 +54,7 @@
    
    @Override
    public Result add(String name, String content, String teacherId, String teacherName , String subjectId, String subjectName,
                      String definition, String imgPath, Date startTime, Date endTime, Integer courseId, boolean record, List<String> classIds) {
                      String definition, String imgPath, Date startTime, Date endTime, Integer courseId, boolean record, List<String> classIds,String portalStatus) {
        
        UserTeacher teacher = teacherService.getTeacherByUserId(ClientUtils.getUserId());
        
@@ -67,6 +67,7 @@
        live.setPreviewImgUrl(imgPath);
        live.setStartTime(startTime);
        live.setEndTime(endTime);
        live.setPortalStatus(portalStatus);
        live.setStatus(MediaVideoLive.STATUS_LIVE_DRAFT);
        
        if(teacher!=null){
@@ -343,12 +344,12 @@
    }
    @Override
    public List<MediaVideoLive> listOfMine(String keyword, Integer pageNum, Integer pageSize) {
    public List<MediaVideoLive> listOfMine(String keyword,String portalStatus, Integer pageNum, Integer pageSize) {
        
        String hql = "from MediaVideoLive where deleteFlag is false and name like ?  order by createTime desc";
        String hql = "from MediaVideoLive where deleteFlag is false and name like ? and portalStatus = ? order by createTime desc";
        return findList(hql, new Pager(pageSize, pageNum), CollectionUtils.newList(keyword + "%"), MediaVideoLive.class);
        return findList(hql, new Pager(pageSize, pageNum), CollectionUtils.newList(keyword + "%",portalStatus), MediaVideoLive.class);
    }
    
    @Override
src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java
@@ -75,13 +75,17 @@
            String destPath = getDestPath(name);
            String fullPath = config.getResRootPath() + "/" + destPath;
            //截取上传华为云的编码
            File fileRoot = new File(fullPath.substring(0, fullPath.lastIndexOf("/")));
            if (!fileRoot.exists()) {
                fileRoot.mkdirs();
            }
            //压缩
            FileUtils.copyInputStreamToFile(in, new File(fullPath));
            //华为云编码存入数据库
            ResFile file = insertFileToDB(name, fullPath, destPath, getFileType(name));
            return new Result(true, "success",