| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.qxueyou.scc.admin.teacher.service.ITeacherService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | @Autowired |
| | | IClassService classService; |
| | | |
| | | @Autowired |
| | | private ITeacherService teacherService; |
| | | @Value("${server.context-index}") |
| | | private String WEB_INDEX; |
| | | |
| | |
| | | |
| | | // request.getSession().invalidate(); |
| | | // ClientUtils.isAdmin()=true; |
| | | String teacherId = ClientUtils.isAdmin()?null:ClientUtils.getUserId(); |
| | | |
| | | List<ClsClass> clsLst = classService.getClassLst("",teacherId, 2000, 1, 1); |
| | | |
| | | //判断是否是教师 |
| | | String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | |
| | | List<ClsClass> clsLst = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(teacherId)) { |
| | | //获取该老师下发布的课程的所属班级 |
| | | clsLst = classService.getTeacherClassLst(teacherId); |
| | | }else{ |
| | | //管理员查询所有班级 |
| | | clsLst =classService.getClassLst("",teacherId, 2000, 1, 1); |
| | | } |
| | | List<Map<String,Object>> result = new ArrayList<Map<String,Object>>(clsLst.size()*2); |
| | | |
| | | for(ClsClass cls:clsLst) { |
| | | result.add(classService.getClassActivityInfo(cls.getClassId())); |
| | | Map<String, Object> classActivityInfo = classService.getClassActivityInfo(cls.getClassId()); |
| | | result.add(classActivityInfo); |
| | | } |
| | | |
| | | return new Result(true,null,result); |