feat: 添加内容置顶功能,更新相关数据模型和前端视图

This commit is contained in:
2026-01-05 12:54:26 +08:00
parent a5cc9b13d6
commit c231847f81
8 changed files with 278 additions and 176 deletions

View File

@@ -101,7 +101,7 @@ func (s *common) InitUpload(ctx context.Context, userID int64, form *common_dto.
localPath = "./storage"
}
tempDir := filepath.Join(localPath, "temp", uploadID)
if err := os.MkdirAll(tempDir, 0755); err != nil {
if err := os.MkdirAll(tempDir, 0o755); err != nil {
return nil, errorx.ErrInternalError.WithCause(err)
}
@@ -205,7 +205,7 @@ func (s *common) CompleteUpload(ctx context.Context, userID int64, form *common_
}
hash := hex.EncodeToString(hasher.Sum(nil))
dst.Close(); // Ensure flush before potential removal
dst.Close() // Ensure flush before potential removal
os.RemoveAll(tempDir)
// Deduplication Logic (Similar to Upload)