mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
resource tree 返回 parentId
This commit is contained in:
@@ -42,4 +42,7 @@ public class ResourceDto extends CommonDto {
|
||||
@Comment("其他数据")
|
||||
private String metadata;
|
||||
|
||||
private String parent;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.List;
|
||||
@Data
|
||||
public class ResourceTreeDto extends ResourceDto {
|
||||
|
||||
private ResourceDto parent;
|
||||
|
||||
private List<ResourceTreeDto> children;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.lihongjie.coal.entity.ResourceEntity;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.MappingConstants;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.control.DeepClone;
|
||||
|
||||
import java.util.List;
|
||||
@@ -20,12 +21,23 @@ import java.util.List;
|
||||
|
||||
)
|
||||
public interface ResourceMapper {
|
||||
@Mappings({
|
||||
@org.mapstruct.Mapping(target = "parent", source = "parent.id")
|
||||
})
|
||||
ResourceDto toDto(ResourceEntity user);
|
||||
|
||||
|
||||
ResourceEntity toEntity(CreateResourceDto request);
|
||||
|
||||
|
||||
void updateEntity(@MappingTarget ResourceEntity entity, UpdateResourceDto dto);
|
||||
|
||||
|
||||
List<ResourceTreeDto> toTreeDto(List<ResourceEntity> byTypeAndParentIsNull);
|
||||
|
||||
@Mappings({
|
||||
@org.mapstruct.Mapping(target = "parent", source = "parent.id")
|
||||
})
|
||||
ResourceTreeDto toTreeDto(ResourceEntity byTypeAndParentIsNull);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user