派生自 projectDept/qhighschool

111
EricsHu
2023-05-11 792da3dcdef9679c36adc4d54f3bff0f415c0fe2
111
4个文件已修改
67 ■■■■■ 已修改文件
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/sys/action/LoginController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/qxueyou/scc/SccApplicationTests.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java
@@ -7,6 +7,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hankcs.hanlp.corpus.tag.Nature;
import com.qxueyou.scc.base.dao.CommonDAO;
import com.qxueyou.scc.sdk.MTCloud;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
@@ -136,11 +137,11 @@
        JSONObject data = jsonObject.getJSONObject("data");
        String course_id = (String) data.get("course_id");
//        System.out.println(Integer.parseInt(course_id));
        if(Nature.s !=null) {
        if(jsonObject.getString("code").equals("0")) {
            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(",")));
            return new Result(true, "成功", s);
        }
        return new Result(false);
        return new Result(false,jsonObject.getString("msg"));
    }
    @ApiOperation(value = "开启直播")
@@ -159,7 +160,19 @@
        return new Result(true,"开启成功",protocol);
    }
    @ApiOperation(value = "在线时长")
    @ApiOperation(value = "修改直播状态")
    @GetMapping(value = "updateLive")
    public Result updateLive(Integer courseId)  {
        MediaVideoLive revamp = liveService.revamp(courseId);
        revamp.setStatus(MediaVideoLive.STATUS_LIVE_STOP);
        CommonDAO commonDAO=new CommonDAO();
        commonDAO.update(revamp);
        return new Result(true,"关闭成功");
    }
    @ApiOperation(value = "在线时长")
    @GetMapping(value = "onlineCommunication")
    public Result onlineCommunication(String courseId,Integer page, Integer size) throws Exception {
        MTCloud client = new MTCloud();
src/main/java/com/qxueyou/scc/sys/action/LoginController.java
@@ -217,8 +217,8 @@
        // 查询用户信息
        String uuNumber=null;
        String uuReNumber=null;
        String hql = "from User where deleteFlag is false and account = ?";
        List<Object> params =  CollectionUtils.newList(account);
        String hql = "from User where deleteFlag is false and account = ? and password= ?";
        List<Object> params =  CollectionUtils.newList(account,password);
        User user = commonDAO.findUnique(hql,params, User.class);
        if (user == null ) {
            return new Result(false, "用户账户、密码错误");
src/main/java/com/qxueyou/scc/teach/student/service/impl/StudentService.java
@@ -248,14 +248,18 @@
            String    hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false";
            List<Object> Params =  CollectionUtils.newList(studentId);
            ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class);
            unique.setDeleteFlag(false);
            commonDAO.update(unique);
            if(unique!=null) {
                unique.setDeleteFlag(false);
                commonDAO.update(unique);
            }
        }else {
            String    hql = "from ExerciseCompleteInfo where studentId=? and deleteFlag is false";
            List<Object> Params =  CollectionUtils.newList(studentId);
            ExerciseCompleteInfo unique = findUnique(hql, Params, ExerciseCompleteInfo.class);
            unique.setDeleteFlag(true);
            commonDAO.update(unique);
            if(unique!=null){
                unique.setDeleteFlag(true);
                commonDAO.update(unique);
            }
        }
        return new Result(true);
    }
src/test/java/com/qxueyou/scc/SccApplicationTests.java
@@ -1,16 +1,20 @@
package com.qxueyou.scc;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//
//@RunWith(SpringRunner.class)
//@SpringBootTest
//public class SccApplicationTests {
//
//    @Test
//    public void contextLoads() {
//    }
//
//}
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.DigestUtils;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SccApplicationTests {
    @Test
    public void contextLoads() {
        String newPassword= DigestUtils.md5DigestAsHex(("ccaa2322-2d5e-4981-af79-23d69378a18c"+"0000").getBytes());
        System.out.println(newPassword);
    }
}