派生自 projectDept/qhighschool

111
EricsHu
2023-05-24 58a1078809f129905ae30e676c8705e2a083e2ec
111
4个文件已修改
45 ■■■■ 已修改文件
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/stucontroller/StuLiveController.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/hanlp.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/qxueyou/scc/controller/VideoLiveController.java
@@ -183,7 +183,7 @@
        MTCloud client = new MTCloud();
        HashMap<Object,Object> options = new HashMap<Object, Object>();
        options.put("ssl", false);
        String res = client.courseVisitorList("3360573",10,1,options);
        String res = client.courseVisitorList(courseId,page,size,options);
        return new Result(true,"开启成功",res);
    }
    /**
src/main/java/com/qxueyou/scc/stucontroller/StuLiveController.java
@@ -118,23 +118,45 @@
     * @return
     */
    @GetMapping(value = "view")
    public Result view(String couresId) throws Exception {
    public Result view(String couresId,String userId,String userName) throws Exception {
        MTCloud client = new MTCloud();
        HashMap<Object,Object> options = new HashMap<Object, Object>();
        if(userId.equals("")){
            userId= randomId();
        }
        String res = client.courseAccess(couresId, ClientUtils.getUserId(), ClientUtils.getUserName(), MTCloud.ROLE_USER, 10000, options);
        String res = client.courseAccess(couresId,userId,userName, MTCloud.ROLE_USER, 10000, options);
        JSONObject jsonObject = JSON.parseObject(res);
        JSONObject data = jsonObject.getJSONObject("data");
        String liveUrl = (String) data.get("liveUrl");
        if(jsonObject.getString("code").equals("0")){
            JSONObject data = jsonObject.getJSONObject("data");
        System.out.println(liveUrl);
            String liveUrl = (String) data.get("liveUrl");
        return new Result(true, "success",liveUrl);
            return new Result(true, "success",liveUrl);
        }
        return new Result(false, jsonObject.getString("msg"));
    }
    public  String randomId() {
            Random random=new Random();
            String str="";
            for (int i = 0; i <12; i++) {
                if(i==0){
                    //首位不能为0且数字取值区间为 [1,9]
                    str+=(random.nextInt(9)+1);
                }else{
                    //其余位的数字的取值区间为 [0,9]
                    str+=random.nextInt(10);
                }
            }
            return str;
        }
}
src/main/java/com/qxueyou/scc/teach/live/service/impl/MediaLiveService.java
@@ -336,9 +336,10 @@
    @Override
    public List<MediaVideoLive> listOfMine(String keyword, Integer pageNum, Integer pageSize) {
        
        String hql = "from MediaVideoLive where deleteFlag is false and name like ? and createId=?  order by createTime desc";
        String hql = "from MediaVideoLive where deleteFlag is false and name like ?  order by createTime desc";
        return findList(hql, new Pager(pageSize, pageNum), CollectionUtils.newList(keyword + "%",ClientUtils.getUserId()), MediaVideoLive.class);
        return findList(hql, new Pager(pageSize, pageNum), CollectionUtils.newList(keyword + "%"), MediaVideoLive.class);
    }
    
    @Override
src/main/resources/hanlp.properties
@@ -1,7 +1,7 @@
#本配置文件中的路径的根目录,根目录+其他路径=绝对路径
#Windows用户请注意,路径分隔符统一使用/
#root=D:/JavaProjects/HanLP/
root=E:/hanlpData
root=C:/higschool/qhigschool/HanLP-1.6.0
#核心词典路径
CoreDictionaryPath=data/dictionary/CoreNatureDictionary.txt
#2元语法词典路径