fix: 文件夹改用 snowflake id

This commit is contained in:
xiaozzzi 2024-03-14 15:51:33 +08:00
parent 58b62c4ff1
commit 3873322b83
2 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import com.blossom.common.base.exception.XzException400;
import com.blossom.common.base.exception.XzException404; import com.blossom.common.base.exception.XzException404;
import com.blossom.common.base.exception.XzException500; import com.blossom.common.base.exception.XzException500;
import com.blossom.common.base.util.DateUtils; import com.blossom.common.base.util.DateUtils;
import com.blossom.common.base.util.PrimaryKeyUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -178,6 +179,7 @@ public class FolderService extends ServiceImpl<FolderMapper, FolderEntity> {
folder.setStorePath(parentFolder.getStorePath()); folder.setStorePath(parentFolder.getStorePath());
} }
} }
folder.setId(PrimaryKeyUtil.nextId());
baseMapper.insert(folder); baseMapper.insert(folder);
return folder; return folder;
} }

View File

@ -27,7 +27,6 @@ public class FolderEntity extends AbstractPOJO implements Serializable {
/** /**
* id * id
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
* 父id * 父id