package com.yf.exam.modules.user.book.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.yf.exam.core.api.ApiRest; import com.yf.exam.core.api.controller.BaseController; import com.yf.exam.core.api.dto.BaseIdRespDTO; import com.yf.exam.core.api.dto.BaseIdsReqDTO; import com.yf.exam.core.api.dto.PagingReqDTO; import com.yf.exam.modules.user.book.dto.UserBookDTO; import com.yf.exam.modules.user.book.service.UserBookService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** *
* 错题本控制器,处理与错题本相关的HTTP请求 *
* * @author 聪明笨狗 * @since 2020-05-27 17:56 */ @Api(tags={"错题本"}) @RestController @RequestMapping("/exam/api/user/wrong-book") public class UserBookController extends BaseController { /** * 注入错题本服务类,用于处理错题本相关的业务逻辑 */ @Autowired private UserBookService baseService; /** * 批量删除错题本记录 * @param reqDTO 包含要删除记录ID列表的请求对象 * @return 操作结果的统一响应对象 */ @ApiOperation(value = "批量删除") @RequestMapping(value = "/delete", method = { RequestMethod.POST}) public ApiRest delete(@RequestBody BaseIdsReqDTO reqDTO) { // 根据传入的ID列表删除对应的错题本记录 baseService.removeByIds(reqDTO.getIds()); // 返回操作成功的响应 return super.success(); } /** * 分页查找错题本记录 * @param reqDTO 包含分页信息和查询条件的请求对象 * @return 包含分页结果的统一响应对象 */ @ApiOperation(value = "分页查找") @RequestMapping(value = "/paging", method = { RequestMethod.POST}) public ApiRest