249 lines
11 KiB
Go
249 lines
11 KiB
Go
package dto
|
|
|
|
import (
|
|
consts "assets/consts/public"
|
|
|
|
"go.mongodb.org/mongo-driver/v2/bson"
|
|
)
|
|
|
|
// AssetRequest 通用资产请求结构体
|
|
type AssetRequest struct {
|
|
ID *bson.ObjectID `json:"id" dc:"资产ID"`
|
|
Name string `json:"name" dc:"资产名称"`
|
|
CategoryID *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
|
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
|
Images interface{} `json:"images" dc:"图片列表"`
|
|
Description string `json:"description" dc:"描述"`
|
|
BasePrice float64 `json:"basePrice" dc:"基础价格"`
|
|
SalePrice float64 `json:"salePrice" dc:"销售价格"`
|
|
BrandID string `json:"brandId" dc:"品牌ID"`
|
|
Status string `json:"status" dc:"状态"`
|
|
}
|
|
|
|
// AssetResponse 通用资产响应结构体
|
|
type AssetResponse struct {
|
|
ID *bson.ObjectID `json:"id" dc:"资产ID"`
|
|
Name string `json:"name" dc:"资产名称"`
|
|
CategoryID *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
|
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
|
Images interface{} `json:"images" dc:"图片列表"`
|
|
Description string `json:"description" dc:"描述"`
|
|
BasePrice float64 `json:"basePrice" dc:"基础价格"`
|
|
SalePrice float64 `json:"salePrice" dc:"销售价格"`
|
|
Platform string `json:"platform" dc:"平台"`
|
|
}
|
|
|
|
// APIResponse 通用API响应结构体
|
|
type APIResponse struct {
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
ErrorCode int64 `json:"error_code,omitempty" dc:"错误码"`
|
|
ErrorMsg string `json:"error_msg,omitempty" dc:"错误信息"`
|
|
Data interface{} `json:"data,omitempty" dc:"响应数据"`
|
|
}
|
|
|
|
// PlatformMapping 平台映射结构体
|
|
type PlatformMapping struct {
|
|
AssetID string `json:"asset_id" dc:"资产ID"`
|
|
PlatformID string `json:"platform_id" dc:"平台ID"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
PlatformType string `json:"platform_type" dc:"平台类型"`
|
|
}
|
|
|
|
// KuaishouAssetRequest 快手资产请求结构体
|
|
type KuaishouAssetRequest struct {
|
|
Title string `json:"title" dc:"商品标题"`
|
|
CategoryID int64 `json:"category_id" dc:"分类ID"`
|
|
MainImage string `json:"main_image" dc:"主图"`
|
|
Images interface{} `json:"images" dc:"图片列表"`
|
|
Description string `json:"description" dc:"描述"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
}
|
|
|
|
// KuaishouAssetResponse 快手资产响应结构体
|
|
type KuaishouAssetResponse struct {
|
|
ItemID string `json:"item_id" dc:"商品ID"`
|
|
Title string `json:"title" dc:"商品标题"`
|
|
CategoryID int64 `json:"category_id" dc:"分类ID"`
|
|
MainImage string `json:"main_image" dc:"主图"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// KuaishouSkuRequest 快手SKU请求结构体
|
|
type KuaishouSkuRequest struct {
|
|
SkuName string `json:"sku_name" dc:"SKU名称"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
|
Specs interface{} `json:"specs" dc:"规格参数"`
|
|
Status int `json:"status" dc:"状态"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// KuaishouStockRequest 快手库存请求结构体
|
|
type KuaishouStockRequest struct {
|
|
SkuID string `json:"sku_id" dc:"SKU ID"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
|
LockStockNum int64 `json:"lock_stock_num" dc:"锁定库存"`
|
|
InTransitNum int64 `json:"in_transit_num" dc:"在途数量"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// DouyinAssetRequest 抖音资产请求结构体
|
|
type DouyinAssetRequest struct {
|
|
Goods struct {
|
|
ProductName string `json:"product_name" dc:"商品名称"`
|
|
SecCategoryID int64 `json:"sec_category_id" dc:"二级分类ID"`
|
|
MainImg string `json:"main_img" dc:"主图"`
|
|
Imgs interface{} `json:"imgs" dc:"图片列表"`
|
|
DetailHTML string `json:"detail_html" dc:"详情HTML"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
DiscountPrice float64 `json:"discount_price" dc:"折扣价"`
|
|
MobileDetail string `json:"mobile_detail" dc:"移动端详情"`
|
|
PayType int `json:"pay_type" dc:"支付类型"`
|
|
DeliveryInfo interface{} `json:"delivery_info" dc:"配送信息"`
|
|
} `json:"goods" dc:"商品信息"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
}
|
|
|
|
// DouyinAssetResponse 抖音资产响应结构体
|
|
type DouyinAssetResponse struct {
|
|
GoodsID string `json:"goods_id" dc:"商品ID"`
|
|
ProductName string `json:"product_name" dc:"商品名称"`
|
|
SecCategoryID int64 `json:"sec_category_id" dc:"二级分类ID"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
DiscountPrice float64 `json:"discount_price" dc:"折扣价"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// DouyinSkuRequest 抖音SKU请求结构体
|
|
type DouyinSkuRequest struct {
|
|
SkuName string `json:"sku_name" dc:"SKU名称"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
|
Specs interface{} `json:"specs" dc:"规格参数"`
|
|
Status int `json:"status" dc:"状态"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// DouyinStockRequest 抖音库存请求结构体
|
|
type DouyinStockRequest struct {
|
|
SkuID string `json:"sku_id" dc:"SKU ID"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
|
LockStockNum int64 `json:"lock_stock_num" dc:"锁定库存"`
|
|
InTransitNum int64 `json:"in_transit_num" dc:"在途数量"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// JDAssetRequest 京东资产请求结构体
|
|
type JDAssetRequest struct {
|
|
Product struct {
|
|
Name string `json:"name" dc:"商品名称"`
|
|
CategoryID string `json:"category_id" dc:"分类ID"`
|
|
BrandID string `json:"brand_id" dc:"品牌ID"`
|
|
MainImage string `json:"main_image" dc:"主图"`
|
|
Images interface{} `json:"images" dc:"图片列表"`
|
|
Description string `json:"description" dc:"描述"`
|
|
Specifications interface{} `json:"specifications" dc:"规格参数"`
|
|
Logistics interface{} `json:"logistics" dc:"物流信息"`
|
|
AfterSales interface{} `json:"after_sales" dc:"售后信息"`
|
|
SupplyPrice float64 `json:"supply_price" dc:"供货价"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
Status string `json:"status" dc:"状态"`
|
|
} `json:"product" dc:"商品信息"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
}
|
|
|
|
// JDAssetResponse 京东资产响应结构体
|
|
type JDAssetResponse struct {
|
|
SkuID string `json:"sku_id" dc:"SKU ID"`
|
|
WareID string `json:"ware_id" dc:"商品ID"`
|
|
ProductName string `json:"product_name" dc:"商品名称"`
|
|
CategoryID string `json:"category_id" dc:"分类ID"`
|
|
SupplyPrice float64 `json:"supply_price" dc:"供货价"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
ExternalID string `json:"external_id" dc:"外部ID"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// JDSkuRequest 京东SKU请求结构体
|
|
type JDSkuRequest struct {
|
|
SkuName string `json:"sku_name" dc:"SKU名称"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
|
Specification string `json:"specification" dc:"规格"`
|
|
Status string `json:"status" dc:"状态"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// JDStockRequest 京东库存请求结构体
|
|
type JDStockRequest struct {
|
|
SkuID string `json:"sku_id" dc:"SKU ID"`
|
|
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
|
Quantity int64 `json:"quantity" dc:"库存数量"`
|
|
LockQuantity int64 `json:"lock_quantity" dc:"锁定库存"`
|
|
InTransit int64 `json:"in_transit" dc:"在途数量"`
|
|
Location string `json:"location" dc:"仓库位置"`
|
|
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
|
}
|
|
|
|
// PinduoduoAssetRequest 拼多多资产请求结构体
|
|
type PinduoduoAssetRequest struct {
|
|
GoodsID string `json:"goods_id" dc:"商品ID"`
|
|
GoodsName string `json:"goods_name" dc:"商品名称"`
|
|
GoodsDesc string `json:"goods_desc" dc:"商品描述"`
|
|
CatID string `json:"cat_id" dc:"分类ID"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
GoodsImageURL string `json:"goods_image_url" dc:"商品主图"`
|
|
GoodsGalleryURLs interface{} `json:"goods_gallery_urls" dc:"商品轮播图"`
|
|
}
|
|
|
|
// PinduoduoAssetResponse 拼多多资产响应结构体
|
|
type PinduoduoAssetResponse struct {
|
|
GoodsID string `json:"goods_id" dc:"商品ID"`
|
|
GoodsName string `json:"goods_name" dc:"商品名称"`
|
|
GoodsDesc string `json:"goods_desc" dc:"商品描述"`
|
|
CatID string `json:"cat_id" dc:"分类ID"`
|
|
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
|
GoodsImageURL string `json:"goods_image_url" dc:"商品主图"`
|
|
}
|
|
|
|
// SkuRequest 通用SKU请求结构体
|
|
type SkuRequest struct {
|
|
ID string `json:"id" dc:"SKU ID"`
|
|
SkuCode string `json:"skuCode" dc:"SKU编码"`
|
|
Price float64 `json:"price" dc:"价格"`
|
|
Stock int64 `json:"stock" dc:"库存"`
|
|
Specification interface{} `json:"specification" dc:"规格"`
|
|
}
|
|
|
|
// StockRequest 通用库存请求结构体
|
|
type StockRequest struct {
|
|
ID string `json:"id" dc:"库存ID"`
|
|
AssetSkuID string `json:"assetSkuId" dc:"资产SKU ID"`
|
|
AvailableQty int64 `json:"availableQty" dc:"可用数量"`
|
|
LockedQty int64 `json:"lockedQty" dc:"锁定数量"`
|
|
InTransitQty int64 `json:"inTransitQty" dc:"在途数量"`
|
|
Location string `json:"location" dc:"位置"`
|
|
}
|
|
|
|
// SyncResult 同步结果结构体
|
|
type SyncResult struct {
|
|
Success bool `json:"success" dc:"是否成功"`
|
|
Message string `json:"message" dc:"消息"`
|
|
Data interface{} `json:"data" dc:"数据"`
|
|
Platform consts.SyncPlatform `json:"platform" dc:"平台"`
|
|
ExternalID string `json:"external_id,omitempty" dc:"外部ID"`
|
|
}
|