feat(storage): 添加阿里云OSS存储支持

- 在StorageConfig中新增AliOSS字段以配置阿里云OSS参数
- 新增AliOSSConfig结构体定义阿里云OSS相关配置项
- 在fs包中实现AliOSSAdapter适配器用于操作阿里云OSS
- 实现GetFileList方法从阿里云OSS获取并缓存文件列表
- 添加定时清理过期缓存的功能
- 更新adapter.go根据存储类型选择对应的适配器实例
This commit is contained in:
2025-12-03 15:50:09 +08:00
parent a678829f59
commit b23794587f
5 changed files with 232 additions and 20 deletions

View File

@@ -10,9 +10,10 @@ type RecordConfig struct {
}
type StorageConfig struct {
Type string `mapstructure:"type"`
Path string `mapstructure:"path"`
S3 S3Config `mapstructure:"s3"`
Type string `mapstructure:"type"`
Path string `mapstructure:"path"`
S3 S3Config `mapstructure:"s3"`
AliOSS AliOSSConfig `mapstructure:"aliOss"`
}
type S3Config struct {
@@ -24,6 +25,14 @@ type S3Config struct {
AkSec string `mapstructure:"akSec"`
}
type AliOSSConfig struct {
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
Prefix string `mapstructure:"prefix"`
AccessKeyId string `mapstructure:"accessKeyId"`
AccessKeySecret string `mapstructure:"accessKeySecret"`
}
type DeviceMapping struct {
DeviceNo string `mapstructure:"deviceNo" json:"deviceNo"`
Name string `mapstructure:"name" json:"name"`