ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationDirectoryServiceImpl.java
@@ -45,9 +45,24 @@
        return updateById(entity);
    }
    /**
     * 新增:修改目录显示状态
     */
    @Override
    public boolean updateDirectoryVisible(String id, Integer isTrue) {
        if (id == null || id.isEmpty() || isTrue == null || (isTrue != 0 && isTrue != 1)) {
            log.error("修改目录显示状态失败:参数非法,id={}, isTrue={}", id, isTrue);
            return false;
        }
        AnnotationDirectoryEntity entity = new AnnotationDirectoryEntity();
        entity.setId(id);
        entity.setIsTrue(isTrue);
        return updateById(entity);
    }
    @Override
    @Transactional(rollbackFor = Exception.class) // 事务保证级联删除
    public boolean deleteDirectory(Integer id) {
    public boolean deleteDirectory(String id) {
        if (id == null) {
            log.error("删除目录失败:ID为空");
            return false;
@@ -74,7 +89,7 @@
        // 2. 批量查询所有标注,按目录ID分组(减少数据库查询次数)
        List<AnnotationEntity> allAnnotations = annotationService.list();
        Map<Integer, List<AnnotationEntity>> annotationMap = allAnnotations.stream()
        Map<String, List<AnnotationEntity>> annotationMap = allAnnotations.stream()
                .collect(Collectors.groupingBy(AnnotationEntity::getDirectoryId));
        // 3. 遍历目录,组装DTO(关联下属标注)