43 lines
715 B
Go
43 lines
715 B
Go
package usecase
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"cmroubao/backend-api/internal/domain"
|
|
)
|
|
|
|
type FreightSourceImage struct {
|
|
Content io.ReadCloser
|
|
MediaType string
|
|
}
|
|
|
|
type FreightImageSource interface {
|
|
FetchProductImage(
|
|
context.Context,
|
|
string,
|
|
) (FreightSourceImage, error)
|
|
}
|
|
|
|
type FreightImageRepository interface {
|
|
ListFreightImageJobs(
|
|
context.Context,
|
|
string,
|
|
string,
|
|
int,
|
|
) ([]domain.FreightItemImageJob, error)
|
|
SaveFreightItemImage(
|
|
context.Context,
|
|
domain.FreightItemImage,
|
|
) (*string, error)
|
|
GetReadyFreightItemImage(
|
|
context.Context,
|
|
string,
|
|
string,
|
|
) (domain.FreightItemImage, error)
|
|
}
|
|
|
|
type FreightImageCache interface {
|
|
CacheRun(context.Context, string, string) error
|
|
}
|