Add file management API with local storage backend
- Implement FileHandler with CRUD operations for files/directories - Add FileService with business logic and SHA-256 hashing - Create LocalStorage backend for filesystem persistence - Add database repository with pagination and name uniqueness constraints - Configure max upload size in storage settings - Include comprehensive tests for all layers
This commit is contained in:
@@ -39,8 +39,9 @@ type PostgresConfig struct {
|
||||
}
|
||||
|
||||
type StorageConfig struct {
|
||||
Driver string `mapstructure:"driver"`
|
||||
Local LocalStorageConfig `mapstructure:"local"`
|
||||
Driver string `mapstructure:"driver"`
|
||||
Local LocalStorageConfig `mapstructure:"local"`
|
||||
MaxUploadSize int64 `mapstructure:"max_upload_size"`
|
||||
}
|
||||
|
||||
type LocalStorageConfig struct {
|
||||
@@ -90,6 +91,10 @@ func (c *Config) Validate() error {
|
||||
errs = append(errs, errors.New("storage.local.path: must not be empty"))
|
||||
}
|
||||
|
||||
if c.Storage.MaxUploadSize < 0 {
|
||||
errs = append(errs, errors.New("storage.max_upload_size: must not be negative"))
|
||||
}
|
||||
|
||||
if c.JWT.Secret == "" {
|
||||
errs = append(errs, errors.New("jwt.secret: must not be empty"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user