From 13e13d59858f7159dabfa4981f62818405491e0d Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期四, 15 六月 2023 16:40:16 +0800 Subject: [PATCH] 1 --- src/main/java/com/qxueyou/scc/controller/VideoLiveController.java | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java b/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java index bab0bf5..02ed5f2 100644 --- a/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java +++ b/src/main/java/com/qxueyou/scc/controller/VideoLiveController.java @@ -55,6 +55,9 @@ @Autowired MediaLiveDAO dao; + + @Autowired + CommonDAO commonDAO; /** * 鑾峰彇鐩存挱鍒楄〃 @@ -127,17 +130,17 @@ options.put("modetype", 6); //灏唋ong绫诲瀷杞崲涓篠tring绫诲瀷 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+00:00")); String startTime1 = simpleDateFormat.format(new Date(startTime)); String endTime1 = simpleDateFormat.format(new Date(endTime)); + System.out.println(startTime1+"------"+endTime1); //璋冪敤绗笁鏂圭洿鎾帴鍙� String s = client.courseAdd(name, ClientUtils.getUserId(), startTime1, endTime1, ClientUtils.getUserName(), "222", options); //json杞崲鎷垮埌courseId JSONObject jsonObject = JSON.parseObject(s); JSONObject data = jsonObject.getJSONObject("data"); - String course_id = (String) data.get("course_id"); // System.out.println(Integer.parseInt(course_id)); 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(","))); return new Result(true, "鎴愬姛", s); } @@ -155,9 +158,12 @@ String res = client.courseLogin(ClientUtils.getUserId(),MTCloud.ACCOUNT_TYPE_THIRD, options); System.out.println(res); JSONObject jsonObject = JSON.parseObject(res); - JSONObject data = jsonObject.getJSONObject("data"); - String protocol = (String) data.get("url"); - return new Result(true,"寮�鍚垚鍔�",protocol); + if(jsonObject.getString("code").equals("0")){ + JSONObject data = jsonObject.getJSONObject("data"); + String protocol = (String) data.get("url"); + return new Result(true,"寮�鍚垚鍔�",protocol); + } + return new Result(false,jsonObject.getString("msg")); } @ApiOperation(value = "淇敼鐩存挱鐘舵��") @@ -166,7 +172,6 @@ MediaVideoLive revamp = liveService.revamp(courseId); revamp.setStatus(MediaVideoLive.STATUS_LIVE_STOP); - CommonDAO commonDAO=new CommonDAO(); commonDAO.update(revamp); return new Result(true,"鍏抽棴鎴愬姛"); @@ -178,9 +183,16 @@ 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); } + +// @ApiOperation(value = "鏌ョ湅璇︽儏") +// @GetMapping(value = "detailLive") +// public Result detailLive(String liveId) { +// commonDAO.find +// return new Result(true,"寮�鍚垚鍔�",res); +// } /** * 鏌ヨ鐩存挱璇︽儏 * -- Gitblit v1.8.0