Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
aa4f55f2
提交
aa4f55f2
authored
3月 29, 2023
作者:
赵雪如
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tmnew log
上级
afa4a967
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
21 行增加
和
23 行删除
+21
-23
tm.go
upstream/tmNew/tm.go
+4
-3
tm_category.go
upstream/tmNew/tm_category.go
+1
-1
tm_goods.go
upstream/tmNew/tm_goods.go
+3
-5
tm_logistics.go
upstream/tmNew/tm_logistics.go
+1
-1
tm_order.go
upstream/tmNew/tm_order.go
+7
-6
tm_refund.go
upstream/tmNew/tm_refund.go
+5
-7
没有找到文件。
upstream/tmNew/tm.go
浏览文件 @
aa4f55f2
...
...
@@ -2,6 +2,7 @@ package tm
import
(
"context"
"encoding/json"
openapi
"github.com/alibabacloud-go/darabonba-openapi/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
"github.com/alibabacloud-go/tea/tea"
...
...
@@ -50,13 +51,13 @@ func initClient() (client *link.Client, err error){
client
,
err
=
link
.
NewClient
(
config
)
return
}
func
log
(
ctx
context
.
Context
,
param
string
,
res
string
,
err
error
){
func
log
(
ctx
context
.
Context
,
param
string
,
res
interface
{}
,
err
error
){
start
:=
gtime
.
TimestampMilli
()
resString
,
_
:=
json
.
Marshal
(
res
)
if
err
!=
nil
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
logName
)
.
Cat
(
"error"
)
.
Infof
(
"参数【%v】错误【%v】响应时间【%v】"
,
param
,
err
.
Error
(),
gtime
.
TimestampMilli
()
-
start
)
}
else
{
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
logName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
param
,
res
,
gtime
.
TimestampMilli
()
-
start
)
g
.
Log
()
.
Ctx
(
ctx
)
.
Cat
(
logName
)
.
Infof
(
"参数【%v】响应【%v】响应时间【%v】"
,
param
,
string
(
resString
)
,
gtime
.
TimestampMilli
()
-
start
)
}
return
}
...
...
upstream/tmNew/tm_category.go
浏览文件 @
aa4f55f2
...
...
@@ -45,7 +45,7 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
...
...
upstream/tmNew/tm_goods.go
浏览文件 @
aa4f55f2
...
...
@@ -182,10 +182,8 @@ func (s *goodsTmNew) QueryItemDetailWithDivision(ctx context.Context,item string
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
if
*
result
.
Body
.
Success
==
false
{
return
}
//他们返回报错
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
})
.
Scan
(
&
res
)
...
...
@@ -213,7 +211,7 @@ func (s *goodsTmNew) ListDistributionItem(ctx context.Context,item *ListDistribu
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
...
...
upstream/tmNew/tm_logistics.go
浏览文件 @
aa4f55f2
...
...
@@ -54,7 +54,7 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
orderSn
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
orderSn
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
upstream/tmNew/tm_order.go
浏览文件 @
aa4f55f2
...
...
@@ -280,7 +280,8 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
...
@@ -312,7 +313,7 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
...
@@ -347,7 +348,7 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
...
...
@@ -371,7 +372,7 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
...
@@ -399,7 +400,7 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
...
@@ -428,7 +429,7 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
...
upstream/tmNew/tm_refund.go
浏览文件 @
aa4f55f2
...
...
@@ -118,7 +118,7 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
@@ -154,7 +154,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
@@ -220,7 +220,7 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
@@ -249,7 +249,7 @@ func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId s
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
disputeId
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
()
,
err
)
log
(
ctx
,
gjson
.
New
(
disputeId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
@@ -270,13 +270,11 @@ func (s *refundTm) Detail(ctx context.Context,subOrderId string) (res *RefundInf
SubDistributionOrderId
:
tea
.
String
(
subOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
subOrderId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论