Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
cc6df0ea
提交
cc6df0ea
authored
6月 20, 2025
作者:
屈传平
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hcw
上级
b3599bd1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
16 行删除
+16
-16
hcw.go
upstream/hcw/hcw.go
+8
-8
hcw_goods.go
upstream/hcw/hcw_goods.go
+2
-2
hcw_order.go
upstream/hcw/hcw_order.go
+4
-4
hcw_refund.go
upstream/hcw/hcw_refund.go
+2
-2
没有找到文件。
upstream/hcw/hcw.go
浏览文件 @
cc6df0ea
...
...
@@ -30,14 +30,14 @@ type Config struct {
ApiUrl
string
}
type
h
cwClient
struct
{
type
H
cwClient
struct
{
Config
*
Config
}
func
New
(
req
*
Config
)
*
h
cwClient
{
HcwClient
:=
new
(
h
cwClient
)
H
cwClient
.
Config
=
req
return
H
cwClient
func
New
(
req
*
Config
)
*
H
cwClient
{
hcwClient
:=
new
(
H
cwClient
)
h
cwClient
.
Config
=
req
return
h
cwClient
}
//const (
...
...
@@ -50,7 +50,7 @@ type EncryptedResponse struct {
Signature
string
`json:"signature"`
}
func
(
s
*
h
cwClient
)
EncryptWithSignature
(
data
interface
{})
(
string
,
error
)
{
func
(
s
*
H
cwClient
)
EncryptWithSignature
(
data
interface
{})
(
string
,
error
)
{
// 生成时间戳
timestamp
:=
time
.
Now
()
.
Unix
()
...
...
@@ -152,7 +152,7 @@ func mapToSortedQuery(params map[string]string) string {
return
builder
.
String
()
}
func
(
s
*
h
cwClient
)
post
(
ctx
context
.
Context
,
method
string
,
req
interface
{})
(
res
string
,
err
error
)
{
func
(
s
*
H
cwClient
)
post
(
ctx
context
.
Context
,
method
string
,
req
interface
{})
(
res
string
,
err
error
)
{
Start
:=
gtime
.
TimestampMilli
()
reqMap
:=
gconv
.
Map
(
req
)
...
...
@@ -184,7 +184,7 @@ func (s *hcwClient) post(ctx context.Context, method string, req interface{}) (r
return
}
func
(
s
*
h
cwClient
)
get
(
ctx
context
.
Context
,
method
string
,
req
interface
{})
(
res
string
,
err
error
)
{
func
(
s
*
H
cwClient
)
get
(
ctx
context
.
Context
,
method
string
,
req
interface
{})
(
res
string
,
err
error
)
{
Start
:=
gtime
.
TimestampMilli
()
reqMap
:=
gconv
.
Map
(
req
)
param
:=
gjson
.
New
(
reqMap
)
...
...
upstream/hcw/hcw_goods.go
浏览文件 @
cc6df0ea
...
...
@@ -38,7 +38,7 @@ type GoodsListRes struct {
}
// 商品列表
func
(
s
*
h
cwClient
)
GoodsList
(
ctx
context
.
Context
,
req
*
GoodsListReq
)
(
res
*
GoodsListRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
GoodsList
(
ctx
context
.
Context
,
req
*
GoodsListReq
)
(
res
*
GoodsListRes
,
err
error
)
{
var
method
=
"/api/v1/product"
result
,
err
:=
s
.
get
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
@@ -75,7 +75,7 @@ type GoodsDetailRes struct {
}
// 商品详情
func
(
s
*
h
cwClient
)
GoodsDetail
(
ctx
context
.
Context
,
productSn
,
source
string
)
(
res
*
GoodsDetailRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
GoodsDetail
(
ctx
context
.
Context
,
productSn
,
source
string
)
(
res
*
GoodsDetailRes
,
err
error
)
{
var
method
=
"/api/v1/product/"
+
productSn
req
:=
&
GoodsDetailReq
{}
req
.
Source
=
source
...
...
upstream/hcw/hcw_order.go
浏览文件 @
cc6df0ea
...
...
@@ -55,7 +55,7 @@ type OrderCreateRes struct {
}
`json:"data"`
}
func
(
s
*
h
cwClient
)
OrderCreate
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderCreate
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
var
method
=
"/api/v1/order"
result
,
err
:=
s
.
post
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
@@ -99,7 +99,7 @@ type OrderListRes struct {
}
`json:"data"`
}
func
(
s
*
h
cwClient
)
OrderList
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderListRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderList
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderListRes
,
err
error
)
{
var
method
=
"/api/v1/order"
result
,
err
:=
s
.
get
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
@@ -173,7 +173,7 @@ type OrderDetailRes struct {
}
`json:"data"`
}
func
(
s
*
h
cwClient
)
OrderDetail
(
ctx
context
.
Context
,
orderSn
string
)
(
res
*
OrderDetailRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderDetail
(
ctx
context
.
Context
,
orderSn
string
)
(
res
*
OrderDetailRes
,
err
error
)
{
var
method
=
"/api/v1/order/"
+
orderSn
result
,
err
:=
s
.
get
(
ctx
,
method
,
g
.
Map
{})
if
nil
!=
err
{
...
...
@@ -197,7 +197,7 @@ type OrderCheckRes struct {
}
`json:"data"`
}
func
(
s
*
h
cwClient
)
OrderCheck
(
ctx
context
.
Context
,
req
*
OrderCheckReq
)
(
res
*
OrderCheckRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderCheck
(
ctx
context
.
Context
,
req
*
OrderCheckReq
)
(
res
*
OrderCheckRes
,
err
error
)
{
var
method
=
"/api/v1/order/check"
result
,
err
:=
s
.
post
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
upstream/hcw/hcw_refund.go
浏览文件 @
cc6df0ea
...
...
@@ -24,7 +24,7 @@ type RefundCreateReq struct {
type
RefundCreateRes
struct
{
}
func
(
s
*
h
cwClient
)
OrderRefundCreate
(
ctx
context
.
Context
,
req
*
RefundCreateReq
)
(
res
*
RefundCreateRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderRefundCreate
(
ctx
context
.
Context
,
req
*
RefundCreateReq
)
(
res
*
RefundCreateRes
,
err
error
)
{
var
method
=
"/api/v1/orderRefund"
result
,
err
:=
s
.
post
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
@@ -42,7 +42,7 @@ type RefundDetailReq struct {
type
RefundDetailRes
struct
{
}
func
(
s
*
h
cwClient
)
OrderRefundDetail
(
ctx
context
.
Context
,
req
*
RefundDetailReq
)
(
res
*
RefundDetailRes
,
err
error
)
{
func
(
s
*
H
cwClient
)
OrderRefundDetail
(
ctx
context
.
Context
,
req
*
RefundDetailReq
)
(
res
*
RefundDetailRes
,
err
error
)
{
var
method
=
"/api/v1/orderRefund"
result
,
err
:=
s
.
get
(
ctx
,
method
,
req
)
if
nil
!=
err
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论