From bf3dcc63f2884284e2ea195b0a6307734f9d4c52 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期三, 12 六月 2024 15:46:50 +0800 Subject: [PATCH] feat:本地文件上传、预览 --- src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java b/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java index 046cc96..ad3a1f7 100644 --- a/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java +++ b/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java @@ -5,7 +5,9 @@ import com.ycl.jxkg.domain.entity.ExamPaper; import com.ycl.jxkg.domain.entity.ExamPaperQuestion; import com.ycl.jxkg.domain.form.ExamPaperForm; +import com.ycl.jxkg.domain.question.TemplateQuestionDTO; import com.ycl.jxkg.domain.vo.admin.paper.ExamPaperQuestionVO; +import com.ycl.jxkg.enums.ExamPaperTypeEnum; import com.ycl.jxkg.enums.VisibilityEnum; import com.ycl.jxkg.group.Add; import com.ycl.jxkg.group.Update; @@ -27,6 +29,8 @@ import javax.validation.Valid; import java.util.Date; +import java.util.List; + @Validated @RequiredArgsConstructor @RestController("AdminExamPaperController") @@ -41,14 +45,7 @@ @RequestMapping(value = "/page", method = RequestMethod.POST) public Result<PageInfo<ExamResponseVO>> pageList(@RequestBody ExamPaperPageRequestVO model) { - PageInfo<ExamPaper> pageInfo = examPaperService.page(model); - PageInfo<ExamResponseVO> page = PageInfoHelper.copyMap(pageInfo, e -> { - ExamResponseVO vo = new ExamResponseVO(); - BeanUtils.copyProperties(e, vo); - vo.setVisibility(VisibilityEnum.valueOf(vo.getVisibility()).getCode()+""); - vo.setCreateTime(DateTimeUtil.dateFormat(e.getCreateTime())); - return vo; - }); + PageInfo<ExamResponseVO> page = examPaperService.page(model); return Result.ok(page); } @@ -60,8 +57,7 @@ } form.setCreateUser(getCurrentUser().getId()); form.setCreateTime(new Date()); - ExamPaper entity = ExamPaperForm.getEntityByForm(form,null); - examPaperService.save(entity); + examPaperService.addPaper(form); return Result.ok(); } @@ -71,9 +67,7 @@ if (!StringUtils.isBlank(form.getVisibility())) { form.setVisibility(VisibilityEnum.fromCode(form.getVisibility()).getName()); } - //TODO:淇敼鑱旇〃閲岀殑鍒嗘暟 - ExamPaper entity = ExamPaperForm.getEntityByForm(form,null); - examPaperService.updateById(entity); + examPaperService.updateExamPaper(form); return Result.ok(); } @@ -98,4 +92,10 @@ baseMapper.deleteById(id); return Result.ok(); } + + @GetMapping("/my") + public Result myExamPaper(Integer paperType) { + List<ExamPaper> list = examPaperService.myExamPaper(paperType); + return Result.ok(list); + } } -- Gitblit v1.8.0