Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
3cd6891a
提交
3cd6891a
authored
6月 28, 2025
作者:
屈传平
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://120.27.146.32:8888/stbz/library
上级
43809888
1655a3ed
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
86 行增加
和
32 行删除
+86
-32
hcw.go
upstream/hcw/hcw.go
+1
-1
hcw_addesss.go
upstream/hcw/hcw_addesss.go
+44
-0
hcw_order.go
upstream/hcw/hcw_order.go
+41
-31
没有找到文件。
upstream/hcw/hcw.go
浏览文件 @
3cd6891a
...
...
@@ -165,7 +165,7 @@ func (s *HcwClient) post(ctx context.Context, method string, req interface{}) (r
Url
:=
s
.
Config
.
ApiUrl
+
method
Request
:=
g
.
Client
()
Request
.
SetHeader
(
"Content-Type"
,
"
text/xml; charset=utf-8
"
)
Request
.
SetHeader
(
"Content-Type"
,
"
application/json
"
)
Request
.
SetHeader
(
"Format"
,
"json"
)
Request
.
SetHeader
(
"signature"
,
signature
)
...
...
upstream/hcw/hcw_addesss.go
0 → 100644
浏览文件 @
3cd6891a
package
hcw
import
(
"context"
"github.com/gogf/gf/encoding/gjson"
)
type
AddressParseReq
struct
{
// 京东区域ID
AreaID
string
`json:"area_id"`
// 京东区域名称
AreaName
string
`json:"area_name"`
// 京东市区ID
CityID
string
`json:"city_id"`
// 京东市区名称
CityName
string
`json:"city_name"`
// 京东省份ID
ProvinceID
string
`json:"province_id"`
// 京东省份名称
ProvinceName
string
`json:"province_name"`
// 渠道来源(meide美的,aux奥克斯,myx美云销,mb美邦,hair海尔,skyworth创维,konka康佳)
Source
string
`json:"source"`
}
type
AddressParseRes
struct
{
Id
int
`json:"id"`
Code
string
`json:"code"`
Parent
string
`json:"parent"`
Source
string
`json:"source"`
Level
int
`json:"level"`
Name
string
`json:"name"`
NameRaw
string
`json:"name_raw"`
FullPath
string
`json:"full_path"`
}
func
(
s
*
HcwClient
)
AddressParse
(
ctx
context
.
Context
,
req
*
AddressParseReq
)
(
res
[]
*
AddressParseRes
,
err
error
)
{
var
method
=
"/address/match"
result
,
err
:=
s
.
post
(
ctx
,
method
,
req
)
if
nil
!=
err
{
return
}
_
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
}
upstream/hcw/hcw_order.go
浏览文件 @
3cd6891a
...
...
@@ -7,30 +7,39 @@ import (
)
type
OrderCreateReq
struct
{
Order
struct
{
Id
int
`json:"id"`
ParentOrderSn
string
`json:"parent_order_sn"`
OrderSn
string
`json:"order_sn"`
ThirdOrderSn
string
`json:"third_order_sn"`
CreatedTime
string
`json:"created_time"`
OrderPrice
int
`json:"order_price"`
OrderDiscountPrice
int
`json:"order_discount_price"`
OrderFreightPrice
int
`json:"order_freight_price"`
OrderPayPrice
int
`json:"order_pay_price"`
OrderPayTime
string
`json:"order_pay_time"`
DispatchPrice
int
`json:"dispatch_price"`
OrderTotalPrice
int
`json:"order_total_price"`
Remark
string
`json:"remark"`
RealName
string
`json:"real_name"`
Mobile
string
`json:"mobile"`
Provice
string
`json:"provice"`
City
string
`json:"city"`
District
string
`json:"district"`
Street
string
`json:"street"`
Address
string
`json:"address"`
ProvinceId
int
`json:"province_id"`
CityId
int
`json:"city_id"`
DistrictId
int
`json:"district_id"`
StreetId
int
`json:"street_id"`
SupplyType
string
`json:"supply_type"`
}
`json:"order"`
OrderGoodsDetail
[]
*
OrderGoodsDetailList
`json:"order_goods_detail"`
OrderRemark
string
`json:"order_remark"`
Source
string
`json:"source"`
Address
*
OrderAddress
`json:"address"`
Goods
*
OrderGoods
`json:"goods"`
}
type
OrderGoods
struct
{
Id
int
`json:"goods_id"`
//商品ID
Num
int
`json:"goods_num"`
//商品购买数量
BuyPrice
int
`json:"goods_buy_price"`
//商品购买价格
PayPrice
string
`json:"goods_pay_price"`
//商品支付价格
GoodsPrice
int
`json:"goods_goods_price"`
//商品单价
SkuNo
string
`json:"goods_sku_no"`
//商品sku
}
type
OrderAddress
struct
{
Name
string
`json:"receive_name"`
//收货人名称
Mobile
string
`json:"receive_mobile"`
//收货人手机
ProvinceName
string
`json:"receive_provice_name"`
//收货人省份
CityName
string
`json:"receive_city_name"`
//收货人城市
DistrictName
string
`json:"receive_district_name"`
//收货人区
StreetName
string
`json:"receive_street_name"`
//收货人街道
Address
string
`json:"receive_address"`
//收货人具体地址
ProvinceId
string
`json:"receive_province_id"`
//收货人省份ID
CityId
string
`json:"receive_city_id"`
//收货人城市ID
DistrictId
string
`json:"receive_area_id"`
//收货人区ID
StreetId
string
`json:"receive_street_id"`
//收货人街道ID
}
type
OrderGoodsDetailList
struct
{
...
...
@@ -51,7 +60,7 @@ type OrderCreateRes struct {
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
Order
Id
int
`json:"order_id
"`
Order
Sn
string
`json:"order_sn
"`
}
`json:"data"`
}
...
...
@@ -184,17 +193,18 @@ func (s *HcwClient) OrderDetail(ctx context.Context, orderSn string) (res *Order
}
type
OrderCheckReq
struct
{
GoodsId
int
`json:"goods_id"`
BuyNum
int
`json:"buy_num"`
SupplyType
string
`json:"supply_type"`
GoodsNo
string
`json:"goods_no"`
SkuNo
string
`json:"sku_no"`
BuyNum
string
`json:"buy_num"`
Source
string
`json:"source"`
ProvinceID
string
`json:"province_id"`
CityID
string
`json:"city_id"`
AreaID
string
`json:"area_id"`
}
type
OrderCheckRes
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
OrderId
int
`json:"order_id"`
}
`json:"data"`
}
func
(
s
*
HcwClient
)
OrderCheck
(
ctx
context
.
Context
,
req
*
OrderCheckReq
)
(
res
*
OrderCheckRes
,
err
error
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论