This commit is contained in:
2026-07-18 10:52:32 +08:00
parent 2dcafae465
commit b5ef58f434
61 changed files with 1274 additions and 2142 deletions

View File

@@ -48,6 +48,14 @@ func (s *FolderService) Create(req *dto.CreateFolderRequest, ownerID uint64) (*d
return nil, errors.New("同名文件夹已存在")
}
// 检查biz_id唯一性
if req.BizID != "" {
existingBiz, _ := s.folderRepo.FindByBizID(req.BizID, ownerID)
if existingBiz != nil {
return nil, fmt.Errorf("业务编号 %s 已存在", req.BizID)
}
}
folderID := utils.GenID()
folder := &model.Folder{
ID: folderID,
@@ -253,6 +261,7 @@ func (s *FolderService) getUserRoleIDs(userID uint64) []uint64 {
func (s *FolderService) toFileVO(file *model.File) *dto.FileVO {
vo := &dto.FileVO{
ID: dto.StringID(file.ID),
BizID: file.BizID,
Name: file.Name,
Extension: file.Extension,
FolderID: dto.StringID(file.FolderID),