diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Resources.java b/dinky-admin/src/main/java/org/dinky/data/model/Resources.java index 5a00c3032e..ecbc133b4a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Resources.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Resources.java @@ -54,7 +54,7 @@ @AllArgsConstructor public class Resources extends Model { - @TableId(type = IdType.ASSIGN_ID) + @TableId(type = IdType.AUTO) @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the resource") private Integer id; diff --git a/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java index e10c1ec7c4..5f9b5db87f 100644 --- a/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java @@ -86,6 +86,8 @@ public boolean syncRemoteDirectoryStructure() { x.setType(resources.getType()); x.setUserId(resources.getUserId()); } + x.setId(Math.abs(x.getId())); + x.setPid(Math.abs(x.getPid())); }) .collect(Collectors.toList()); // not delete root directory