Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
f1905300
提交
f1905300
authored
3月 31, 2023
作者:
gukai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改阿里分销渠道结构体
上级
5e196968
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
59 行增加
和
29 行删除
+59
-29
ali_goods.go
upstream/alibaba/ali_goods.go
+43
-16
ali_order.go
upstream/alibaba/ali_order.go
+16
-13
没有找到文件。
upstream/alibaba/ali_goods.go
浏览文件 @
f1905300
...
...
@@ -13,19 +13,19 @@ type goodsAli struct {
var
Goods
=
goodsAli
{}
type
GoodsListReq
struct
{
RuleId
string
`json:"ruleId,omitempty"`
//选品规划id
CategoryId
string
`json:"postCategoryId,omitempty"`
//分类ID
KeyWords
string
`json:"keyWords,omitempty"`
//搜索关键词
PageNo
int
`json:"pageNo"`
//页码
PageSize
int
`json:"pageSize"`
//页面数量;最大20
TopOfferIds
string
`json:"topOfferIds,omitempty"`
//商品置顶,只会在第一页置顶,和分页大小相同最多50个
RuleId
string
`json:"ruleId,omitempty"`
//选品规划id
CategoryId
string
`json:"postCategoryId,omitempty"`
//分类ID
KeyWords
string
`json:"keyWords,omitempty"`
//搜索关键词
PageNo
int
`json:"pageNo"`
//页码
PageSize
int
`json:"pageSize"`
//页面数量;最大20
TopOfferIds
string
`json:"topOfferIds,omitempty"`
//商品置顶,只会在第一页置顶,和分页大小相同最多50个
AccessToken
string
`json:"access_token"`
}
type
GoodsListRes
struct
{
Result
struct
{
CommonRes
Result
struct
{
Result
struct
{
PageIndex
int
`json:"pageIndex"`
TotalRecords
int
`json:"totalRecords"`
SizePerPage
int
`json:"sizePerPage"`
...
...
@@ -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:"
S
upplierLoginId"`
MainVedio
string
`json:"
M
ainVedio"`
SupplierLoginId
string
`json:"
s
upplierLoginId"`
MainVedio
string
`json:"
m
ainVedio"`
CategoryID
int
`json:"categoryID"`
Subject
string
`json:"subject"`
Description
string
`json:"description"`
...
...
@@ -170,18 +169,25 @@ 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
OutItemCode
string
`json:"outItemCode"`
//下游外部商品码
AccessToken
string
`json:"access_token"`
OutItemCode
string
`json:"outItemCode"`
//下游外部商品码
AccessToken
string
`json:"access_token"`
}
type
GoodsCategoryReq
struct
{
...
...
@@ -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
}
//
Outshop
Add 添加分销商品关系
func
(
goodsAli
)
RelationAdd
(
ctx
context
.
Context
,
req
*
Relation
AddReq
)
(
res
*
OutshopAdd
Res
,
err
error
)
{
//
Relation
Add 添加分销商品关系
func
(
goodsAli
)
RelationAdd
(
ctx
context
.
Context
,
req
*
Relation
InfoReq
)
(
res
*
Relation
Res
,
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
}
upstream/alibaba/ali_order.go
浏览文件 @
f1905300
...
...
@@ -30,9 +30,12 @@ type OrderAddress struct {
}
type
OrderCargo
struct
{
SpecId
string
`json:"specId"`
OfferId
int64
`json:"offerId"`
Quantity
int
`json:"quantity"`
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
...
...
@@ -242,14 +245,14 @@ type OrderBeforeRes struct {
}
type
OrderBeforeItem
struct
{
SumPayment
int64
`json:"sumPayment"`
//订单总费用, 单位为分
SumPaymentNoCarriage
int64
`json:"sumPaymentNoCarriage"`
//不包含运费的货品总费用, 单位为分.
AdditionalFee
int64
`json:"additionalFee"`
//附加费,单位,分
SumCarriage
int64
`json:"sumCarriage"`
//总运费信息, 单位为分.
ResultCode
string
`json:"resultCode"`
//
SumPayment
int64
`json:"sumPayment"`
//订单总费用, 单位为分
SumPaymentNoCarriage
int64
`json:"sumPaymentNoCarriage"`
//不包含运费的货品总费用, 单位为分.
AdditionalFee
int64
`json:"additionalFee"`
//附加费,单位,分
SumCarriage
int64
`json:"sumCarriage"`
//总运费信息, 单位为分.
ResultCode
string
`json:"resultCode"`
//
ShopPromotionList
[]
struct
{
//可用店铺级别优惠列表
PromotionId
int64
`json:"promotionId"`
//优惠券ID
}
`json:"shopPromotionList"`
//规格信息
}
`json:"shopPromotionList"`
//规格信息
Message
string
`json:"message"`
//返回信息
CargoList
[]
struct
{
FinalUnitPrice
float64
`json:"finalUnitPrice"`
//最终单价
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论