Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
5b852da3
提交
5b852da3
authored
7月 25, 2022
作者:
胡思琦
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
66228684
6f387b69
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
65 行增加
和
65 行删除
+65
-65
tm_account.go
upstream/tm/tm_account.go
+2
-3
tm_deliver.go
upstream/tm/tm_deliver.go
+2
-3
tm_order.go
upstream/tm/tm_order.go
+51
-49
tm_refund.go
upstream/tm/tm_refund.go
+10
-10
没有找到文件。
upstream/tm/tm_account.go
浏览文件 @
5b852da3
...
@@ -3,7 +3,6 @@ package tm
...
@@ -3,7 +3,6 @@ package tm
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
)
type
accountTm
struct
{
type
accountTm
struct
{
...
@@ -12,11 +11,11 @@ type accountTm struct {
...
@@ -12,11 +11,11 @@ type accountTm struct {
var
Account
=
accountTm
{}
var
Account
=
accountTm
{}
//Regist 注册单个淘宝账号接口(同步)
//Regist 注册单个淘宝账号接口(同步)
func
(
s
*
accountTm
)
Regist
(
ctx
context
.
Context
,
AppID
interface
{}
)
(
res
*
CommonRes
,
err
error
)
{
func
(
s
*
accountTm
)
Regist
(
ctx
context
.
Context
,
UserId
string
)
(
res
*
CommonRes
,
err
error
)
{
method
:=
"RegistAnonymousTbAccount"
method
:=
"RegistAnonymousTbAccount"
result
,
err
:=
post
(
ctx
,
method
,
map
[
string
]
string
{
result
,
err
:=
post
(
ctx
,
method
,
map
[
string
]
string
{
"BizUid"
:
server
.
BizUid
,
"BizUid"
:
server
.
BizUid
,
"ThirdPartyUserId"
:
gconv
.
String
(
AppID
)
,
"ThirdPartyUserId"
:
UserId
,
})
})
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
return
return
...
...
upstream/tm/tm_deliver.go
浏览文件 @
5b852da3
...
@@ -3,7 +3,6 @@ package tm
...
@@ -3,7 +3,6 @@ package tm
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
)
type
deliverTm
struct
{
type
deliverTm
struct
{
...
@@ -33,7 +32,7 @@ type DeliverInfoRes struct {
...
@@ -33,7 +32,7 @@ type DeliverInfoRes struct {
}
}
//Info 物流查询接口
//Info 物流查询接口
func
(
s
*
deliverTm
)
Info
(
ctx
context
.
Context
,
AppID
interface
{}
,
LmOrderId
string
)
(
res
*
DeliverInfoRes
,
err
error
)
{
func
(
s
*
deliverTm
)
Info
(
ctx
context
.
Context
,
UserId
,
LmOrderId
string
)
(
res
*
DeliverInfoRes
,
err
error
)
{
method
:=
"queryLogistics"
method
:=
"queryLogistics"
...
@@ -41,7 +40,7 @@ func (s *deliverTm) Info(ctx context.Context, AppID interface{}, LmOrderId strin
...
@@ -41,7 +40,7 @@ func (s *deliverTm) Info(ctx context.Context, AppID interface{}, LmOrderId strin
"BizUid"
:
server
.
BizUid
,
"BizUid"
:
server
.
BizUid
,
"LmOrderId"
:
LmOrderId
,
"LmOrderId"
:
LmOrderId
,
"AccountType"
:
"ANONY"
,
"AccountType"
:
"ANONY"
,
"ThirdPartyUserId"
:
gconv
.
String
(
AppID
)
,
"ThirdPartyUserId"
:
UserId
,
}
}
result
,
err
:=
post
(
ctx
,
method
,
request
)
result
,
err
:=
post
(
ctx
,
method
,
request
)
...
...
upstream/tm/tm_order.go
浏览文件 @
5b852da3
...
@@ -73,7 +73,7 @@ func (s *orderTm) Before(ctx context.Context, addr OrderAddress, itemLists []Ord
...
@@ -73,7 +73,7 @@ func (s *orderTm) Before(ctx context.Context, addr OrderAddress, itemLists []Ord
}
}
type
OrderCreateReq
struct
{
type
OrderCreateReq
struct
{
AppID
interface
{}
UserId
string
ChannelOrder
string
ChannelOrder
string
Address
OrderAddress
Address
OrderAddress
ItemLists
[]
OrderGoodsItem
ItemLists
[]
OrderGoodsItem
...
@@ -108,7 +108,7 @@ func (s *orderTm) Create(ctx context.Context, req OrderCreateReq) (res *OrderCre
...
@@ -108,7 +108,7 @@ func (s *orderTm) Create(ctx context.Context, req OrderCreateReq) (res *OrderCre
request
[
"BizUid"
]
=
server
.
BizUid
request
[
"BizUid"
]
=
server
.
BizUid
request
[
"OutTradeId"
]
=
req
.
ChannelOrder
request
[
"OutTradeId"
]
=
req
.
ChannelOrder
request
[
"AccountType"
]
=
typeAnony
request
[
"AccountType"
]
=
typeAnony
request
[
"ThirdPartyUserId"
]
=
gconv
.
String
(
req
.
AppID
)
request
[
"ThirdPartyUserId"
]
=
req
.
UserId
result
,
err
:=
post
(
ctx
,
method
,
request
)
result
,
err
:=
post
(
ctx
,
method
,
request
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
...
@@ -116,7 +116,7 @@ func (s *orderTm) Create(ctx context.Context, req OrderCreateReq) (res *OrderCre
...
@@ -116,7 +116,7 @@ func (s *orderTm) Create(ctx context.Context, req OrderCreateReq) (res *OrderCre
}
}
type
OrderPayReq
struct
{
type
OrderPayReq
struct
{
AppID
interface
{}
UserId
string
ChannelOrder
string
ChannelOrder
string
LmOrderId
string
LmOrderId
string
}
}
...
@@ -129,14 +129,14 @@ func (s *orderTm) Pay(ctx context.Context, req OrderPayReq) (res *OrderCreateRes
...
@@ -129,14 +129,14 @@ func (s *orderTm) Pay(ctx context.Context, req OrderPayReq) (res *OrderCreateRes
"LmOrderId"
:
req
.
LmOrderId
,
"LmOrderId"
:
req
.
LmOrderId
,
"OutTradeId"
:
req
.
ChannelOrder
,
"OutTradeId"
:
req
.
ChannelOrder
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
"ThirdPartyUserId"
:
gconv
.
String
(
req
.
AppID
)
,
"ThirdPartyUserId"
:
req
.
UserId
,
})
})
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
return
return
}
}
type
OrderListReq
struct
{
type
OrderListReq
struct
{
AppID
interface
{}
UserId
string
ChannelOrder
string
ChannelOrder
string
LmOrderId
string
LmOrderId
string
LogisticsStatus
string
LogisticsStatus
string
...
@@ -151,60 +151,62 @@ type OrderFilter struct {
...
@@ -151,60 +151,62 @@ type OrderFilter struct {
}
}
type
OrderListRes
struct
{
type
OrderListRes
struct
{
Code
string
`json:"Code"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
Success
bool
`json:"Success"`
PostFee
struct
{
PostFee
struct
{
FundAmount
int
`json:"FundAmount"`
FundType
string
`json:"FundType"`
FundType
string
`json:"FundType"`
FundAmount
int64
`json:"FundAmount"`
FundAmountMoney
int
`json:"FundAmountMoney"`
FundAmountMoney
uint
`json:"FundAmountMoney"`
}
`json:"PostFee"`
}
`json:"PostFee"`
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
PageSize
int
`json:"PageSize"`
PageNumber
int
`json:"PageNumber"`
LmOrderList
struct
{
LmOrderList
struct
{
OrderIds
struct
{
OrderIds
[]
string
`json:"OrderIds"`
}
`json:"OrderIds"`
PayTradeIds
struct
{
PayTradeIds
[]
string
`json:"PayTradeIds"`
}
`json:"PayTradeIds"`
LmOrderList
[]
struct
{
LmOrderList
[]
struct
{
LmOrderId
string
`json:"LmOrderId"`
//订单号,对外统一使用此ID做主键操作
PostFee
struct
{
OrderStatus
int
`json:"OrderStatus"`
//订单状态,6=交易成功
FundAmount
int
`json:"FundAmount"`
OrderAmount
uint
`json:"OrderAmount"`
//订单总金额
FundType
string
`json:"FundType"`
TbOrderId
string
`json:"TbOrderId"`
//淘宝订单号
FundAmountMoney
int
`json:"FundAmountMoney"`
}
`json:"PostFee"`
ExtJson
string
`json:"ExtJson"`
OrderStatus
int
`json:"OrderStatus"`
ShopName
string
`json:"ShopName"`
EnableStatus
int
`json:"EnableStatus"`
EnableStatus
int
`json:"EnableStatus"`
TbOrderId
int64
`json:"TbOrderId"`
OrderAmount
int
`json:"OrderAmount"`
FundStructureModels
struct
{
FundStructureModels
[]
struct
{
FundAmount
int
`json:"FundAmount"`
FundType
string
`json:"FundType"`
FundAmountMoney
int
`json:"FundAmountMoney"`
}
`json:"FundStructureModels"`
}
`json:"FundStructureModels"`
CreateDate
string
`json:"CreateDate"`
CreateDate
string
`json:"CreateDate"`
LmOrderId
string
`json:"LmOrderId"`
LogisticsStatus
int
`json:"LogisticsStatus"`
SubOrderList
struct
{
SubOrderList
struct
{
SubOrderList
[]
struct
{
SubOrderList
[]
struct
{
ItemId
int64
`json:"ItemId"`
OrderStatus
int
`json:"OrderStatus"`
//订单状态,6=交易成功
LmOrderId
string
`json:"LmOrderId"`
//子订单号
TbOrderId
string
`json:"TbOrderId"`
//淘宝子订单号
SkuId
string
`json:"SkuId"`
//下单的商品SkuId
Number
int64
`json:"Number"`
//下单数量
EnableStatus
int
`json:"EnableStatus"`
ItemPic
string
`json:"ItemPic"`
//商品图片
ItemPriceList
struct
{
ItemPriceList
struct
{
ItemPriceList
[]
struct
{
ItemPriceList
[]
struct
{
FundAmount
int
`json:"FundAmount"`
FundType
string
`json:"FundType"`
FundType
string
`json:"FundType"`
FundAmount
int64
`json:"FundAmount"`
FundAmountMoney
int
`json:"FundAmountMoney"`
FundAmountMoney
uint
`json:"FundAmountMoney"`
//子订单金额,以分为单位
}
`json:"ItemPriceList"`
}
`json:"ItemPriceList"`
}
`json:"ItemPriceList"`
}
`json:"ItemPriceList"`
ItemTitle
string
`json:"ItemTitle"`
//商品名称
OrderStatus
int
`json:"OrderStatus"`
SkuName
string
`json:"SkuName"`
//下单的商品SKU显示名称
Number
int
`json:"Number"`
EnableStatus
int
`json:"EnableStatus"`
TbOrderId
int64
`json:"TbOrderId"`
ItemTitle
string
`json:"ItemTitle"`
SkuName
string
`json:"SkuName"`
ItemPic
string
`json:"ItemPic"`
SkuId
string
`json:"SkuId"`
ItemId
int64
`json:"ItemId"`
LmOrderId
int
`json:"LmOrderId"`
}
`json:"SubOrderList"`
}
`json:"SubOrderList"`
}
`json:"SubOrderList"`
}
`json:"SubOrderList"`
PostFee
struct
{
FundType
string
`json:"FundType"`
FundAmount
int64
`json:"FundAmount"`
FundAmountMoney
int64
`json:"FundAmountMoney"`
}
`json:"PostFee"`
LogisticsStatus
int64
`json:"LogisticsStatus"`
//物流状态
}
`json:"LmOrderList"`
}
`json:"LmOrderList"`
}
`json:"LmOrderList"`
}
`json:"LmOrderList"`
Code
string
`json:"Code"`
}
}
//List 列表
//List 列表
...
@@ -229,16 +231,16 @@ func (s *orderTm) List(ctx context.Context, req OrderListReq) (res *OrderListRes
...
@@ -229,16 +231,16 @@ func (s *orderTm) List(ctx context.Context, req OrderListReq) (res *OrderListRes
"PageNumber"
:
"1"
,
"PageNumber"
:
"1"
,
"PageSize"
:
"20"
,
"PageSize"
:
"20"
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
"ThirdPartyUserId"
:
gconv
.
String
(
req
.
AppID
)
,
"ThirdPartyUserId"
:
req
.
UserId
,
}
}
result
,
err
:=
post
(
ctx
,
method
,
request
)
result
,
err
:=
post
(
ctx
,
method
,
request
)
_
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
return
return
}
}
type
OrderCancelReq
struct
{
type
OrderCancelReq
struct
{
AppID
interface
{}
UserId
string
LmOrderId
string
LmOrderId
string
}
}
...
@@ -250,7 +252,7 @@ func (s *orderTm) Cancel(ctx context.Context, req OrderCancelReq) (res *OrderLis
...
@@ -250,7 +252,7 @@ func (s *orderTm) Cancel(ctx context.Context, req OrderCancelReq) (res *OrderLis
"BizUid"
:
server
.
BizUid
,
"BizUid"
:
server
.
BizUid
,
"LmOrderId"
:
req
.
LmOrderId
,
"LmOrderId"
:
req
.
LmOrderId
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
"ThirdPartyUserId"
:
gconv
.
String
(
req
.
AppID
)
,
"ThirdPartyUserId"
:
req
.
UserId
,
})
})
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
return
return
...
...
upstream/tm/tm_refund.go
浏览文件 @
5b852da3
...
@@ -12,7 +12,7 @@ type refundTm struct {
...
@@ -12,7 +12,7 @@ type refundTm struct {
var
Refund
=
refundTm
{}
var
Refund
=
refundTm
{}
type
RefundSubmitReq
struct
{
type
RefundSubmitReq
struct
{
AppID
interface
{}
UserId
string
SubLmOrderId
string
//子订单号
SubLmOrderId
string
//子订单号
DisputeId
string
//售后ID
DisputeId
string
//售后ID
CpCode
string
//物流编码
CpCode
string
//物流编码
...
@@ -29,7 +29,7 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
...
@@ -29,7 +29,7 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
"DisputeId"
:
req
.
DisputeId
,
"DisputeId"
:
req
.
DisputeId
,
"CpCode"
:
req
.
CpCode
,
"CpCode"
:
req
.
CpCode
,
"LogisticsNo"
:
req
.
LogisticsNo
,
"LogisticsNo"
:
req
.
LogisticsNo
,
"ThirdPartyUserId"
:
gconv
.
String
(
req
.
AppID
)
,
"ThirdPartyUserId"
:
req
.
UserId
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
}
}
...
@@ -39,14 +39,14 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
...
@@ -39,14 +39,14 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
}
}
//Cancel 取消退款申请接口
//Cancel 取消退款申请接口
func
(
s
*
refundTm
)
Cancel
(
ctx
context
.
Context
,
AppID
uint
,
subLmOrderId
,
disputeId
string
)
(
res
*
CommonRes
,
err
error
)
{
func
(
s
*
refundTm
)
Cancel
(
ctx
context
.
Context
,
UserId
,
subLmOrderId
,
disputeId
string
)
(
res
*
CommonRes
,
err
error
)
{
method
:=
"cancelRefund"
method
:=
"cancelRefund"
request
:=
map
[
string
]
string
{
request
:=
map
[
string
]
string
{
"BizUid"
:
server
.
BizUid
,
"BizUid"
:
server
.
BizUid
,
"SubLmOrderId"
:
subLmOrderId
,
"SubLmOrderId"
:
subLmOrderId
,
"DisputeId"
:
disputeId
,
"DisputeId"
:
disputeId
,
"ThirdPartyUserId"
:
gconv
.
String
(
AppID
)
,
"ThirdPartyUserId"
:
UserId
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
}
}
...
@@ -56,7 +56,7 @@ func (s *refundTm) Cancel(ctx context.Context, AppID uint, subLmOrderId, dispute
...
@@ -56,7 +56,7 @@ func (s *refundTm) Cancel(ctx context.Context, AppID uint, subLmOrderId, dispute
}
}
type
RefundBeforeReq
struct
{
type
RefundBeforeReq
struct
{
AppID
interface
{}
UserId
string
ChannelOrder
string
ChannelOrder
string
SubLmOrderId
string
SubLmOrderId
string
BizClaimType
string
BizClaimType
string
...
@@ -93,7 +93,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
...
@@ -93,7 +93,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
"SubLmOrderId"
:
req
.
SubLmOrderId
,
"SubLmOrderId"
:
req
.
SubLmOrderId
,
"GoodsStatus"
:
req
.
GoodsStatus
,
"GoodsStatus"
:
req
.
GoodsStatus
,
"BizClaimType"
:
req
.
BizClaimType
,
"BizClaimType"
:
req
.
BizClaimType
,
"ThirdPartyUserId"
:
gconv
.
String
(
req
.
AppID
)
,
"ThirdPartyUserId"
:
req
.
UserId
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
}
}
...
@@ -103,7 +103,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
...
@@ -103,7 +103,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
}
}
type
RefundApplyReq
struct
{
type
RefundApplyReq
struct
{
AppID
interface
{}
UserId
string
SubLmOrderId
string
//子订单号
SubLmOrderId
string
//子订单号
BizClaimType
string
//退款类型
BizClaimType
string
//退款类型
ApplyRefundFee
string
//申请退款金额
ApplyRefundFee
string
//申请退款金额
...
@@ -144,7 +144,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
...
@@ -144,7 +144,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
request
[
"GoodsStatus"
]
=
req
.
GoodsStatus
request
[
"GoodsStatus"
]
=
req
.
GoodsStatus
request
[
"BizUid"
]
=
server
.
BizUid
request
[
"BizUid"
]
=
server
.
BizUid
request
[
"AccountType"
]
=
typeAnony
request
[
"AccountType"
]
=
typeAnony
request
[
"ThirdPartyUserId"
]
=
gconv
.
String
(
req
.
AppID
)
request
[
"ThirdPartyUserId"
]
=
req
.
UserId
result
,
err
:=
post
(
ctx
,
method
,
request
)
result
,
err
:=
post
(
ctx
,
method
,
request
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
_
=
json
.
Unmarshal
([]
byte
(
result
),
&
res
)
...
@@ -186,13 +186,13 @@ type RefundInfoRes struct {
...
@@ -186,13 +186,13 @@ type RefundInfoRes struct {
}
}
//Info 详情
//Info 详情
func
(
s
*
refundTm
)
Info
(
ctx
context
.
Context
,
AppID
uint
,
subLmOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
func
(
s
*
refundTm
)
Info
(
ctx
context
.
Context
,
UserId
,
subLmOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
method
:=
"queryRefundApplicationDetail"
method
:=
"queryRefundApplicationDetail"
request
:=
map
[
string
]
string
{
request
:=
map
[
string
]
string
{
"BizUid"
:
server
.
BizUid
,
"BizUid"
:
server
.
BizUid
,
"SubLmOrderId"
:
subLmOrderId
,
"SubLmOrderId"
:
subLmOrderId
,
"ThirdPartyUserId"
:
gconv
.
String
(
AppID
)
,
"ThirdPartyUserId"
:
UserId
,
"AccountType"
:
typeAnony
,
"AccountType"
:
typeAnony
,
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论