|
|
@@ -17,6 +17,7 @@ import cn.iselab.mooctest.site.web.exception.HttpBadRequestException;
|
|
|
import cn.iselab.mooctest.site.web.exception.HttpNotFoundException;
|
|
|
import cn.iselab.mooctest.site.web.logic.BaseLogic;
|
|
|
import cn.iselab.mooctest.site.web.logic.ExamLogic;
|
|
|
+import org.apache.shiro.authz.UnauthorizedException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.convert.converter.Converter;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
@@ -87,6 +88,13 @@ public class ExamLogicImpl extends BaseLogic implements ExamLogic {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public ExamVO getExamByIdAndParticipantId(Long examId, Long userId) {
|
|
|
+ Task task = examService.getExamByIdAndParticipantId(examId, userId);
|
|
|
+ ExamVO examVO = examVOWrapper.wrapExamFrom(task);
|
|
|
+ return examVO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Page<ExamVO> getOrganizerExamList(Long organizerId, Byte type, Integer status, String keyword, Pageable pageable) {
|
|
|
Page<Task> taskPage = examService.getExamsByOrganizerId(organizerId, type, status, keyword, pageable);
|
|
|
Page<ExamVO> examVOPage = taskPage.map(new Converter<Task, ExamVO>() {
|