From 4b6f7e38ade31f1cd4235bdf020b9d4f7e0e5c39 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Tue, 9 Jul 2024 10:21:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=94=99=E9=A2=98=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/controller/exam/UserBookController.java | 11 +++++++++++ .../ruoyi/web/controller/manager/UserBookManager.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserBookController.java index b625aa8..9082239 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserBookController.java @@ -1,12 +1,15 @@ package com.ruoyi.web.controller.exam; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.userbook.dto.UserBookDTO; import com.ruoyi.web.controller.manager.UserBookManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; @@ -52,6 +55,14 @@ public class UserBookController extends BaseController { } + @ApiOperation("删除") + @Log(title = "错题", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(userBookManager.deleteRepoByIds(ids)); + } + @ApiOperation("详情") @GetMapping("/view/{id}") public String view(@PathVariable("id") String id, ModelMap mmap) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java index aa3613b..26631e7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import javax.annotation.Resource; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Objects; @@ -97,6 +98,11 @@ public class UserBookManager { } + public boolean deleteRepoByIds(String ids) { + return userBookService.removeByIds(Arrays.asList(Convert.toStrArray(ids))); + } + + public String findNext(String examId, String quId) { Integer sort = 999999; if(Objects.nonNull(quId)){