Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
088fd810
提交
088fd810
authored
3月 27, 2023
作者:
赵雪如
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
加日志
上级
92566f9e
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
51 行增加
和
43 行删除
+51
-43
tm.go
upstream/tmNew/tm.go
+14
-0
tm_category.go
upstream/tmNew/tm_category.go
+3
-4
tm_goods.go
upstream/tmNew/tm_goods.go
+5
-6
tm_logistics.go
upstream/tmNew/tm_logistics.go
+5
-3
tm_order.go
upstream/tmNew/tm_order.go
+13
-18
tm_refund.go
upstream/tmNew/tm_refund.go
+11
-12
没有找到文件。
upstream/tmNew/tm.go
浏览文件 @
088fd810
package
tm
package
tm
import
(
import
(
"context"
openapi
"github.com/alibabacloud-go/darabonba-openapi/v2/client"
openapi
"github.com/alibabacloud-go/darabonba-openapi/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
)
)
type
Config
struct
{
type
Config
struct
{
...
@@ -29,6 +32,7 @@ const (
...
@@ -29,6 +32,7 @@ const (
format
string
=
"JSON"
format
string
=
"JSON"
typeAnony
string
=
"ANONY"
typeAnony
string
=
"ANONY"
typeEp
string
=
"EP"
typeEp
string
=
"EP"
logName
string
=
"tmNew"
)
)
func
New
(
req
*
Config
)
{
func
New
(
req
*
Config
)
{
...
@@ -46,6 +50,16 @@ func initClient() (client *link.Client, err error){
...
@@ -46,6 +50,16 @@ func initClient() (client *link.Client, err error){
client
,
err
=
link
.
NewClient
(
config
)
client
,
err
=
link
.
NewClient
(
config
)
return
return
}
}
func
log
(
ctx
context
.
Context
,
param
string
,
res
string
,
err
error
){
start
:=
gtime
.
TimestampMilli
()
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
)
}
return
}
// todo 部分接口验签通过,部分不通过天猫技术不支持对接,后续有时间再自己写
// todo 部分接口验签通过,部分不通过天猫技术不支持对接,后续有时间再自己写
//func specialUrlEncode(req string) (res string) {
//func specialUrlEncode(req string) (res string) {
// req = url.QueryEscape(req)
// req = url.QueryEscape(req)
...
...
upstream/tmNew/tm_category.go
浏览文件 @
088fd810
...
@@ -41,16 +41,15 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
...
@@ -41,16 +41,15 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
CategoryId
:
tea
.
Int64
(
item
),
CategoryId
:
tea
.
Int64
(
item
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
StrNumber
:
true
,
})
.
Scan
(
&
res
)
})
.
Scan
(
&
res
)
return
return
}
}
type
CategoryListRes
struct
{
type
CategoryListRes
struct
{
...
...
upstream/tmNew/tm_goods.go
浏览文件 @
088fd810
...
@@ -178,12 +178,11 @@ func (s *goodsTmNew) QueryItemDetailWithDivision(ctx context.Context,item string
...
@@ -178,12 +178,11 @@ func (s *goodsTmNew) QueryItemDetailWithDivision(ctx context.Context,item string
LmItemId
:
tea
.
String
(
item
),
LmItemId
:
tea
.
String
(
item
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
StrNumber
:
true
,
})
.
Scan
(
&
res
)
})
.
Scan
(
&
res
)
...
@@ -207,12 +206,12 @@ func (s *goodsTmNew) ListDistributionItem(ctx context.Context,item *ListDistribu
...
@@ -207,12 +206,12 @@ func (s *goodsTmNew) ListDistributionItem(ctx context.Context,item *ListDistribu
PageNumber
:
tea
.
Int32
(
1
),
PageNumber
:
tea
.
Int32
(
1
),
PageSize
:
tea
.
Int32
(
10
),
PageSize
:
tea
.
Int32
(
10
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
StrNumber
:
true
,
StrNumber
:
true
,
})
.
Scan
(
&
res
)
})
.
Scan
(
&
res
)
...
...
upstream/tmNew/tm_logistics.go
浏览文件 @
088fd810
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"encoding/json"
"encoding/json"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
)
)
type
logisticsTmNew
struct
{
type
logisticsTmNew
struct
{
...
@@ -48,14 +49,15 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
...
@@ -48,14 +49,15 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
MainDistributionOrderId
:
tea
.
String
(
orderSn
),
MainDistributionOrderId
:
tea
.
String
(
orderSn
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
orderSn
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
\ No newline at end of file
upstream/tmNew/tm_order.go
浏览文件 @
088fd810
...
@@ -276,13 +276,12 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
...
@@ -276,13 +276,12 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
DeliveryAddress
:
tea
.
String
(
itemInfo
.
Addr
),
DeliveryAddress
:
tea
.
String
(
itemInfo
.
Addr
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
...
@@ -308,13 +307,13 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
...
@@ -308,13 +307,13 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
PageSize
:
tea
.
Int32
(
item
.
PageSize
),
PageSize
:
tea
.
Int32
(
item
.
PageSize
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
@@ -344,14 +343,14 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
...
@@ -344,14 +343,14 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
ItemInfoLists
:
itemInfoLists
,
ItemInfoLists
:
itemInfoLists
,
DeliveryAddress
:
tea
.
String
(
item
.
Address
),
DeliveryAddress
:
tea
.
String
(
item
.
Address
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
return
return
}
}
//订单详情
//订单详情
...
@@ -368,13 +367,11 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
...
@@ -368,13 +367,11 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
...
@@ -398,13 +395,12 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
...
@@ -398,13 +395,12 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
@@ -428,13 +424,12 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
...
@@ -428,13 +424,12 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
DivisionCode
:
tea
.
String
(
itemInfo
.
DivisionCode
),
DivisionCode
:
tea
.
String
(
itemInfo
.
DivisionCode
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
...
upstream/tmNew/tm_refund.go
浏览文件 @
088fd810
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"encoding/json"
"encoding/json"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gconv"
)
)
...
@@ -113,13 +114,12 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
...
@@ -113,13 +114,12 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
@@ -149,13 +149,13 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
...
@@ -149,13 +149,13 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
@@ -216,13 +216,12 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
...
@@ -216,13 +216,12 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
LogisticsNo
:
tea
.
String
(
req
.
LogisticsNo
),
LogisticsNo
:
tea
.
String
(
req
.
LogisticsNo
),
CpCode
:
tea
.
String
(
req
.
CpCode
),
CpCode
:
tea
.
String
(
req
.
CpCode
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
@@ -245,13 +244,13 @@ func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId s
...
@@ -245,13 +244,13 @@ func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId s
SubDistributionOrderId
:
tea
.
String
(
subLmOrderId
),
SubDistributionOrderId
:
tea
.
String
(
subLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
disputeId
)
.
MustToJsonString
(),
gjson
.
New
(
result
.
Body
)
.
MustToJsonString
(),
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论