图标库

This commit is contained in:
ZZX9599
2025-09-26 13:46:24 +08:00
parent 8479d174be
commit 26af321271
37 changed files with 751 additions and 23 deletions

View File

@ -102,7 +102,6 @@ public class SourceController {
return ApiResponse.success(source);
}
@Operation(summary = "新增其他资源")
@PostMapping("/addOtherSource")
public ApiResponse addOtherSource(@RequestBody AddOtherSourceDto addOtherSourceDto) throws JsonProcessingException {
@ -126,7 +125,6 @@ public class SourceController {
return ApiResponse.success(source);
}
@Operation(summary = "更新资源信息")
@PostMapping("/update")
public ApiResponse updateSource(@RequestBody UpdateSourceDto updateSourceDto) {
@ -146,7 +144,6 @@ public class SourceController {
sourceType,
updateSourceDto.getParams()
);
System.out.println("更新的数据:" + validatedParams);
source.setParams(MapUtil.mapToString(updateSourceDto.getParams()));
}
// 保存更新
@ -160,6 +157,36 @@ public class SourceController {
return ApiResponse.success(sourceService.getSourceListByUserId(StpUtil.getLoginIdAsString()));
}
@Operation(summary = "拖动资源")
@PostMapping("/dragSource")
public ApiResponse drag(@RequestBody List<DragSourceDto> dragSourceDtoList) {
for (DragSourceDto dragSourceDto : dragSourceDtoList) {
LambdaQueryWrapper<Source> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Source::getId, dragSourceDto.getId());
Source source = sourceService.getOne(queryWrapper);
source.setTreeIndex(dragSourceDto.getTreeIndex());
source.setParentId(dragSourceDto.getParentId());
sourceService.updateById(source);
}
return ApiResponse.success(null);
}
@Operation(summary = "更新层级")
@PostMapping("/updateLevel")
public ApiResponse updateLevel(@RequestBody List<UpdateLevelDto> updateLevelDtoList) {
for (UpdateLevelDto updateLevelDto : updateLevelDtoList) {
LambdaQueryWrapper<Source> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Source::getId, updateLevelDto.getId());
Source source = sourceService.getOne(queryWrapper);
String params = source.getParams();
// 修改这个 JSON 的值
params = JsonUtil.modifyJsonValue(params, "layerIndex", updateLevelDto.getLayerIndex());
source.setParams(params);
sourceService.updateById(source);
}
return ApiResponse.success(null);
}
@Operation(summary = "删除资源数据")
@PostMapping("/delete")
public ApiResponse delete(@RequestBody DeleteSourceDto deleteSourceDto) {

View File

@ -0,0 +1,30 @@
package com.yj.earth.business.domain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Icon {
@Schema(description = "主键")
private String id;
@Schema(description = "图标类型ID")
private String iconTypeId;
@Schema(description = "图标名称")
private String iconName;
@Schema(description = "图标类型")
private String iconType;
@Schema(description = "图标数据")
private String data;
@Schema(description = "图标视图")
private String view;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}

View File

@ -0,0 +1,22 @@
package com.yj.earth.business.domain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class IconType {
@Schema(description = "主键")
private String id;
@Schema(description = "图标类型名称")
private String name;
@Schema(description = "父级节点ID")
private String parentId;
@Schema(description = "树形索引")
private Integer treeIndex;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}

View File

@ -13,15 +13,15 @@ import java.time.LocalDateTime;
public class Military {
@Schema(description = "主键")
private String id;
@Schema(description = "模型类型ID")
private String modelTypeId;
@Schema(description = "模型名称")
private String modelName;
@Schema(description = "模型类型")
private String modelType;
@Schema(description = "模型数据")
@Schema(description = "军标类型ID")
private String militaryTypeId;
@Schema(description = "军标名称")
private String militaryName;
@Schema(description = "军标类型")
private String militaryType;
@Schema(description = "军标数据")
private String data;
@Schema(description = "模型视图")
@Schema(description = "军标视图")
private String view;
@Schema(description = "创建时间")
private LocalDateTime createdAt;

View File

@ -9,10 +9,12 @@ import java.time.LocalDateTime;
public class MilitaryType {
@Schema(description = "主键")
private String id;
@Schema(description = "模型类型名称")
@Schema(description = "军标类型名称")
private String name;
@Schema(description = "父级节点ID")
private String parentId;
@Schema(description = "树形索引")
private Integer treeIndex;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")

View File

@ -13,6 +13,8 @@ public class ModelType {
private String name;
@Schema(description = "父级节点ID")
private String parentId;
@Schema(description = "树状索引")
private Integer treeIndex;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")