mirror of
https://gitee.com/blossom-editor/blossom.git
synced 2025-12-06 08:48:29 +08:00
fix: 新增文件夹时获取对应类型的最大排序
This commit is contained in:
parent
64a8d730a6
commit
1d9b3f66ca
@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
@ -98,7 +99,10 @@ public class FolderController {
|
||||
folder.setUserId(AuthContext.getUserId());
|
||||
// 如果新增到底部, 获取最大的排序
|
||||
if (BooleanUtil.isTrue(req.getAddToLast())) {
|
||||
folder.setSort(docService.selectMaxSortByPid(req.getPid(), AuthContext.getUserId(), FolderTypeEnum.PICTURE) + 1);
|
||||
folder.setSort(docService.selectMaxSortByPid(
|
||||
req.getPid(),
|
||||
AuthContext.getUserId(),
|
||||
Objects.requireNonNull(FolderTypeEnum.getType(req.getType()))) + 1);
|
||||
}
|
||||
return R.ok(baseService.insert(folder));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user