23 lines
522 B
Go
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
|
|
}
|