CourseController.java
代码语言:javascript
复制@PreAuthorize("hasPermission('tienchin:course:remove')")
@Log(title = "课程管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{courseIds}")
AjaxResult remove(@PathVariable Object[] courseIds) {
return toAjax(iCourseService.deleteCourseByIds(courseIds));
}
ICourseService.java
代码语言:javascript
复制/**
* 根据id删除课程
*
* @param courseIds 课程id
* @return 影响行数
*/
int deleteCourseByIds(Object[] courseIds);
CourseServiceImpl.java
代码语言:javascript
复制@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;
}