Add S3 configuration and presigned URL logic for file upload and download

This commit is contained in:
2025-10-24 22:32:36 +08:00
parent 289812aac3
commit ec80aa92fa
8 changed files with 225 additions and 11 deletions

View File

@@ -4,4 +4,19 @@ import "github.com/zeromicro/go-zero/rest"
type Config struct {
rest.RestConf
Database DatabaseConfig
S3 S3Config
}
type DatabaseConfig struct {
DSN string
}
type S3Config struct {
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
Endpoint string `json:",optional"` // Optional: for S3-compatible services
PresignedURLExpiration int64 `json:",default=3600"` // Default 1 hour
}