TienChin 活动管理-删除活动

2023-10-12 14:52:31 浏览数 (2)

后端

ActivityController.java

代码语言:javascript复制
@PreAuthorize("hasPermission('tienchin:activity:remove')")
@Log(title = "活动管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{activityIds}")
AjaxResult remove(@PathVariable Object[] activityIds) {
    return toAjax(iActivityService.deleteActivityByIds(activityIds));
}

IActivityService.java

代码语言:javascript复制
/**
 * 删除活动
 *
 * @param activityIds 活动Ids
 * @return int 删除结果
 * @author BNTang
 * @since 2023/09/22 01:37:35
 */
int deleteActivityByIds(Object[] activityIds);

ActivityServiceImpl.java

代码语言:javascript复制
@Override
public int deleteActivityByIds(Object[] activityIds) {
    UpdateWrapper<Activity> uw = new UpdateWrapper<>();

    uw.lambda()
            .set(Activity::getDelFlag, "2")
            .in(Activity::getActivityId, activityIds);

    return update(uw) ? 1 : 0;
}

0 人点赞