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)){