2026-04-29 15:54:14 +08:00
|
|
|
|
package service
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"context"
|
|
|
|
|
|
"errors"
|
|
|
|
|
|
|
2026-05-15 14:56:26 +08:00
|
|
|
|
"model-gateway/model/entity"
|
2026-04-29 15:54:14 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// StorageService 结果存储(OSS/MinIO)抽象
|
|
|
|
|
|
type StorageService interface {
|
|
|
|
|
|
UploadByTask(ctx context.Context, t *entity.AsynchTask, data []byte, fileExt string, contentType string) (ossURL string, err error)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Storage 默认存储实现(优先对接你们的 oss 文件服务;必要时也可以切到 MinIO)
|
|
|
|
|
|
var Storage StorageService = &ossStorage{}
|
|
|
|
|
|
|
|
|
|
|
|
var ErrStorageNotConfigured = errors.New("存储未配置")
|