Skip to content

Commit

Permalink
Optimize generation of thumbnails
Browse files Browse the repository at this point in the history
Signed-off-by: fanyinbo <[email protected]>
  • Loading branch information
fanyinbo committed Dec 25, 2023
1 parent 67904b4 commit 9063d1e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9063d1e

Please sign in to comment.