| | |
| | | package com.ycl.jxkg.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Assert; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.entity.ExamTemplate; |
| | | import com.ycl.jxkg.domain.form.ExamTemplateForm; |
| | | import com.ycl.jxkg.domain.query.ExamTemplateQuery; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamTemplateVO; |
| | | import com.ycl.jxkg.mapper.ExamTemplateMapper; |
| | | import com.ycl.jxkg.service.ExamTemplateService; |
| | | import com.ycl.jxkg.utils.PageUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.jxkg.domain.form.ExamTemplateForm; |
| | | import com.ycl.jxkg.domain.vo.ExamTemplateVO; |
| | | import com.ycl.jxkg.domain.query.ExamTemplateQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.ycl.jxkg.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | /** |
| | | * 随机试卷模板 服务实现类 |
| | | * |
| | | * @author 开发人员名字 |
| | | * @since 2024-06-03 |
| | | * @author flq |
| | | * @since 2024-06-05 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | |
| | | public Result page(ExamTemplateQuery query) { |
| | | IPage<ExamTemplateVO> page = PageUtil.getPage(query, ExamTemplateVO.class); |
| | | baseMapper.getPage(page, query); |
| | | PageInfo<ExamTemplateVO> pageInfo = new PageInfo<>(); |
| | | pageInfo.setList(page.getRecords()); |
| | | pageInfo.setTotal(page.getTotal()); |
| | | return Result.ok(pageInfo); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | |
| | | public Result detail(Integer id) { |
| | | ExamTemplateVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok(vo); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<ExamTemplateVO> vos = entities.stream() |
| | | .map(entity -> ExamTemplateVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok(vos); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |