Enhance ProductRoutes to include component report handling and related routes
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"context"
|
||||
"tyapi-server/internal/domains/product/entities"
|
||||
)
|
||||
|
||||
// ComponentReportRepository 组件报告仓储接口
|
||||
type ComponentReportRepository interface {
|
||||
// 下载记录相关
|
||||
CreateDownload(ctx context.Context, download *entities.ComponentReportDownload) (*entities.ComponentReportDownload, error)
|
||||
UpdateDownload(ctx context.Context, download *entities.ComponentReportDownload) error
|
||||
GetDownloadByID(ctx context.Context, id string) (*entities.ComponentReportDownload, error)
|
||||
GetUserDownloads(ctx context.Context, userID string, productID *string) ([]*entities.ComponentReportDownload, error)
|
||||
HasUserDownloaded(ctx context.Context, userID string, productCode string) (bool, error)
|
||||
GetUserDownloadedProductCodes(ctx context.Context, userID string) ([]string, error)
|
||||
GetDownloadByPaymentOrderID(ctx context.Context, orderID string) (*entities.ComponentReportDownload, error)
|
||||
|
||||
// 缓存相关
|
||||
GetCacheByProductCode(ctx context.Context, productCode string) (*entities.ComponentReportCache, error)
|
||||
CreateCache(ctx context.Context, cache *entities.ComponentReportCache) error
|
||||
UpdateCache(ctx context.Context, cache *entities.ComponentReportCache) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user