| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @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()); |
| | | |
| | |
| | | live.setPreviewImgUrl(imgPath); |
| | | live.setStartTime(startTime); |
| | | live.setEndTime(endTime); |
| | | live.setPortalStatus(portalStatus); |
| | | live.setStatus(MediaVideoLive.STATUS_LIVE_DRAFT); |
| | | |
| | | if(teacher!=null){ |
| | |
| | | save(live); |
| | | return Result.SUCCESS; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result delete(String[] liveIds) { |
| | | public Result delete(String[] liveIds,String [] courseIds) throws Exception { |
| | | for(String liveId:liveIds) { |
| | | delete(liveId); |
| | | for(String courseId:courseIds) { |
| | | MTCloud client = new MTCloud(); |
| | | String s = client.courseDelete(courseId); |
| | | } |
| | | } |
| | | return Result.SUCCESS; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result doIssue(String liveId) { |
| | |
| | | |
| | | return this.findCountByComplexHql(hql.toString(), params); |
| | | } |
| | | |
| | | @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"; |
| | | |
| | | return findList(hql, new Pager(pageSize, pageNum), CollectionUtils.newList(keyword + "%",ClientUtils.getUserId()), MediaVideoLive.class); |
| | | @Override |
| | | public List<MediaVideoLive> listvideo(String status) { |
| | | |
| | | String hql = "from MediaVideoLive where deleteFlag is false and status=? order by createTime desc"; |
| | | |
| | | |
| | | return find(hql, CollectionUtils.newList(status), MediaVideoLive.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<MediaVideoLive> listOfMine(String keyword,String portalStatus, Integer pageNum, Integer pageSize) { |
| | | |
| | | 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 + "%",portalStatus), MediaVideoLive.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public MediaVideoLive read(String liveId) { |
| | | return read(MediaVideoLive.class,liveId); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public MediaVideoLive revamp(int courseId) { |
| | | String hql = "from MediaVideoLive where deleteFlag is false and courseId=?"; |
| | | MediaVideoLive unique = findUnique(hql, CollectionUtils.newList(courseId), MediaVideoLive.class); |
| | | return unique ; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public List<MediaVideoLive> readByStatus(List<String> liveIdLst,short[] status) { |