feat(media-supply): integrate object storage for media supply service and enhance image upload handling
Backend CI / Backend (push) Successful in 16m49s
Backend CI / Backend (push) Successful in 16m49s
This commit is contained in:
@@ -17,15 +17,17 @@ import (
|
||||
|
||||
"github.com/geo-platform/tenant-api/internal/shared/auth"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/config"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/objectstorage"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/response"
|
||||
)
|
||||
|
||||
type MediaSupplyService struct {
|
||||
pool *pgxpool.Pool
|
||||
redis *goredis.Client
|
||||
logger *zap.Logger
|
||||
cfg config.Provider
|
||||
client *MeijiequanClient
|
||||
pool *pgxpool.Pool
|
||||
redis *goredis.Client
|
||||
logger *zap.Logger
|
||||
cfg config.Provider
|
||||
client *MeijiequanClient
|
||||
objectStorage objectstorage.Client
|
||||
}
|
||||
|
||||
func NewMediaSupplyService(pool *pgxpool.Pool, redis *goredis.Client, logger *zap.Logger, cfg config.Provider) *MediaSupplyService {
|
||||
@@ -43,6 +45,13 @@ func NewMediaSupplyService(pool *pgxpool.Pool, redis *goredis.Client, logger *za
|
||||
}
|
||||
}
|
||||
|
||||
func (s *MediaSupplyService) WithObjectStorage(storage objectstorage.Client) *MediaSupplyService {
|
||||
if s != nil {
|
||||
s.objectStorage = storage
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *MediaSupplyService) mediaSupplyConfig() config.MediaSupplyConfig {
|
||||
if s != nil && s.cfg != nil && s.cfg.Current() != nil {
|
||||
cfg := s.cfg.Current().MediaSupply
|
||||
|
||||
Reference in New Issue
Block a user