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

Merge branch 'alibaba'

...@@ -13,19 +13,19 @@ type goodsAli struct { ...@@ -13,19 +13,19 @@ type goodsAli struct {
var Goods = goodsAli{} var Goods = goodsAli{}
type GoodsListReq struct { type GoodsListReq struct {
RuleId string `json:"ruleId,omitempty"` //选品规划id RuleId string `json:"ruleId,omitempty"` //选品规划id
CategoryId string `json:"postCategoryId,omitempty"` //分类ID CategoryId string `json:"postCategoryId,omitempty"` //分类ID
KeyWords string `json:"keyWords,omitempty"` //搜索关键词 KeyWords string `json:"keyWords,omitempty"` //搜索关键词
PageNo int `json:"pageNo"` //页码 PageNo int `json:"pageNo"` //页码
PageSize int `json:"pageSize"` //页面数量;最大20 PageSize int `json:"pageSize"` //页面数量;最大20
TopOfferIds string `json:"topOfferIds,omitempty"` //商品置顶,只会在第一页置顶,和分页大小相同最多50个 TopOfferIds string `json:"topOfferIds,omitempty"` //商品置顶,只会在第一页置顶,和分页大小相同最多50个
AccessToken string `json:"access_token"` AccessToken string `json:"access_token"`
} }
type GoodsListRes struct { type GoodsListRes struct {
Result struct { Result struct {
CommonRes CommonRes
Result struct { Result struct {
PageIndex int `json:"pageIndex"` PageIndex int `json:"pageIndex"`
TotalRecords int `json:"totalRecords"` TotalRecords int `json:"totalRecords"`
SizePerPage int `json:"sizePerPage"` SizePerPage int `json:"sizePerPage"`
...@@ -45,7 +45,6 @@ type GoodsListRes struct { ...@@ -45,7 +45,6 @@ type GoodsListRes struct {
} `json:"result"` } `json:"result"`
} }
type GoodsInfoRes struct { type GoodsInfoRes struct {
CommonRes CommonRes
BizGroupInfos []struct { BizGroupInfos []struct {
...@@ -55,8 +54,8 @@ type GoodsInfoRes struct { ...@@ -55,8 +54,8 @@ type GoodsInfoRes struct {
} `json:"bizGroupInfos"` } `json:"bizGroupInfos"`
ProductInfo struct { ProductInfo struct {
ProductID int64 `json:"productID"` ProductID int64 `json:"productID"`
SupplierLoginId string `json:"SupplierLoginId"` SupplierLoginId string `json:"supplierLoginId"`
MainVedio string `json:"MainVedio"` MainVedio string `json:"mainVedio"`
CategoryID int `json:"categoryID"` CategoryID int `json:"categoryID"`
Subject string `json:"subject"` Subject string `json:"subject"`
Description string `json:"description"` Description string `json:"description"`
...@@ -170,18 +169,25 @@ type GoodsFollowRes struct { ...@@ -170,18 +169,25 @@ type GoodsFollowRes struct {
ErrorMessage int `json:"errorMessage"` 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 { type OutshopAddRes struct {
Code int `json:"code"` Code int `json:"code"`
Message int `json:"message"` Message int `json:"message"`
} }
type RelationAddReq struct {
type RelationInfoReq struct {
Channel string `json:"channel"` // 下游渠道代码 Channel string `json:"channel"` // 下游渠道代码
OutShopCode string `json:"outShopCode"` // 下游店铺code OutShopCode string `json:"outShopCode"` // 下游店铺code
OfferId string `json:"offerId"` //上游1688商品id OfferId string `json:"offerId"` //上游1688商品id
OutItemCode string `json:"outItemCode"` //下游外部商品码 OutItemCode string `json:"outItemCode"` //下游外部商品码
AccessToken string `json:"access_token"` AccessToken string `json:"access_token"`
} }
type GoodsCategoryReq struct { type GoodsCategoryReq struct {
...@@ -258,7 +264,6 @@ func (goodsAli) UnFollow(ctx context.Context, GoodsID string) (res *GoodsFollowR ...@@ -258,7 +264,6 @@ func (goodsAli) UnFollow(ctx context.Context, GoodsID string) (res *GoodsFollowR
return return
} }
func (goodsAli) Category(ctx context.Context, CategoryID interface{}) (res *GoodsCategoryRes, err error) { func (goodsAli) Category(ctx context.Context, CategoryID interface{}) (res *GoodsCategoryRes, err error) {
method := "com.alibaba.product/alibaba.category.get" method := "com.alibaba.product/alibaba.category.get"
var req = &GoodsCategoryReq{ var req = &GoodsCategoryReq{
...@@ -285,8 +290,8 @@ func (goodsAli) OutshopAdd(ctx context.Context, merId string) (res *GoodsFollowR ...@@ -285,8 +290,8 @@ func (goodsAli) OutshopAdd(ctx context.Context, merId string) (res *GoodsFollowR
return return
} }
//OutshopAdd 添加分销商品关系 //RelationAdd 添加分销商品关系
func (goodsAli) RelationAdd(ctx context.Context, req *RelationAddReq) (res *OutshopAddRes, err error) { func (goodsAli) RelationAdd(ctx context.Context, req *RelationInfoReq) (res *RelationRes, err error) {
method := "com.alibaba.fenxiao/alibaba.fenxiao.buyer.outproduct.relation.add" method := "com.alibaba.fenxiao/alibaba.fenxiao.buyer.outproduct.relation.add"
req.AccessToken = server.AccessToken req.AccessToken = server.AccessToken
...@@ -296,3 +301,25 @@ func (goodsAli) RelationAdd(ctx context.Context, req *RelationAddReq) (res *Outs ...@@ -296,3 +301,25 @@ func (goodsAli) RelationAdd(ctx context.Context, req *RelationAddReq) (res *Outs
return 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
}
...@@ -30,9 +30,12 @@ type OrderAddress struct { ...@@ -30,9 +30,12 @@ type OrderAddress struct {
} }
type OrderCargo struct { type OrderCargo struct {
SpecId string `json:"specId"` SpecId string `json:"specId"`
OfferId int64 `json:"offerId"` OfferId int64 `json:"offerId"`
Quantity int `json:"quantity"` Quantity int `json:"quantity"`
OutShopCode string `json:"outShopCode"`
OutItemCode string `json:"outItemCode"`
Channel string `json:"channel"`
} }
type OuterOrderInfo struct { type OuterOrderInfo struct {
...@@ -66,9 +69,9 @@ func (s *orderAli) Create(ctx context.Context, req *OrderCommonReq) (res *OrderC ...@@ -66,9 +69,9 @@ func (s *orderAli) Create(ctx context.Context, req *OrderCommonReq) (res *OrderC
"addressParam": gjson.New(req.AddressParam).MustToJsonString(), "addressParam": gjson.New(req.AddressParam).MustToJsonString(),
"cargoParamList": gjson.New(req.CargoParam).MustToJsonString(), "cargoParamList": gjson.New(req.CargoParam).MustToJsonString(),
"outerOrderInfo": gjson.New(req.OuterOrderInfo).MustToJsonString(), "outerOrderInfo": gjson.New(req.OuterOrderInfo).MustToJsonString(),
"flow":"fenxiao", "flow": "fenxiao",
"isvBizTypePD":"false", "isvBizTypePD": "false",
"isvBizTypeStr":"fenxiaoMedia", "isvBizTypeStr": "fenxiaoMedia",
}) })
_ = gjson.New(result).Scan(&res) _ = gjson.New(result).Scan(&res)
return return
...@@ -242,14 +245,14 @@ type OrderBeforeRes struct { ...@@ -242,14 +245,14 @@ type OrderBeforeRes struct {
} }
type OrderBeforeItem struct { type OrderBeforeItem struct {
SumPayment int64 `json:"sumPayment"` //订单总费用, 单位为分 SumPayment int64 `json:"sumPayment"` //订单总费用, 单位为分
SumPaymentNoCarriage int64 `json:"sumPaymentNoCarriage"` //不包含运费的货品总费用, 单位为分. SumPaymentNoCarriage int64 `json:"sumPaymentNoCarriage"` //不包含运费的货品总费用, 单位为分.
AdditionalFee int64 `json:"additionalFee"` //附加费,单位,分 AdditionalFee int64 `json:"additionalFee"` //附加费,单位,分
SumCarriage int64 `json:"sumCarriage"` //总运费信息, 单位为分. SumCarriage int64 `json:"sumCarriage"` //总运费信息, 单位为分.
ResultCode string `json:"resultCode"` // ResultCode string `json:"resultCode"` //
ShopPromotionList []struct { //可用店铺级别优惠列表 ShopPromotionList []struct { //可用店铺级别优惠列表
PromotionId int64 `json:"promotionId"` //优惠券ID PromotionId int64 `json:"promotionId"` //优惠券ID
} `json:"shopPromotionList"` //规格信息 } `json:"shopPromotionList"` //规格信息
Message string `json:"message"` //返回信息 Message string `json:"message"` //返回信息
CargoList []struct { CargoList []struct {
FinalUnitPrice float64 `json:"finalUnitPrice"` //最终单价 FinalUnitPrice float64 `json:"finalUnitPrice"` //最终单价
...@@ -267,7 +270,7 @@ func (s *orderAli) Before(ctx context.Context, req *OrderCommonReq) (res *OrderB ...@@ -267,7 +270,7 @@ func (s *orderAli) Before(ctx context.Context, req *OrderCommonReq) (res *OrderB
"access_token": server.AccessToken, "access_token": server.AccessToken,
"addressParam": gjson.New(req.AddressParam).MustToJsonString(), "addressParam": gjson.New(req.AddressParam).MustToJsonString(),
"cargoParamList": gjson.New(req.CargoParam).MustToJsonString(), "cargoParamList": gjson.New(req.CargoParam).MustToJsonString(),
"flow" : "saleproxy", "flow": "saleproxy",
}) })
_ = gjson.New(result).Scan(&res) _ = gjson.New(result).Scan(&res)
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论