| | |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.jxkg.base.SystemCode; |
| | | import com.ycl.jxkg.context.WebContext; |
| | | import com.ycl.jxkg.domain.entity.Meet; |
| | | import com.ycl.jxkg.enums.MeetStatusEnum; |
| | | import com.ycl.jxkg.mapper.ClassesUserMapper; |
| | | import com.ycl.jxkg.mapper.MeetMapper; |
| | | import com.ycl.jxkg.service.MeetService; |
| | |
| | | @Override |
| | | public Result add(MeetForm form) { |
| | | Meet entity = MeetForm.getEntityByForm(form, null); |
| | | entity.setStatus(MeetStatusEnum.Wait.getCode()); |
| | | entity.setCreateUser(webContext.getCurrentUser().getId()); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | |
| | | @Override |
| | | public Result page(MeetQuery query) { |
| | | Integer id = webContext.getCurrentUser().getId(); |
| | | //查自己创建的房间 |
| | | query.setTeacherId(id); |
| | | IPage<Meet> page = PageUtil.getPage(query, Meet.class); |
| | | IPage<MeetVO> page = PageUtil.getPage(query, MeetVO.class); |
| | | baseMapper.getPage(page, query); |
| | | List<Meet> records = page.getRecords(); |
| | | List<MeetVO> vos = new ArrayList<>(); |
| | | for (Meet record : records) { |
| | | MeetVO meetVO = new MeetVO(); |
| | | BeanUtils.copyProperties(record,meetVO); |
| | | vos.add(meetVO); |
| | | } |
| | | return Result.ok().data(vos).total(page.getTotal()); |
| | | |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | |
| | | return Result.ok("您暂未加入班级"); |
| | | } |
| | | query.setClassesIds(classes); |
| | | IPage<Meet> page = PageUtil.getPage(query, Meet.class); |
| | | IPage<MeetVO> page = PageUtil.getPage(query, MeetVO.class); |
| | | baseMapper.getPage(page, query); |
| | | List<Meet> records = page.getRecords(); |
| | | List<MeetVO> vos = new ArrayList<>(); |
| | | for (Meet record : records) { |
| | | MeetVO meetVO = new MeetVO(); |
| | | BeanUtils.copyProperties(record,meetVO); |
| | | vos.add(meetVO); |
| | | } |
| | | return Result.ok().data(vos).total(page.getTotal()); |
| | | |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | |
| | | public Result detail(Integer id) { |
| | | MeetVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | if(vo.getStatus().equals(MeetStatusEnum.Starting.getCode())){ |
| | | return Result.ok(); |
| | | }else { |
| | | return Result.fail(SystemCode.InnerError.getCode(),"房间尚未开始或已结束"); |
| | | } |
| | | } |
| | | |
| | | /** |