diff --git a/service/src/main/java/cn/bunny/services/service/impl/PowerServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/PowerServiceImpl.java index eea7068..e47a3c9 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/PowerServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/PowerServiceImpl.java @@ -20,8 +20,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jakarta.validation.Valid; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -74,7 +72,6 @@ public class PowerServiceImpl extends ServiceImpl implements * @return 所有权限列表 */ @Override - @Cacheable(cacheNames = "power", key = "'allPower'", cacheManager = "cacheManagerWithMouth") public List getAllPowers() { List powerList = list(); return powerList.stream().map(power -> { @@ -90,7 +87,6 @@ public class PowerServiceImpl extends ServiceImpl implements * @param dto 权限添加 */ @Override - @CacheEvict(cacheNames = "power", key = "'allPower'", beforeInvocation = true) public void addPower(@Valid PowerAddDto dto) { // 添加权限时确保权限码和请求地址是唯一的 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); @@ -112,7 +108,6 @@ public class PowerServiceImpl extends ServiceImpl implements * @param dto 权限更新 */ @Override - @CacheEvict(cacheNames = "power", key = "'allPower'", beforeInvocation = true) public void updatePower(@Valid PowerUpdateDto dto) { Long id = dto.getId(); List powerList = list(Wrappers.lambdaQuery().eq(Power::getId, id)); @@ -131,7 +126,6 @@ public class PowerServiceImpl extends ServiceImpl implements * @param ids 删除id列表 */ @Override - @CacheEvict(cacheNames = "power", key = "'allPower'", beforeInvocation = true) public void deletePower(List ids) { // 判断数据请求是否为空 if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY); @@ -149,7 +143,6 @@ public class PowerServiceImpl extends ServiceImpl implements * @param dto 批量修改权限表单 */ @Override - @CacheEvict(cacheNames = "power", key = "'allPower'", beforeInvocation = true) public void updateBatchByPowerWithParentId(PowerUpdateBatchByParentIdDto dto) { List powerList = dto.getIds().stream().map(id -> { Power power = new Power(); diff --git a/service/src/main/java/cn/bunny/services/service/impl/RoleServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/RoleServiceImpl.java index 690f0a3..0a4d620 100644 --- a/service/src/main/java/cn/bunny/services/service/impl/RoleServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/impl/RoleServiceImpl.java @@ -20,8 +20,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jakarta.validation.Valid; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import java.util.List; @@ -79,7 +77,6 @@ public class RoleServiceImpl extends ServiceImpl implements Ro * @return 所有角色列表 */ @Override - @Cacheable(cacheNames = "role", key = "'allRole'", cacheManager = "cacheManagerWithMouth") public List getAllRoles() { return list().stream().map(role -> { RoleVo roleVo = new RoleVo(); @@ -94,7 +91,6 @@ public class RoleServiceImpl extends ServiceImpl implements Ro * @param dto 角色添加 */ @Override - @CacheEvict(cacheNames = "role", key = "'allRole'", beforeInvocation = true) public void addRole(@Valid RoleAddDto dto) { // 判断角色码是否被添加过 List roleList = list(Wrappers.lambdaQuery().eq(Role::getRoleCode, dto.getRoleCode())); @@ -112,7 +108,6 @@ public class RoleServiceImpl extends ServiceImpl implements Ro * @param dto 角色更新 */ @Override - @CacheEvict(cacheNames = "role", key = "'allRole'", beforeInvocation = true) public void updateRole(@Valid RoleUpdateDto dto) { // 查询更新的角色是否存在 List roleList = list(Wrappers.lambdaQuery().eq(Role::getId, dto.getId())); @@ -130,7 +125,6 @@ public class RoleServiceImpl extends ServiceImpl implements Ro * @param ids 删除id列表 */ @Override - @CacheEvict(cacheNames = "role", key = "'allRole'", beforeInvocation = true) public void deleteRole(List ids) { // 判断数据请求是否为空 if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);