| | |
| | | * 新增:修改目录显示状态 |
| | | */ |
| | | @Override |
| | | public boolean updateDirectoryVisible(String id, Integer isTrue) { |
| | | if (id == null || id.isEmpty() || isTrue == null || (isTrue != 0 && isTrue != 1)) { |
| | | public boolean updateDirectoryVisible(String id, Boolean isTrue) { |
| | | if (id == null || id.isEmpty() || isTrue == null) { |
| | | log.error("修改目录显示状态失败:参数非法,id={}, isTrue={}", id, isTrue); |
| | | return false; |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) // 事务保证级联删除 |
| | | public boolean deleteDirectory(String id) { |
| | | if (id == null) { |
| | | if (id == null || id.isEmpty()) { |
| | | log.error("删除目录失败:ID为空"); |
| | | return false; |
| | | } |
| | | // ====================== 关键:不允许删除默认文件夹 ====================== |
| | | if ("default_directory_00000001".equals(id)) { |
| | | log.error("删除目录失败:默认文件夹不允许删除"); |
| | | throw new RuntimeException("默认文件夹不允许删除"); |
| | | } |
| | | // 1. 删除目录下所有标记 |
| | | annotationMapper.deleteByMap(Map.of("directory_id", id)); |
| | | // 2. 删除目录 |