Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
332950b1
提交
332950b1
authored
3月 21, 2023
作者:
赵雪如
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gjson 改json
上级
21c43c59
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
81 行增加
和
31 行删除
+81
-31
tm_category.go
upstream/tmNew/tm_category.go
+0
-4
tm_logistics.go
upstream/tmNew/tm_logistics.go
+3
-4
tm_order.go
upstream/tmNew/tm_order.go
+66
-13
tm_refund.go
upstream/tmNew/tm_refund.go
+12
-10
没有找到文件。
upstream/tmNew/tm_category.go
浏览文件 @
332950b1
...
@@ -51,10 +51,6 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
...
@@ -51,10 +51,6 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
StrNumber
:
true
,
StrNumber
:
true
,
})
.
Scan
(
&
res
)
})
.
Scan
(
&
res
)
//req ,_:=gjson.Encode(item)
//resultString ,_:=gjson.Encode(result)
//log(ctx,string(req),err,string(resultString))
return
return
}
}
type
CategoryListRes
struct
{
type
CategoryListRes
struct
{
...
...
upstream/tmNew/tm_logistics.go
浏览文件 @
332950b1
...
@@ -2,9 +2,9 @@ package tm
...
@@ -2,9 +2,9 @@ package tm
import
(
import
(
"context"
"context"
"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
{
...
@@ -43,7 +43,6 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
...
@@ -43,7 +43,6 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryLogistics4Distribution
(
&
link
.
QueryLogistics4DistributionRequest
{
result
,
err
:=
client
.
QueryLogistics4Distribution
(
&
link
.
QueryLogistics4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
MainDistributionOrderId
:
tea
.
String
(
orderSn
),
MainDistributionOrderId
:
tea
.
String
(
orderSn
),
...
@@ -56,7 +55,7 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
...
@@ -56,7 +55,7 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
\ No newline at end of file
upstream/tmNew/tm_order.go
浏览文件 @
332950b1
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
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/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
)
type
orderTm
struct
{
type
orderTm
struct
{
...
@@ -79,7 +79,7 @@ type RenderDistributionOrderRes struct {
...
@@ -79,7 +79,7 @@ type RenderDistributionOrderRes struct {
type
OrderCreateReq
struct
{
type
OrderCreateReq
struct
{
UserId
string
UserId
string
ChannelOrder
string
ChannelOrder
string
Address
OrderAddress
Address
string
ItemLists
[]
OrderGoodsItem
ItemLists
[]
OrderGoodsItem
}
}
type
OrderGoodsItem
struct
{
type
OrderGoodsItem
struct
{
...
@@ -236,6 +236,24 @@ type OrderStatusRes struct {
...
@@ -236,6 +236,24 @@ type OrderStatusRes struct {
//
//
//99:交易成功
//99:交易成功
}
}
type
AddrInfoReq
struct
{
DivisionCode
string
`json:"DivisionCode"`
}
type
AddrInfoRes
struct
{
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
Code
string
`json:"Code"`
Model
struct
{
DivisionList
[]
AddrInfo
`json:"DivisionList"`
}
`json:"Model"`
}
type
AddrInfo
struct
{
ParentId
int
`json:"ParentId"`
DivisionLevel
int
`json:"DivisionLevel"`
DivisionName
string
`json:"DivisionName"`
Pinyin
string
`json:"Pinyin"`
DivisionCode
int
`json:"DivisionCode"`
}
//Before 验证订单商品
//Before 验证订单商品
func
(
s
*
orderTm
)
Before
(
ctx
context
.
Context
,
itemInfo
*
RenderDistributionOrderReq
)
(
res
*
RenderDistributionOrderRes
,
err
error
)
{
func
(
s
*
orderTm
)
Before
(
ctx
context
.
Context
,
itemInfo
*
RenderDistributionOrderReq
)
(
res
*
RenderDistributionOrderRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
...
@@ -250,13 +268,12 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
...
@@ -250,13 +268,12 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
}
}
var
itemInfoLists
[]
*
link
.
RenderDistributionOrderRequestItemInfoLists
var
itemInfoLists
[]
*
link
.
RenderDistributionOrderRequestItemInfoLists
err
=
gjson
.
New
(
itemInfo
.
ItemInfoLists
)
.
Scan
(
&
itemInfoLists
)
err
=
gjson
.
New
(
itemInfo
.
ItemInfoLists
)
.
Scan
(
&
itemInfoLists
)
result
,
err
:=
client
.
RenderDistributionOrder
(
&
link
.
RenderDistributionOrderRequest
{
result
,
err
:=
client
.
RenderDistributionOrder
(
&
link
.
RenderDistributionOrderRequest
{
BuyerId
:
tea
.
String
(
itemInfo
.
BuyerId
),
BuyerId
:
tea
.
String
(
itemInfo
.
BuyerId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
ItemInfoLists
:
itemInfoLists
,
ItemInfoLists
:
itemInfoLists
,
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
DeliveryAddress
:
tea
.
String
(
gjson
.
New
(
itemInfo
.
Addr
)
.
MustToJsonString
()
),
DeliveryAddress
:
tea
.
String
(
itemInfo
.
Addr
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -266,11 +283,14 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
...
@@ -266,11 +283,14 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
_
=
gjson
.
NewWithOptions
(
result
.
Body
,
gjson
.
Options
{
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
StrNumber
:
true
,
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
})
.
Scan
(
&
res
)
return
}
return
return
}
}
//订单列表
//订单列表
func
(
s
*
orderTm
)
List
(
ctx
context
.
Context
,
item
*
OrderListReq
)
(
res
*
OrderListRes
,
err
error
)
{
func
(
s
*
orderTm
)
List
(
ctx
context
.
Context
,
item
*
OrderListReq
)
(
res
*
OrderListRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
...
@@ -296,7 +316,7 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
...
@@ -296,7 +316,7 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
return
return
}
}
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
)
}
}
return
return
...
@@ -322,7 +342,7 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
...
@@ -322,7 +342,7 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
BuyerId
:
tea
.
String
(
item
.
UserId
),
BuyerId
:
tea
.
String
(
item
.
UserId
),
ItemInfoLists
:
itemInfoLists
,
ItemInfoLists
:
itemInfoLists
,
DeliveryAddress
:
tea
.
String
(
gjson
.
New
(
item
.
Address
)
.
MustToJsonString
()
),
DeliveryAddress
:
tea
.
String
(
item
.
Address
),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
@@ -331,7 +351,6 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
...
@@ -331,7 +351,6 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
return
return
}
}
...
@@ -344,7 +363,6 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
...
@@ -344,7 +363,6 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
g
.
Dump
(
item
.
MainDistributionOrderId
,
"item.MainDistributionOrderId"
)
result
,
err
:=
client
.
QueryOrderDetail4Distribution
(
&
link
.
QueryOrderDetail4DistributionRequest
{
result
,
err
:=
client
.
QueryOrderDetail4Distribution
(
&
link
.
QueryOrderDetail4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
...
@@ -358,7 +376,10 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
...
@@ -358,7 +376,10 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
}
return
return
}
}
...
@@ -384,9 +405,41 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
...
@@ -384,9 +405,41 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
}
return
}
//地址
func
(
s
*
orderTm
)
AddrInfo
(
ctx
context
.
Context
,
itemInfo
*
AddrInfoReq
)
(
res
*
AddrInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
return
}
result
,
err
:=
client
.
QueryChildDivisionCodeById
(
&
link
.
QueryChildDivisionCodeByIdRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DivisionCode
:
tea
.
String
(
itemInfo
.
DivisionCode
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
err
!=
nil
{
return
}
if
result
==
nil
{
return
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
}
return
return
}
}
//订单详情
//订单详情
...
...
upstream/tmNew/tm_refund.go
浏览文件 @
332950b1
...
@@ -5,7 +5,6 @@ import (
...
@@ -5,7 +5,6 @@ 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,6 +112,7 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
...
@@ -113,6 +112,7 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
@@ -120,7 +120,8 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
...
@@ -120,7 +120,8 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
...
@@ -140,7 +141,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
...
@@ -140,7 +141,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
ApplyReasonTextId
:
tea
.
Int64
(
req
.
ApplyReasonTextId
),
ApplyReasonTextId
:
tea
.
Int64
(
req
.
ApplyReasonTextId
),
ApplyRefundCount
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
ApplyRefundCount
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
ApplyRefundFee
:
tea
.
Int64
(
req
.
ApplyRefundFee
),
ApplyRefundFee
:
tea
.
Int64
(
req
.
ApplyRefundFee
),
BizClaimType
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
BizClaimType
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
BizClaimType
)),
//gconv.Int32(req.BizClaimType)
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
GoodsStatus
:
tea
.
Int32
(
req
.
GoodsStatus
),
GoodsStatus
:
tea
.
Int32
(
req
.
GoodsStatus
),
//LeaveMessage: tea.String("测试退款"),
//LeaveMessage: tea.String("测试退款"),
...
@@ -155,7 +156,8 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
...
@@ -155,7 +156,8 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
...
@@ -221,7 +223,8 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
...
@@ -221,7 +223,8 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
...
@@ -249,7 +252,8 @@ func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId s
...
@@ -249,7 +252,8 @@ func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId s
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
err
=
gjson
.
New
(
result
.
Body
)
.
Scan
(
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
...
@@ -274,9 +278,7 @@ func (s *refundTm) Detail(ctx context.Context,subOrderId string) (res *RefundInf
...
@@ -274,9 +278,7 @@ func (s *refundTm) Detail(ctx context.Context,subOrderId string) (res *RefundInf
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
:=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
panic
(
err
)
}
return
return
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论