feat(media-supply): integrate object storage for media supply service and enhance image upload handling
Backend CI / Backend (push) Successful in 16m49s

This commit is contained in:
2026-06-03 22:11:22 +08:00
parent d098633a67
commit ae455ea21c
10 changed files with 765 additions and 52 deletions
@@ -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