feat:错题删除

pg_adapter
wangxy 9 months ago
parent ce51c6195f
commit 4b6f7e38ad

@ -1,12 +1,15 @@
package com.ruoyi.web.controller.exam; package com.ruoyi.web.controller.exam;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.userbook.dto.UserBookDTO; import com.ruoyi.system.domain.userbook.dto.UserBookDTO;
import com.ruoyi.web.controller.manager.UserBookManager; import com.ruoyi.web.controller.manager.UserBookManager;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; 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("详情") @ApiOperation("详情")
@GetMapping("/view/{id}") @GetMapping("/view/{id}")
public String view(@PathVariable("id") String id, ModelMap mmap) { public String view(@PathVariable("id") String id, ModelMap mmap) {

@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; 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) { public String findNext(String examId, String quId) {
Integer sort = 999999; Integer sort = 999999;
if(Objects.nonNull(quId)){ if(Objects.nonNull(quId)){

Loading…
Cancel
Save