🎨 新增批量上传文章功能

This commit is contained in:
2025-09-12 23:54:54 +08:00
parent 57289a24e7
commit f9b37fb1aa
5 changed files with 94 additions and 5 deletions

View File

@@ -101,6 +101,9 @@ func (e *FileUploadAndDownloadService) UploadFile(header *multipart.FileHeader,
if classId == 2 {
header.Filename = utils.GenerateRandomString(12) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + "." + s[len(s)-1]
}
if classId == 3 {
header.Filename = s[0] + "_" + utils.GenerateRandomString(12) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + "." + s[len(s)-1]
}
filePath, key, uploadErr := oss.UploadFile(header)
if uploadErr != nil {
return file, uploadErr