- weimobapi.QueryGoodsDetail added
This commit is contained in:
@@ -84,6 +84,17 @@ func (a *API) QueryGoodsList(pageNum, pageSize int, orderBy []map[string]interfa
|
|||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *API) QueryGoodsDetail(goodsId int64) (retVal map[string]interface{}, err error) {
|
||||||
|
apiParams := map[string]interface{}{
|
||||||
|
"goodsId": goodsId,
|
||||||
|
}
|
||||||
|
result, err := a.AccessAPI("goods/queryGoodsDetail", apiParams)
|
||||||
|
if err == nil {
|
||||||
|
return result.(map[string]interface{})["goods"].(map[string]interface{}), nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
func (a *API) QueryCategoryTree() (retVal []*Category, err error) {
|
func (a *API) QueryCategoryTree() (retVal []*Category, err error) {
|
||||||
result, err := a.AccessAPI("category/queryCategoryTree", nil)
|
result, err := a.AccessAPI("category/queryCategoryTree", nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ func TestQueryGoodsList(t *testing.T) {
|
|||||||
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestQueryGoodsDetail(t *testing.T) {
|
||||||
|
result, err := api.QueryGoodsDetail(21128350148)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||||
|
}
|
||||||
|
|
||||||
func TestQueryCategoryTree(t *testing.T) {
|
func TestQueryCategoryTree(t *testing.T) {
|
||||||
result, err := api.QueryCategoryTree()
|
result, err := api.QueryCategoryTree()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -29,15 +29,17 @@ const (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// sku
|
// sku
|
||||||
KeySkuID = "skuId"
|
KeySkuID = "skuId"
|
||||||
KeyOuterSkuCode = "outerSkuCode"
|
KeyOuterSkuCode = "outerSkuCode"
|
||||||
KeyImageURL = "imageUrl"
|
KeyImageURL = "imageUrl"
|
||||||
KeySalePrice = "salePrice"
|
KeySalePrice = "salePrice"
|
||||||
KeyOriginalPrice = "originalPrice"
|
KeyOriginalPrice = "originalPrice"
|
||||||
KeyCostPrice = "costPrice"
|
KeyCostPrice = "costPrice"
|
||||||
KeyEditStockNum = "editStockNum"
|
KeyEditStockNum = "editStockNum"
|
||||||
KeyB2cSku = "b2cSku"
|
KeyAvailableStockNum = "availableStockNum"
|
||||||
KeySkuAttrMap = "skuAttrMap"
|
KeySkuList = "skuList"
|
||||||
|
KeyB2cSku = "b2cSku"
|
||||||
|
KeySkuAttrMap = "skuAttrMap"
|
||||||
|
|
||||||
KeyField = "field"
|
KeyField = "field"
|
||||||
KeySort = "sort"
|
KeySort = "sort"
|
||||||
|
|||||||
Reference in New Issue
Block a user