提交 3cd6891a authored 作者: 屈传平's avatar 屈传平

Merge branch 'master' of http://120.27.146.32:8888/stbz/library

......@@ -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)
......
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
}
......@@ -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 {
OrderId int `json:"order_id"`
OrderSn 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论