更改一下菜单权限,将删除渠道的 delete 改为 remove:
ChannelController.java
@PreAuthorize("hasPermission('tienchin:channel:remove')") @Log(title = "渠道管理", businessType = BusinessType.DELETE) @DeleteMapping("/{channelIds}") AjaxResult remove(@PathVariable Object[] channelIds) { return toAjax(iChannelService.deleteChannelByIds(channelIds)); }
IChannelService.java
/** * 删除渠道 * * @param channelIds 渠道ID * @return int {@code 0} 失败 {@code 1} 成功 * @author BNTang * @since 2023/09/03 10:48:51 */ int deleteChannelByIds(Object[] channelIds);
ChannelServiceImpl.java
@Override public int deleteChannelByIds(Object[] channelIds) { UpdateWrapper<Channel> channelQueryWrapper = new UpdateWrapper<>(); channelQueryWrapper.lambda() .set(Channel::getDelFlag, "2") .in(Channel::getChannelId, channelIds); return update(channelQueryWrapper) ? 1 : 0; }