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