feat(t240): cache freight item images
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user