diff --git a/backend/src/main/java/ai/basic/x1/usecase/DataInfoUseCase.java b/backend/src/main/java/ai/basic/x1/usecase/DataInfoUseCase.java index 75d24af1..6e197855 100644 --- a/backend/src/main/java/ai/basic/x1/usecase/DataInfoUseCase.java +++ b/backend/src/main/java/ai/basic/x1/usecase/DataInfoUseCase.java @@ -30,13 +30,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.dao.DuplicateKeyException; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -45,7 +43,6 @@ import java.util.stream.Collectors; import static ai.basic.x1.entity.enums.DatasetTypeEnum.IMAGE; -import static ai.basic.x1.entity.enums.DatasetTypeEnum.TEXT; import static ai.basic.x1.usecase.exception.UsecaseCode.DATASET_NOT_FOUND; import static ai.basic.x1.usecase.exception.UsecaseCode.DEFAULT_DATASET_NOT_FOUND; import static ai.basic.x1.util.Constants.*; diff --git a/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java b/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java index cc4d7ea9..d27c3b35 100644 --- a/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java +++ b/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java @@ -276,10 +276,8 @@ private void parseImageUploadFile(DataInfoUploadBO dataInfoUploadBO) { var fileNodeBO = DataInfoBO.FileNodeBO.builder().name(fileBO.getName()) .fileId(CollectionUtil.getFirst(fileBOS).getId()).type(Constants.FILE).build(); var dataName = getFilename(file); - var dataInfoBO = dataInfoBOBuilder.name(dataName).orderName(NaturalSortUtil.convert(dataName)) - .content(Collections.singletonList(fileNodeBO)).splitType(SplitTypeEnum.NOT_SPLIT).build(); var content = DataInfoBO.FileNodeBO.builder().name(Constants.IMAGE_0).type(Constants.DIRECTORY).files(Collections.singletonList(fileNodeBO)).build(); - var dataInfoBO = dataInfoBOBuilder.name(getFilename(file)).orderName(NaturalSortUtil.convert(getFilename(file))) + var dataInfoBO = dataInfoBOBuilder.name(dataName).orderName(NaturalSortUtil.convert(getFilename(file))) .content(Collections.singletonList(content)).splitType(SplitTypeEnum.NOT_SPLIT).build(); var errorBuilder = new StringBuilder(); try {