| | |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import com.qxueyou.scc.teach.live.model.AccessLog; |
| | | import com.qxueyou.scc.teach.live.model.MediaVideoLive; |
| | | import com.qxueyou.scc.teach.live.service.IMediaLiveService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.net.URLDecoder; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | //签名验证成功 |
| | | if(reqParams.get("cmd").equals("live.start")){//直播开始 |
| | | //路演直播状态结束业务处理 |
| | | Integer courseId =(Integer) params.get("course_id"); |
| | | String courseId = (String) params.get("course_id"); |
| | | StringBuffer hql=new StringBuffer("from MediaVideoLive where deleteFlag is false and courseId=?"); |
| | | List<Object> args = CollectionUtils.newList(courseId); |
| | | List<Object> args = CollectionUtils.newList(Integer.valueOf(courseId)); |
| | | MediaVideoLive unique = commonDAO.findUnique(hql.toString(), args, MediaVideoLive.class); |
| | | unique.setStatus(MediaVideoLive.STATUS_LIVE_LIVE); |
| | | commonDAO.update(unique); |
| | | }else if(reqParams.get("cmd").equals("live.stop")){//直播结束 |
| | | //路演直播状态结束业务处理 |
| | | Integer courseId =(Integer) params.get("course_id"); |
| | | String courseId = (String) params.get("course_id"); |
| | | StringBuffer hql=new StringBuffer("from MediaVideoLive where deleteFlag is false and courseId=?"); |
| | | List<Object> args = CollectionUtils.newList(courseId); |
| | | List<Object> args = CollectionUtils.newList(Integer.valueOf(courseId)); |
| | | MediaVideoLive unique = commonDAO.findUnique(hql.toString(), args, MediaVideoLive.class); |
| | | unique.setStatus(MediaVideoLive.STATUS_LIVE_STOP); |
| | | StringBuffer accessLog=new StringBuffer("from AccessLog where courseId=? and type='videoLive'"); |
| | | List<Object> arglog = CollectionUtils.newList(courseId); |
| | | AccessLog unique1 = commonDAO.findUnique(accessLog.toString(), arglog, AccessLog.class); |
| | | unique1.setLeaveTime(new Date()); |
| | | commonDAO.update(unique1); |
| | | commonDAO.update(unique); |
| | | } |
| | | return new Result(true,"suc"); |