- store and product api for jd and elm added.

This commit is contained in:
gazebo
2018-08-27 17:22:15 +08:00
parent 8357982612
commit cc7be396ea
7 changed files with 706 additions and 9 deletions

View File

@@ -50,7 +50,7 @@ const (
)
type SkuIDPair struct {
SkuId int `json:"skuId"`
SkuId int64 `json:"skuId"`
OutSkuId string `json:"outSkuId"`
}
@@ -114,7 +114,7 @@ func (a *API) QueryPageBrandInfo(pageNo, pageSize, brandId int, brandName string
// 获取京东到家类目信息接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=d287d326124d42c090cff03c16385706
func (a *API) QueryChildCategoriesForOP(pid int) (catList []map[string]interface{}, err error) {
func (a *API) QueryChildCategoriesForOP(pid int64) (catList []map[string]interface{}, err error) {
result, err := a.AccessAPINoPage("api/queryChildCategoriesForOP", utils.Params2Map("fields", []string{
"ID",
"PID",
@@ -131,7 +131,7 @@ func (a *API) QueryChildCategoriesForOP(pid int) (catList []map[string]interface
// 新增商家店内分类信息接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=de26f24a62aa47a49e5ab7579d638cb3
func (a *API) AddShopCategory(pid int, shopCategoryName string, shopCategoryLevel, sort int, userName string) (catId string, err error) {
func (a *API) AddShopCategory(pid int64, shopCategoryName string, shopCategoryLevel, sort int, userName string) (catId string, err error) {
params := map[string]interface{}{
KeyPID: pid,
KeyShopCategoryName: shopCategoryName,
@@ -163,7 +163,7 @@ func (a *API) QueryCategoriesByOrgCode() (catList []map[string]interface{}, err
// 修改商家店内分类信息接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=1de278c670b64da492f676ab78d62f73
func (a *API) UpdateShopCategory(id int, shopCategoryName string) error {
func (a *API) UpdateShopCategory(id int64, shopCategoryName string) error {
params := map[string]interface{}{
KeyID: id,
KeyShopCategoryName: shopCategoryName,
@@ -174,7 +174,7 @@ func (a *API) UpdateShopCategory(id int, shopCategoryName string) error {
// 修改商家店内分类顺序接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=2a8267602e814be9828f0c7ce307b872
func (a *API) ChangeShopCategoryOrder(pid int, childIds []int) error {
func (a *API) ChangeShopCategoryOrder(pid int64, childIds []int) error {
params := map[string]interface{}{
KeyPID: pid,
KeyChildIds: childIds,
@@ -185,14 +185,14 @@ func (a *API) ChangeShopCategoryOrder(pid int, childIds []int) error {
// 删除商家店内分类接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=c17b96e9fe254b2a8574f6d1bc0c1667
func (a *API) DelShopCategory(id int) error {
func (a *API) DelShopCategory(id int64) error {
_, err := a.AccessAPINoPage("pms/delShopCategory", utils.Params2Map(KeyID, id), nil, nil, nil)
return err
}
// 新增商品信息接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=dfe6a5ca73fa421da1c9f969b848113e
func (a *API) AddSku(outSkuId string, cagtegoryId int, shopCategories []int, brandId int, skuName string, skuPrice int, weight float32, images []string, fixedStatus int, isSale bool, addParams map[string]interface{}) (skuId string, err error) {
func (a *API) AddSku(outSkuId string, cagtegoryId int64, shopCategories []int, brandId int, skuName string, skuPrice int, weight float32, images []string, fixedStatus int, isSale bool, addParams map[string]interface{}) (skuId string, err error) {
fixedParams := map[string]interface{}{
KeyOutSkuId: outSkuId,
KeyCategoryId: cagtegoryId,
@@ -266,7 +266,7 @@ func (a *API) QuerySkuInfos(skuName string, skuId, pageNo, pageSize int, isFilte
// 查询商品图片处理结果接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=17506653e03542f9a49023711780c30d
func (a *API) QueryListBySkuIds(skuIds []int, addParams map[string]interface{}) (retVal []map[string]interface{}, err error) {
func (a *API) QueryListBySkuIds(skuIds []int64, addParams map[string]interface{}) (retVal []map[string]interface{}, err error) {
result, err := a.AccessAPINoPage("order/queryListBySkuIds", utils.MergeMaps(addParams, utils.Params2Map("skuIds", skuIds)), nil, nil, nil)
if err == nil {
return utils.Slice2MapSlice(result.([]interface{})), nil