From 013788bb3c3ec6c11274292a3af8957d4e8d1772 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 31 五月 2024 14:51:09 +0800 Subject: [PATCH] 实体类调整 --- src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java | 15 +++++---------- 1 files changed, 5 insertions(+), 10 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 3756bb8..1967272 100644 --- a/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java +++ b/src/main/java/com/ycl/jxkg/controller/admin/ExamPaperController.java @@ -2,7 +2,7 @@ import com.ycl.jxkg.base.BaseApiController; import com.ycl.jxkg.base.Result; -import com.ycl.jxkg.domain.ExamPaper; +import com.ycl.jxkg.domain.entity.ExamPaper; import com.ycl.jxkg.service.ExamPaperService; import com.ycl.jxkg.utils.DateTimeUtil; import com.ycl.jxkg.utils.PageInfoHelper; @@ -10,22 +10,18 @@ import com.ycl.jxkg.vo.admin.exam.ExamPaperEditRequestVO; import com.ycl.jxkg.vo.admin.exam.ExamResponseVO; import com.github.pagehelper.PageInfo; +import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +@RequiredArgsConstructor @RestController("AdminExamPaperController") @RequestMapping(value = "/api/admin/exam/paper") public class ExamPaperController extends BaseApiController { private final ExamPaperService examPaperService; - - @Autowired - public ExamPaperController(ExamPaperService examPaperService) { - this.examPaperService = examPaperService; - } @RequestMapping(value = "/page", method = RequestMethod.POST) public Result<PageInfo<ExamResponseVO>> pageList(@RequestBody ExamPaperPageRequestVO model) { @@ -70,9 +66,8 @@ @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) public Result delete(@PathVariable Integer id) { - ExamPaper examPaper = examPaperService.selectById(id); - examPaper.setDeleted(true); - examPaperService.updateByIdFilter(examPaper); + ExamPaper examPaper = examPaperService.getById(id); + examPaperService.updateById(examPaper); return Result.ok(); } } -- Gitblit v1.8.0