From 0ab71d4f9154dc2a0306ea57ec08659f4e28e449 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Mon, 16 Mar 2026 16:04:06 +0800
Subject: [PATCH] 1. 智云3.0业务优化,优化类型获取。
---
ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationServiceImpl.java | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationServiceImpl.java b/ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationServiceImpl.java
index bf09f45..ee16970 100644
--- a/ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationServiceImpl.java
+++ b/ard-sample/src/main/java/com/ard/sample/annotation/service/impl/AnnotationServiceImpl.java
@@ -31,8 +31,23 @@
return updateById(entity);
}
+ /**
+ * 新增:修改标注显示状态
+ */
@Override
- public boolean deleteAnnotation(Integer id) {
+ public boolean updateAnnotationVisible(String id, Boolean isTrue) {
+ if (id == null || id.isEmpty() || isTrue == null) {
+ log.error("修改标注显示状态失败:参数非法,id={}, isTrue={}", id, isTrue);
+ return false;
+ }
+ AnnotationEntity entity = new AnnotationEntity();
+ entity.setId(id);
+ entity.setIsTrue(isTrue);
+ return updateById(entity);
+ }
+
+ @Override
+ public boolean deleteAnnotation(String id) {
if (id == null) {
log.error("删除标记失败:ID为空");
return false;
@@ -43,7 +58,7 @@
}
@Override
- public boolean batchDeleteAnnotation(List<Integer> ids) {
+ public boolean batchDeleteAnnotation(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
log.error("批量删除标记失败:ID列表为空");
return false;
@@ -54,11 +69,25 @@
}
@Override
- public List<AnnotationEntity> listByDirectoryId(Integer directoryId) {
+ public List<AnnotationEntity> listByDirectoryId(String directoryId) {
if (directoryId == null) {
log.error("按目录查询标记失败:目录ID为空");
return List.of();
}
return lambdaQuery().eq(AnnotationEntity::getDirectoryId, directoryId).list();
}
+
+ /**
+ * 按标注ID获取详细信息(核心实现)
+ */
+ @Override
+ public AnnotationEntity getAnnotationById(String id) {
+ // 1. 参数校验
+ if (id == null || id.isEmpty()) {
+ log.error("按ID查询标注失败:标注ID为空");
+ return null;
+ }
+ // 2. MyBatis-Plus通用查询(根据主键ID查询)
+ return getById(id);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3