CourseController.java
@PreAuthorize("hasPermission('tienchin:course:remove')") @Log(title = "课程管理", businessType = BusinessType.DELETE) @DeleteMapping("/{courseIds}") AjaxResult remove(@PathVariable Object[] courseIds) { return toAjax(iCourseService.deleteCourseByIds(courseIds)); }
ICourseService.java
/** * 根据id删除课程 * * @param courseIds 课程id * @return 影响行数 */ int deleteCourseByIds(Object[] courseIds);
CourseServiceImpl.java
@Override public int deleteCourseByIds(Object[] courseIds) { UpdateWrapper<Course> uw = new UpdateWrapper<>(); uw.lambda() .set(Course::getDelFlag, "2") .in(Course::getCourseId, courseIds); return update(uw) ? 1 : 0; }