feat(t240): cache freight item images

This commit is contained in:
QiuSW
2026-07-29 15:12:05 +08:00
parent 5f17fc11aa
commit c7e152aaa1
28 changed files with 1728 additions and 30 deletions
@@ -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
}