| | |
| | | import com.ycl.jxkg.vo.student.exam.ExamPaperPageResponseVO; |
| | | import com.ycl.jxkg.vo.student.exam.ExamPaperPageVO; |
| | | import com.github.pagehelper.PageInfo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | |
| | | @RequiredArgsConstructor |
| | | @Controller("WXStudentExamController") |
| | | @RequestMapping(value = "/api/wx/student/exampaper") |
| | | @ResponseBody |
| | |
| | | |
| | | private final ExamPaperService examPaperService; |
| | | private final SubjectService subjectService; |
| | | |
| | | @Autowired |
| | | public ExamPaperController(ExamPaperService examPaperService, SubjectService subjectService) { |
| | | this.examPaperService = examPaperService; |
| | | this.subjectService = subjectService; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) |
| | |
| | | PageInfo<ExamPaperPageResponseVO> page = PageInfoHelper.copyMap(pageInfo, e -> { |
| | | ExamPaperPageResponseVO vo = new ExamPaperPageResponseVO(); |
| | | BeanUtils.copyProperties(e, vo); |
| | | Subject subject = subjectService.selectById(vo.getSubjectId()); |
| | | Subject subject = subjectService.getById(vo.getSubjectId()); |
| | | vo.setSubjectName(subject.getName()); |
| | | vo.setCreateTime(DateTimeUtil.dateFormat(e.getCreateTime())); |
| | | return vo; |