From bd19bb31512c2ab232e801d10fab9edacedf26ea Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Mon, 09 Mar 2026 13:55:56 +0800
Subject: [PATCH] 2026-03-09 标记功能接口调整: 优化is_true字段,用于标记是否在地图上可见;只要true/false
---
ard-admin/src/main/java/com/ard/web/controller/sample/AnnotationController.java | 45 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/ard-admin/src/main/java/com/ard/web/controller/sample/AnnotationController.java b/ard-admin/src/main/java/com/ard/web/controller/sample/AnnotationController.java
index a6c0f77..196d6c5 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/sample/AnnotationController.java
+++ b/ard-admin/src/main/java/com/ard/web/controller/sample/AnnotationController.java
@@ -64,9 +64,27 @@
return ResponseEntity.ok(result);
}
+ // 新增:修改目录显示状态
+ @ApiOperation("修改目录是否可见")
+ @PutMapping("/dirvisible/{id}/{isTrue}")
+ public ResponseEntity<Map<String, Object>> updateDirectoryVisible(@PathVariable String id, @PathVariable Boolean isTrue) {
+ Map<String, Object> result = new HashMap<>();
+ try{
+ boolean success = directoryService.updateDirectoryVisible(id, isTrue);
+ result.put("success", success);
+ result.put("msg", success ? "修改目录是否可见成功" : "修改目录是否可见失败");
+ }
+ catch (Exception e) {
+ log.error("修改目录是否可见异常", e);
+ result.put("success", false);
+ result.put("msg", "修改目录是否可见失败:" + e.getMessage());
+ }
+ return ResponseEntity.ok(result);
+ }
+
@ApiOperation("删除目录及子项")
@DeleteMapping("/directory/{id}")
- public ResponseEntity<Map<String, Object>> deleteDirectory(@PathVariable Integer id) {
+ public ResponseEntity<Map<String, Object>> deleteDirectory(@PathVariable String id) {
Map<String, Object> result = new HashMap<>();
try {
boolean success = directoryService.deleteDirectory(id);
@@ -117,9 +135,28 @@
return ResponseEntity.ok(result);
}
+ // 新增:修改标注显示状态
+ @ApiOperation("修改标记是否可见")
+ @PutMapping("/annvisible/{id}/{isTrue}")
+ public ResponseEntity<Map<String, Object>> updateAnnotationVisible(@PathVariable String id, @PathVariable Boolean isTrue) {
+ Map<String, Object> result = new HashMap<>();
+ try{
+ boolean success = annotationService.updateAnnotationVisible(id, isTrue);
+ result.put("success", success);
+ result.put("msg", success ? "修改标记是否可见成功" : "修改标记是否可见失败");
+ }
+ catch (Exception e) {
+ log.error("修改标记是否可见异常", e);
+ result.put("success", false);
+ result.put("msg", "修改标记是否可见失败:" + e.getMessage());
+ }
+ //boolean result = annotationService.updateAnnotationVisible(id, isTrue);
+ return ResponseEntity.ok(result);
+ }
+
@ApiOperation("删除标记")
@DeleteMapping("/{id}")
- public ResponseEntity<Map<String, Object>> deleteAnnotation(@PathVariable Integer id) {
+ public ResponseEntity<Map<String, Object>> deleteAnnotation(@PathVariable String id) {
Map<String, Object> result = new HashMap<>();
try {
boolean success = annotationService.deleteAnnotation(id);
@@ -135,7 +172,7 @@
@ApiOperation("批量删除标记")
@DeleteMapping("/batch")
- public ResponseEntity<Map<String, Object>> batchDeleteAnnotation(@RequestBody List<Integer> ids) {
+ public ResponseEntity<Map<String, Object>> batchDeleteAnnotation(@RequestBody List<String> ids) {
Map<String, Object> result = new HashMap<>();
try {
boolean success = annotationService.batchDeleteAnnotation(ids);
@@ -152,7 +189,7 @@
// 层级查询:目录→标记→坐标
@ApiOperation("按目标id获取所有目录及子标记信息")
@GetMapping("/directory/{directoryId}")
- public ResponseEntity<Map<String, Object>> getDirectoryWithAnnotations(@PathVariable Integer directoryId) {
+ public ResponseEntity<Map<String, Object>> getDirectoryWithAnnotations(@PathVariable String directoryId) {
Map<String, Object> result = new HashMap<>();
try {
// 1. 查询目录
--
Gitblit v1.9.3