Dockerfile
This commit is contained in:
54
service/sync/platform_interface.go
Normal file
54
service/sync/platform_interface.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
consts "assets/consts/public"
|
||||
"context"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// AssetPlatformService 资产平台服务接口
|
||||
type AssetPlatformService interface {
|
||||
// SyncAsset 同步资产到平台
|
||||
SyncAsset(ctx context.Context, assetID *bson.ObjectID) error
|
||||
// GetAsset 从平台获取资产
|
||||
GetAsset(ctx context.Context, assetID *bson.ObjectID) (interface{}, error)
|
||||
// UpdateAsset 更新平台资产
|
||||
UpdateAsset(ctx context.Context, assetID *bson.ObjectID, data interface{}) error
|
||||
// DeleteAsset 删除平台资产
|
||||
DeleteAsset(ctx context.Context, assetID *bson.ObjectID) error
|
||||
}
|
||||
|
||||
// AssetSkuPlatformService 资产SKU平台服务接口
|
||||
type AssetSkuPlatformService interface {
|
||||
// SyncAssetSku 同步资产SKU到平台
|
||||
SyncAssetSku(ctx context.Context, assetSkuID *bson.ObjectID) error
|
||||
// GetAssetSku 从平台获取资产SKU
|
||||
GetAssetSku(ctx context.Context, assetSkuID *bson.ObjectID) (interface{}, error)
|
||||
// UpdateAssetSku 更新平台资产SKU
|
||||
UpdateAssetSku(ctx context.Context, assetSkuID *bson.ObjectID, data interface{}) error
|
||||
// DeleteAssetSku 删除平台资产SKU
|
||||
DeleteAssetSku(ctx context.Context, assetSkuID *bson.ObjectID) error
|
||||
}
|
||||
|
||||
// StockPlatformService 库存平台服务接口
|
||||
type StockPlatformService interface {
|
||||
// SyncStock 同步库存到平台
|
||||
SyncStock(ctx context.Context, stockID *bson.ObjectID) error
|
||||
// GetStock 从平台获取库存
|
||||
GetStock(ctx context.Context, stockID *bson.ObjectID) (interface{}, error)
|
||||
// UpdateStock 更新平台库存
|
||||
UpdateStock(ctx context.Context, stockID *bson.ObjectID, data interface{}) error
|
||||
// DeleteStock 删除平台库存
|
||||
DeleteStock(ctx context.Context, stockID *bson.ObjectID) error
|
||||
}
|
||||
|
||||
// PlatformFactory 平台服务工厂
|
||||
type PlatformFactory interface {
|
||||
// CreateAssetService 创建资产平台服务
|
||||
CreateAssetService(platform consts.SyncPlatform) AssetPlatformService
|
||||
// CreateAssetSkuService 创建资产SKU平台服务
|
||||
CreateAssetSkuService(platform consts.SyncPlatform) AssetSkuPlatformService
|
||||
// CreateStockService 创建库存平台服务
|
||||
CreateStockService(platform consts.SyncPlatform) StockPlatformService
|
||||
}
|
||||
Reference in New Issue
Block a user