图标库
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user