file_system/internal/api/validators/download_file_validator.go
2025-12-18 09:34:49 +08:00

23 lines
522 B
Go

package validators
import (
"file-system/internal/api/requests"
"file-system/internal/common"
)
type DownloadFileValidator struct{}
func NewDownloadFileValidator() *DownloadFileValidator {
return &DownloadFileValidator{}
}
func (v *DownloadFileValidator) Validate(req *requests.DownloadFileRequest) error {
if req.BucketName == "" {
return common.NewBusinessException("Bucket name cannot be empty")
}
if req.ObjectKey == "" {
return common.NewBusinessException("Object key cannot be empty")
}
return nil
}