| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | |
| | | |
| | | @Override |
| | | public Result add(String name, String content, String teacherId,String teacherName ,String subjectId,String subjectName, |
| | | String definition,String imgPath, Date startTime, Date endTime, boolean record,List<String> classIds) { |
| | | 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) { |
| | | |
| | | UserTeacher teacher = teacherService.getTeacherByUserId(ClientUtils.getUserId()); |
| | | |
| | | MediaVideoLive live = new MediaVideoLive(); |
| | | TraceUtils.setCreateTrace(live); |
| | | |
| | | |
| | | live.setCourseId(courseId); |
| | | live.setName(name); |
| | | live.setRemark(content); |
| | | live.setPreviewImgUrl(imgPath); |
| | |
| | | public List<MediaVideoLive> list(String keyword, String [] classIds,String subjectId,Short status,Integer pageNum, Integer pageSize) { |
| | | StringBuffer hql = new StringBuffer(1000); |
| | | Map<String,Object> params = new HashMap<String,Object>(); |
| | | hql.append("from MediaVideoLive m left join fetch m.classes c left join fetch m.subject s where m.deleteFlag is false and m.name like :name "); |
| | | hql.append("from MediaVideoLive m left join fetch m.classes c left join fetch m.subject s where m.deleteFlag is false and m.name like :name "); |
| | | |
| | | params.put("name",keyword + "%"); |
| | | |
| | | if(classIds!=null && classIds.length>0){ |
| | | hql.append(" and (c.classId in(:classIds) or s.type=:subjectType)"); |
| | | hql.append(" and (c.classId in(:classIds) or s.type=:Type)"); |
| | | params.put("classIds", classIds); |
| | | params.put("subjectType", Subject.TYPE_PUBLIC_SUBJECT); |
| | | params.put("Type", Subject.TYPE_PUBLIC_SUBJECT); |
| | | }else{ |
| | | hql.append(" and s.type=:subjectType"); |
| | | params.put("subjectType", Subject.TYPE_PUBLIC_SUBJECT); |