提交 bb783c3d authored 作者: zhanglibo's avatar zhanglibo

国美

上级 c62a007e
...@@ -15,7 +15,7 @@ var Goods = goodsGome{} ...@@ -15,7 +15,7 @@ var Goods = goodsGome{}
type GetSkuRes struct { type GetSkuRes struct {
*CommonRes *CommonRes
Data struct { Data []struct {
Cat1Id string `json:"cat1Id"` Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"` Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"` Cat2Id string `json:"cat2Id"`
...@@ -26,11 +26,11 @@ type GetSkuRes struct { ...@@ -26,11 +26,11 @@ type GetSkuRes struct {
SkuShortName string `json:"skuShortName"` SkuShortName string `json:"skuShortName"`
BarCode string `json:"barCode"` BarCode string `json:"barCode"`
MchSkuId string `json:"mchSkuId"` MchSkuId string `json:"mchSkuId"`
SkuWeight interface{} `json:"skuWeight"` SkuWeight int64 `json:"skuWeight"`
ItemNo string `json:"itemNo"` ItemNo string `json:"itemNo"`
OriginalPrice string `json:"originalPrice"` OriginalPrice string `json:"originalPrice"`
CostPrice string `json:"costPrice"` CostPrice string `json:"costPrice"`
SellPoint interface{} `json:"sellPoint"` SellPoint string `json:"sellPoint"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"` AfterSaleAllowDays int `json:"afterSaleAllowDays"`
Valid int `json:"valid"` Valid int `json:"valid"`
SkuImgs []struct { SkuImgs []struct {
...@@ -59,7 +59,12 @@ type SkuListRes struct { ...@@ -59,7 +59,12 @@ type SkuListRes struct {
*CommonRes *CommonRes
Data struct { Data struct {
*CommonPageRes *CommonPageRes
Data []struct { Result []struct {
Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"`
Cat2Name string `json:"cat2Name"`
Cat3Id string `json:"cat3Id"`
Cat3Name string `json:"cat3Name"` Cat3Name string `json:"cat3Name"`
SkuName string `json:"skuName"` SkuName string `json:"skuName"`
SkuShortName string `json:"skuShortName"` SkuShortName string `json:"skuShortName"`
...@@ -71,6 +76,7 @@ type SkuListRes struct { ...@@ -71,6 +76,7 @@ type SkuListRes struct {
CostPrice string `json:"costPrice"` CostPrice string `json:"costPrice"`
SellPoint string `json:"sellPoint"` SellPoint string `json:"sellPoint"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"` AfterSaleAllowDays int `json:"afterSaleAllowDays"`
Valid int `json:"valid"`
SkuImgs []struct { SkuImgs []struct {
Type int `json:"type"` Type int `json:"type"`
Url string `json:"url"` Url string `json:"url"`
...@@ -83,12 +89,72 @@ type SkuListRes struct { ...@@ -83,12 +89,72 @@ type SkuListRes struct {
Aname string `json:"aname"` Aname string `json:"aname"`
Avalue string `json:"avalue"` Avalue string `json:"avalue"`
} `json:"attrs"` } `json:"attrs"`
} `json:"data"` } `json:"result"`
} `json:"data"` } `json:"data"`
} }
type GetGoodsRes struct { type GetGoodsRes struct {
*CommonRes *CommonRes
Data struct {
SpuName string `json:"spuName"`
MchSpuId string `json:"mchSpuId"`
Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"`
Cat2Name string `json:"cat2Name"`
Cat3Id string `json:"cat3Id"`
Cat3Name string `json:"cat3Name"`
BrandCode string `json:"brandCode"`
BrandName string `json:"brandName"`
Unit string `json:"unit"`
SpuModel string `json:"spuModel"`
ImportFlag int `json:"importFlag"`
Place string `json:"place"`
Keyword string `json:"keyword"`
Adword string `json:"adword"`
PackingList string `json:"packingList"`
AfterService string `json:"afterService"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"`
CreateTime string `json:"createTime"`
CoverImg string `json:"coverImg"`
MainImgs []string `json:"mainImgs"`
DetailsImgs []string `json:"detailsImgs"`
Skus []struct {
Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"`
Cat2Name string `json:"cat2Name"`
Cat3Id string `json:"cat3Id"`
Cat3Name string `json:"cat3Name"`
SkuName string `json:"skuName"`
SkuShortName string `json:"skuShortName"`
BarCode string `json:"barCode"`
MchSkuId string `json:"mchSkuId"`
SkuWeight int64 `json:"skuWeight"`
ItemNo string `json:"itemNo"`
OriginalPrice string `json:"originalPrice"`
CostPrice string `json:"costPrice"`
SellPoint string `json:"sellPoint"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"`
Valid int `json:"valid"`
SkuImgs []struct {
Type int `json:"type"`
Url string `json:"url"`
} `json:"skuImgs"`
Props []struct {
Pname string `json:"pname"`
Pvalue string `json:"pvalue"`
} `json:"props"`
Attrs []struct {
Aname string `json:"aname"`
Avalue string `json:"avalue"`
} `json:"attrs"`
} `json:"skus"`
Props []struct {
Pname string `json:"pname"`
Pvalue string `json:"pvalue"`
} `json:"props"`
} `json:"data"`
} }
type GoodsListReq struct { type GoodsListReq struct {
...@@ -100,7 +166,69 @@ type GoodsListReq struct { ...@@ -100,7 +166,69 @@ type GoodsListReq struct {
type GoodsListRes struct { type GoodsListRes struct {
*CommonRes *CommonRes
//todo Data struct {
*CommonPageRes
Result []struct {
SpuName string `json:"spuName"`
MchSpuId string `json:"mchSpuId"`
Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"`
Cat2Name string `json:"cat2Name"`
Cat3Id string `json:"cat3Id"`
Cat3Name string `json:"cat3Name"`
BrandCode string `json:"brandCode"`
BrandName string `json:"brandName"`
Unit string `json:"unit"`
SpuModel string `json:"spuModel"`
ImportFlag int `json:"importFlag"`
Place string `json:"place"`
Keyword string `json:"keyword"`
Adword string `json:"adword"`
PackingList string `json:"packingList"`
AfterService string `json:"afterService"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"`
CreateTime string `json:"createTime"`
CoverImg string `json:"coverImg"`
MainImgs []string `json:"mainImgs"`
DetailsImgs []string `json:"detailsImgs"`
Skus []struct {
Cat1Id string `json:"cat1Id"`
Cat1Name string `json:"cat1Name"`
Cat2Id string `json:"cat2Id"`
Cat2Name string `json:"cat2Name"`
Cat3Id string `json:"cat3Id"`
Cat3Name string `json:"cat3Name"`
SkuName string `json:"skuName"`
SkuShortName string `json:"skuShortName"`
BarCode string `json:"barCode"`
MchSkuId string `json:"mchSkuId"`
SkuWeight int64 `json:"skuWeight"`
ItemNo string `json:"itemNo"`
OriginalPrice string `json:"originalPrice"`
CostPrice string `json:"costPrice"`
SellPoint string `json:"sellPoint"`
AfterSaleAllowDays int `json:"afterSaleAllowDays"`
Valid int `json:"valid"`
SkuImgs []struct {
Type int `json:"type"`
Url string `json:"url"`
} `json:"skuImgs"`
Props []struct {
Pname string `json:"pname"`
Pvalue string `json:"pvalue"`
} `json:"props"`
Attrs []struct {
Aname string `json:"aname"`
Avalue string `json:"avalue"`
} `json:"attrs"`
} `json:"skus"`
Props []struct {
Pname string `json:"pname"`
Pvalue string `json:"pvalue"`
} `json:"props"`
} `json:"result"`
} `json:"data"`
} }
type GoodsPriceRes struct { type GoodsPriceRes struct {
...@@ -111,6 +239,7 @@ type GoodsPriceRes struct { ...@@ -111,6 +239,7 @@ type GoodsPriceRes struct {
} `json:"data"` } `json:"data"`
} }
//GetSku 单个 SKU 查询
func (goodsGome) GetSku(ctx context.Context, sku interface{}) (res *GetSkuRes, err error) { func (goodsGome) GetSku(ctx context.Context, sku interface{}) (res *GetSkuRes, err error) {
method := "alamein.product.read.querySingleSku" method := "alamein.product.read.querySingleSku"
...@@ -125,6 +254,7 @@ func (goodsGome) GetSku(ctx context.Context, sku interface{}) (res *GetSkuRes, e ...@@ -125,6 +254,7 @@ func (goodsGome) GetSku(ctx context.Context, sku interface{}) (res *GetSkuRes, e
return return
} }
//SkuList 分页 SKU 查询
func (goodsGome) SkuList(ctx context.Context, req *SkuListReq) (res *SkuListRes, err error) { func (goodsGome) SkuList(ctx context.Context, req *SkuListReq) (res *SkuListRes, err error) {
method := "alamein.product.read.pageQuerySku" method := "alamein.product.read.pageQuerySku"
...@@ -136,7 +266,7 @@ func (goodsGome) SkuList(ctx context.Context, req *SkuListReq) (res *SkuListRes, ...@@ -136,7 +266,7 @@ func (goodsGome) SkuList(ctx context.Context, req *SkuListReq) (res *SkuListRes,
return return
} }
// GetGoods todo // GetGoods 单个 SPU 查询
func (goodsGome) GetGoods(ctx context.Context, GoodsID interface{}) (res *GetGoodsRes, err error) { func (goodsGome) GetGoods(ctx context.Context, GoodsID interface{}) (res *GetGoodsRes, err error) {
method := "alamein.product.read.querySingleSpu" method := "alamein.product.read.querySingleSpu"
...@@ -151,7 +281,7 @@ func (goodsGome) GetGoods(ctx context.Context, GoodsID interface{}) (res *GetGoo ...@@ -151,7 +281,7 @@ func (goodsGome) GetGoods(ctx context.Context, GoodsID interface{}) (res *GetGoo
return return
} }
//GoodsList todo //GoodsList 分页 SPU 查询
func (goodsGome) GoodsList(ctx context.Context, req *GoodsListReq) (res *GoodsListRes, err error) { func (goodsGome) GoodsList(ctx context.Context, req *GoodsListReq) (res *GoodsListRes, err error) {
method := "alamein.product.read.pageQuerySpu" method := "alamein.product.read.pageQuerySpu"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论