提交 f1905300 authored 作者: gukai's avatar gukai

修改阿里分销渠道结构体

上级 5e196968
......@@ -45,7 +45,6 @@ type GoodsListRes struct {
} `json:"result"`
}
type GoodsInfoRes struct {
CommonRes
BizGroupInfos []struct {
......@@ -55,8 +54,8 @@ type GoodsInfoRes struct {
} `json:"bizGroupInfos"`
ProductInfo struct {
ProductID int64 `json:"productID"`
SupplierLoginId string `json:"SupplierLoginId"`
MainVedio string `json:"MainVedio"`
SupplierLoginId string `json:"supplierLoginId"`
MainVedio string `json:"mainVedio"`
CategoryID int `json:"categoryID"`
Subject string `json:"subject"`
Description string `json:"description"`
......@@ -170,13 +169,20 @@ type GoodsFollowRes struct {
ErrorMessage int `json:"errorMessage"`
}
type RelationRes struct {
Success bool `json:"success"`
Data interface{} `json:"data"`
ErrorCode int `json:"errorCode"`
ErrorMessage int `json:"errorMessage"`
}
type OutshopAddRes struct {
Code int `json:"code"`
Message int `json:"message"`
}
type RelationAddReq struct {
type RelationInfoReq struct {
Channel string `json:"channel"` // 下游渠道代码
OutShopCode string `json:"outShopCode"` // 下游店铺code
OfferId string `json:"offerId"` //上游1688商品id
......@@ -258,7 +264,6 @@ func (goodsAli) UnFollow(ctx context.Context, GoodsID string) (res *GoodsFollowR
return
}
func (goodsAli) Category(ctx context.Context, CategoryID interface{}) (res *GoodsCategoryRes, err error) {
method := "com.alibaba.product/alibaba.category.get"
var req = &GoodsCategoryReq{
......@@ -285,8 +290,8 @@ func (goodsAli) OutshopAdd(ctx context.Context, merId string) (res *GoodsFollowR
return
}
//OutshopAdd 添加分销商品关系
func (goodsAli) RelationAdd(ctx context.Context, req *RelationAddReq) (res *OutshopAddRes, err error) {
//RelationAdd 添加分销商品关系
func (goodsAli) RelationAdd(ctx context.Context, req *RelationInfoReq) (res *RelationRes, err error) {
method := "com.alibaba.fenxiao/alibaba.fenxiao.buyer.outproduct.relation.add"
req.AccessToken = server.AccessToken
......@@ -296,3 +301,25 @@ func (goodsAli) RelationAdd(ctx context.Context, req *RelationAddReq) (res *Outs
return
}
//RelationGet 查询分销商品关系
func (goodsAli) RelationGet(ctx context.Context, req *RelationInfoReq) (res *RelationRes, err error) {
method := "com.alibaba.fenxiao/alibaba.fenxiao.buyer.outproduct.relation.get"
req.AccessToken = server.AccessToken
req.Channel = "other"
result, err := server.Post(ctx, method, gconv.Map(req))
_ = gjson.New(result).Scan(&res)
return
}
//RelationDel 删除分销商品关系
func (goodsAli) RelationDel(ctx context.Context, req *RelationInfoReq) (res *RelationRes, err error) {
method := "com.alibaba.fenxiao/alibaba.fenxiao.buyer.outproduct.relation.delete"
req.AccessToken = server.AccessToken
req.Channel = "other"
result, err := server.Post(ctx, method, gconv.Map(req))
_ = gjson.New(result).Scan(&res)
return
}
......@@ -33,6 +33,9 @@ type OrderCargo struct {
SpecId string `json:"specId"`
OfferId int64 `json:"offerId"`
Quantity int `json:"quantity"`
OutShopCode string `json:"outShopCode"`
OutItemCode string `json:"outItemCode"`
Channel string `json:"channel"`
}
type OuterOrderInfo struct {
......@@ -66,9 +69,9 @@ func (s *orderAli) Create(ctx context.Context, req *OrderCommonReq) (res *OrderC
"addressParam": gjson.New(req.AddressParam).MustToJsonString(),
"cargoParamList": gjson.New(req.CargoParam).MustToJsonString(),
"outerOrderInfo": gjson.New(req.OuterOrderInfo).MustToJsonString(),
"flow":"fenxiao",
"isvBizTypePD":"false",
"isvBizTypeStr":"fenxiaoMedia",
"flow": "fenxiao",
"isvBizTypePD": "false",
"isvBizTypeStr": "fenxiaoMedia",
})
_ = gjson.New(result).Scan(&res)
return
......@@ -267,7 +270,7 @@ func (s *orderAli) Before(ctx context.Context, req *OrderCommonReq) (res *OrderB
"access_token": server.AccessToken,
"addressParam": gjson.New(req.AddressParam).MustToJsonString(),
"cargoParamList": gjson.New(req.CargoParam).MustToJsonString(),
"flow" : "saleproxy",
"flow": "saleproxy",
})
_ = gjson.New(result).Scan(&res)
return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论