From dc3c8fa7e6939c0ef0958930c62752b62abe8329 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Wed, 3 Jul 2024 14:14:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/controller/exam/ExamController.java | 13 ++++++------- .../ruoyi/web/controller/manager/ExamManager.java | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java index ed50056..151ce6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java @@ -117,13 +117,12 @@ public class ExamController extends BaseController { return success(examManager.detail(id)); } - - - - - - - + @Log(title = "考试", businessType = BusinessType.UPDATE) + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(ExamDTO examDTO) { + return success(examManager.changeStatus(examDTO)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java index 7c9dd9d..2c02f33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java @@ -187,4 +187,18 @@ public class ExamManager { reqDTO.setTotalScore(objScore); } + + /** + * + * 启用,禁用 + * @param examDTO + * @return boolean + */ + public boolean changeStatus(ExamDTO examDTO) { + return elExamService.lambdaUpdate() + .eq(ElExam::getId, examDTO.getId()) + .set(ElExam::getState, examDTO.getState()) + .update(); + } + }