添加蜂鸟配送
This commit is contained in:
@@ -7,8 +7,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
TokenURL = "https://open-anubis.ele.me/anubis-webapi/openapi/token"
|
||||
ApiURL = "https://open-anubis.ele.me/anubis-webapi/v3/invoke/"
|
||||
//TokenURL = "https://open-anubis.ele.me/anubis-webapi/openapi/token" // 正式环境
|
||||
//ApiURL = "https://open-anubis.ele.me/anubis-webapi/v3/invoke"// 正式环境
|
||||
TokenURL = "https://exam-anubis.ele.me/anubis-webapi/openapi/token" // 沙箱环境
|
||||
ApiURL = "https://exam-anubis.ele.me/anubis-webapi/v3/invoke" // 沙箱环境
|
||||
RequestPost = "POST"
|
||||
RequestGet = "GET"
|
||||
)
|
||||
@@ -43,10 +45,11 @@ type BaseInfo struct {
|
||||
|
||||
// 获取token
|
||||
type TokenInfo struct {
|
||||
Sign string `json:"sign"` //返回值签名,详见开放平台侧返回值签名算法
|
||||
Code string `json:"code"` //错误码,详见开放平台侧错误码映射表
|
||||
Msg string `json:"msg"` //错误信息
|
||||
BusinessData string `json:"business_data"` // string
|
||||
Sign string `json:"sign"` //返回值签名,详见开放平台侧返回值签名算法
|
||||
Code string `json:"code"` //错误码,详见开放平台侧错误码映射表
|
||||
Msg string `json:"msg"` //错误信息
|
||||
BusinessData string `json:"business_data"` // string
|
||||
BusinessDataObj *BusinessData // BusinessData 对象
|
||||
}
|
||||
|
||||
type BusinessData struct {
|
||||
@@ -54,13 +57,13 @@ type BusinessData struct {
|
||||
MerchantID string `json:"merchant_id"` //商户id
|
||||
AccessToken string `json:"access_token"` //凭证token
|
||||
RefreshToken string `json:"refresh_token"` //刷新token
|
||||
ExpireIn string `json:"expire_in"` //access_token剩余有效时间,单位:秒,默认有效期是一年
|
||||
ReExpireIn string `json:"re_expire_in"` //refresh_token剩余有效时间
|
||||
ExpireIn int64 `json:"expire_in"` //access_token剩余有效时间,单位:秒,默认有效期是一年
|
||||
ReExpireIn int64 `json:"re_expire_in"` //refresh_token剩余有效时间
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//<------------------------------------门店--------------------------------------------------------------------------------------->
|
||||
//<---------------------------------------------------门店--------------------------------------------------------------------------------------->
|
||||
//#region 获取蜂鸟门店信息
|
||||
|
||||
// 获取单个门店查询
|
||||
@@ -106,26 +109,26 @@ type GetOneStoreRespData struct {
|
||||
// 更新蜂鸟门店信息
|
||||
type UpdateStoreParam struct {
|
||||
// 必填
|
||||
ChainStoreID string `json:"chain_store_id"`
|
||||
HeadShopName string `json:"head_shop_name"` // 门店主店名
|
||||
ContactPhone string `json:"contact_phone"` // 门店联系方式
|
||||
Address string `json:"address"` // 门店地址
|
||||
Longitude string `json:"longitude"` // 纬度
|
||||
Latitude string `json:"latitude"` // 门店纬度
|
||||
PositionSource string `json:"position_source"` // 经纬度来源 坐标属性:高德地图:3;目前只支持高德地图坐标
|
||||
OutShopCode string `json:"out_shop_code"` // 外部门店编码
|
||||
CategoryID string `json:"category_id"` // 门店类目
|
||||
OwnerName string `json:"owner_name"` // 门店主店名
|
||||
OwnerIDNum string `json:"owner_id_num"` // 门店拥有人身份证号
|
||||
HandheldLicencePicHash string `json:"handheld_licence_pic_hash"` // 门店拥有人手持身份证、营业执照图片
|
||||
OwnerIDPicFrontHash string `json:"owner_id_pic_front_hash"` // 身份证正面
|
||||
OwnerIDPicBackHash string `json:"owner_id_pic_back_hash"` // 身份证反面
|
||||
CreditCode string `json:"credit_code"` // 统一社会信用代码
|
||||
BusinessLicencePicHash string `json:"business_licence_pic_hash"` // 营业执照图片
|
||||
ChainStoreID string `json:"chain_store_id"`
|
||||
HeadShopName string `json:"head_shop_name"` // 门店主店名
|
||||
ContactPhone string `json:"contact_phone"` // 门店联系方式
|
||||
Address string `json:"address"` // 门店地址
|
||||
Longitude float64 `json:"longitude"` // 纬度
|
||||
Latitude float64 `json:"latitude"` // 门店纬度
|
||||
PositionSource int `json:"position_source"` // 经纬度来源 坐标属性:高德地图:3;目前只支持高德地图坐标
|
||||
OutShopCode string `json:"out_shop_code"` // 外部门店编码
|
||||
CategoryID string `json:"category_id"` // 门店类目
|
||||
OwnerName string `json:"owner_name"` // 门店主店名
|
||||
OwnerIDNum string `json:"owner_id_num"` // 门店拥有人身份证号
|
||||
HandheldLicencePicHash string `json:"handheld_licence_pic_hash"` // 门店拥有人手持身份证、营业执照图片
|
||||
OwnerIDPicFrontHash string `json:"owner_id_pic_front_hash"` // 身份证正面
|
||||
OwnerIDPicBackHash string `json:"owner_id_pic_back_hash"` // 身份证反面
|
||||
CreditCode string `json:"credit_code"` // 统一社会信用代码
|
||||
BusinessLicencePicHash string `json:"business_licence_pic_hash"` // 营业执照图片
|
||||
|
||||
// 选填
|
||||
BranchShopName string `json:"branch_shop_name"` // 门店主店名
|
||||
ChainstoreType string `json:"chainstore_type"`
|
||||
ChainstoreType int `json:"chainstore_type"`
|
||||
FoodLicensePicHash string `json:"food_license_pic_hash"` // 食品安全执照图片
|
||||
SecondMedicalEquipmentLicensePicHash string `json:"second_medical_equipment_license_pic_hash"` // 第二类医疗器械类目必传
|
||||
MedicalInstitutionLicensePicHash string `json:"medical_institution_license_pic_hash"` // 医疗机构必传
|
||||
@@ -179,11 +182,11 @@ type PreCreateOrder struct {
|
||||
OrderType int `json:"order_type"` // 订单类型(1:即时单,3:预约单)
|
||||
PositionSource int `json:"position_source"` // 经纬度来源
|
||||
ReceiverAddress string `json:"receiver_address"` // 收货人地址 文字描述
|
||||
ReceiverLongitude string `json:"receiver_longitude"` // 收货人经度
|
||||
ReceiverLatitude string `json:"receiver_latitude"` // 收货人纬度
|
||||
ReceiverLongitude float64 `json:"receiver_longitude"` // 收货人经度
|
||||
ReceiverLatitude float64 `json:"receiver_latitude"` // 收货人纬度
|
||||
GoodsTotalAmountCent int `json:"goods_total_amount_cent"` // 订单商品总金额(分)
|
||||
GoodsActualAmountCent int64 `json:"goods_actual_amount_cent"` // 订单商品客户实际支付金额
|
||||
GoodsWeight string `json:"goods_weight"` // 订单总重量(kg)
|
||||
GoodsWeight float64 `json:"goods_weight"` // 订单总重量(kg)
|
||||
GoodsCount int `json:"goods_count"` // 货物件数
|
||||
GoodsItemList []*GoodsItemsList // 货物列表
|
||||
|
||||
@@ -223,10 +226,11 @@ type GoodsItemsList struct {
|
||||
|
||||
// 蜂鸟请求预下单返回值
|
||||
type PreCreateOrderResp struct {
|
||||
Distance int64 `json:"distance"` //配送距离
|
||||
CityId int64 `json:"city_id"` // 城市id
|
||||
Time int64 `json:"time"` // 预询时间戳
|
||||
GoodsInfos []*GoodsInfos // 服务商品明细
|
||||
Distance int64 `json:"distance"` //配送距离
|
||||
CityId int64 `json:"city_id"` // 城市id
|
||||
Time int64 `json:"time"` // 预询时间戳
|
||||
GoodsInfos []*GoodsInfos `json:"goods_infos"` // 服务商品明细
|
||||
//GoodsInfos string `json:"goods_infos"` // 服务商品明细
|
||||
}
|
||||
|
||||
// 预下单商品服务明细
|
||||
@@ -279,13 +283,13 @@ type CreateOrderReqParam struct {
|
||||
GoodsItemList []*GoodsItemsList `json:"goods_item_list,omitempty"` // 货物明细
|
||||
ReceiverName string `json:"receiver_name,omitempty"` // 收货人姓名
|
||||
ReceiverPrimaryPhone string `json:"receiver_primary_phone,omitempty"` // 只支持手机号,400开头电话,座机号码以及95013开头、长度13位的虚拟电话
|
||||
OutShopCode string `json:"out_shop_code,omitempty"` // 外部门店id 当使用门店发单 out_shop_code和chain_store_id必填1个
|
||||
ChainStoreId string `json:"chain_store_id,omitempty"` // 门店id
|
||||
|
||||
// 选传参数
|
||||
TransportLongitude float64 `json:"transport_longitude,omitempty"` // 取货经度
|
||||
TransportLatitude float64 `json:"transport_latitude,omitempty"` // 取货纬度
|
||||
TransportTel string `json:"transport_tel,omitempty"` // 取货点联系人电话
|
||||
OutShopCode string `json:"out_shop_code,omitempty"` // 外部门店id 当使用门店发单 out_shop_code和chain_store_id必填1个
|
||||
ChainStoreId int64 `json:"chain_store_id,omitempty"` // 门店id
|
||||
OrderSource string `json:"order_source,omitempty"` // 饿百订单传109 商户订单来源(如饿了么、美团等)手发单/未知来源: 0 或不传 美团: 2 口碑: 4 饿了么: 6支付宝: 7 饿百: 8
|
||||
ServiceGoodsId int64 `json:"service_goods_id,omitempty"` // 服务商品id 校验预询配送费价格时 必传
|
||||
BaseGoodsId int64 `json:"base_goods_id,omitempty"` // 基础商品id 校验预询配送费价格时 必传
|
||||
@@ -323,33 +327,41 @@ type GetOrderDetailReq struct {
|
||||
|
||||
// 查询订单详情接口返回值
|
||||
type GetOrderDetailRes struct {
|
||||
OrderId int64 `json:"order_id"` // 订单id
|
||||
TrackingId int64 `json:"tracking_id"` // 运单id
|
||||
PartnerOrderCode string `json:"partner_order_code"` // 外部订单号
|
||||
SerialNumber string `json:"serial_number"` // 商家订单流水号, 方便配送骑手 到店取货, 支持数字,字母及#等常见字符. 建议填写。长度<=6。
|
||||
OrderStatus int `json:"order_status"` // 订单生成0,运单生成成功1,20:骑手接单,80:骑手到店,2:配送中,3:已完成,4:已取消,5:配送异常
|
||||
CarrierDriverId string `json:"carrier_driver_id"` // 配送员id
|
||||
CarrierDriverName string `json:"carrier_driver_name"` // 配送员姓名
|
||||
CarrierDriverPhone string `json:"carrier_driver_phone"` // 配送员电话
|
||||
EstimateArriveTime int64 `json:"estimate_arrive_time"` // 预计送达时间(毫秒)
|
||||
OvertimeCompensationCostCent int64 `json:"overtime_compensation_cost_cent"` // 时效赔付
|
||||
IfCanAddTip int `json:"if_can_add_tip"` // 是否支持添加调度费 1可以,0不可以
|
||||
OrderTipAmountCent int64 `json:"order_tip_amount_cent"` // 订单当前小费总金额 分
|
||||
DeliveryFetchPhotos []interface{} `json:"delivery_fetch_photos"` // 骑手取货照片地址
|
||||
OrderTotalAmountCent int64 `json:"order_total_amount_cent"` // 原始配送费金额(分)
|
||||
OrderActualAmountCent int64 `json:"order_actual_amount_cent"` // 订单实际配送支付总金额关注这个字段即可(分)
|
||||
PriceDetail []*struct{} `json:"price_detail"` // 配送费价格明细
|
||||
AbnormalCode string `json:"abnormal_code"` // 运单异常原因code
|
||||
AbnormalDesc string `json:"abnormal_desc"` // 运单异常原因描述
|
||||
EventLogDetails []*struct{} `json:"event_log_details"` // 运单事件节点信息
|
||||
ComplaintId int64 `json:"complaint_id"` // 投诉编号
|
||||
ComplaintReasonDesc string `json:"complaint_reason_desc"` // 投诉原因描述
|
||||
ComplaintStatus int `json:"complaint_status"` // 投诉状态 1待处理, 2成功,3失败
|
||||
ClaimId int64 `json:"claim_id"` // 索赔id
|
||||
ClaimReasonDesc string `json:"claim_reason_desc"` // 索赔原因描述
|
||||
ClaimStatus int `json:"claim_status"` // 索赔状态 1待处理, 2成功,3失败
|
||||
Temperature string `json:"temperature"` // 骑手体温
|
||||
OrderDistance float64 `json:"order_distance"` // 配送距离(米)
|
||||
OrderId int64 `json:"order_id"` // 订单id
|
||||
TrackingId int64 `json:"tracking_id"` // 运单id
|
||||
PartnerOrderCode string `json:"partner_order_code"` // 外部订单号
|
||||
SerialNumber string `json:"serial_number"` // 商家订单流水号, 方便配送骑手 到店取货, 支持数字,字母及#等常见字符. 建议填写。长度<=6。
|
||||
OrderStatus int `json:"order_status"` // 订单生成0,运单生成成功1,20:骑手接单,80:骑手到店,2:配送中,3:已完成,4:已取消,5:配送异常
|
||||
CarrierDriverId string `json:"carrier_driver_id"` // 配送员id
|
||||
CarrierDriverName string `json:"carrier_driver_name"` // 配送员姓名
|
||||
CarrierDriverPhone string `json:"carrier_driver_phone"` // 配送员电话
|
||||
EstimateArriveTime int64 `json:"estimate_arrive_time"` // 预计送达时间(毫秒)
|
||||
OvertimeCompensationCostCent int64 `json:"overtime_compensation_cost_cent"` // 时效赔付
|
||||
IfCanAddTip int `json:"if_can_add_tip"` // 是否支持添加调度费 1可以,0不可以
|
||||
OrderTipAmountCent int64 `json:"order_tip_amount_cent"` // 订单当前小费总金额 分
|
||||
DeliveryFetchPhotos []interface{} `json:"delivery_fetch_photos"` // 骑手取货照片地址
|
||||
OrderTotalAmountCent int64 `json:"order_total_amount_cent"` // 原始配送费金额(分)
|
||||
OrderActualAmountCent int64 `json:"order_actual_amount_cent"` // 订单实际配送支付总金额关注这个字段即可(分)
|
||||
PriceDetail []*PriceOpenapiDetail `json:"price_detail"` // 配送费价格明细
|
||||
AbnormalCode string `json:"abnormal_code"` // 运单异常原因code
|
||||
AbnormalDesc string `json:"abnormal_desc"` // 运单异常原因描述
|
||||
EventLogDetails []*OrderNodeInfo `json:"event_log_details"` // 运单事件节点信息
|
||||
ComplaintId int64 `json:"complaint_id"` // 投诉编号
|
||||
ComplaintReasonDesc string `json:"complaint_reason_desc"` // 投诉原因描述
|
||||
ComplaintStatus int `json:"complaint_status"` // 投诉状态 1待处理, 2成功,3失败
|
||||
ClaimId int64 `json:"claim_id"` // 索赔id
|
||||
ClaimReasonDesc string `json:"claim_reason_desc"` // 索赔原因描述
|
||||
ClaimStatus int `json:"claim_status"` // 索赔状态 1待处理, 2成功,3失败
|
||||
Temperature string `json:"temperature"` // 骑手体温
|
||||
OrderDistance float64 `json:"order_distance"` // 配送距离(米)
|
||||
}
|
||||
|
||||
// 点单详情信息,订单结点信息
|
||||
type OrderNodeInfo struct {
|
||||
OrderStatus int `json:"order_status"` // 订单状态
|
||||
OccurTime int64 `json:"occur_time"` // 时间结点
|
||||
CarrierDriverName string `json:"carrier_driver_name"` // 配送员姓名
|
||||
CarrierDriverPhone string `json:"carrier_driver_phone"` // 配送电话
|
||||
}
|
||||
|
||||
// getKnightInfo 查询骑手信息接口,参数 GetOrderDetailReq
|
||||
@@ -370,9 +382,10 @@ type GetKnightInfoRes struct {
|
||||
//另:联调环境使用加小费接口 需先使用联调工具->订单状态回调:把订单状态改为1,否则订单状态会不支持加小费
|
||||
// 添加小费
|
||||
type AddTipRes struct {
|
||||
GetOrderDetailReq
|
||||
AddTipAmountCent int64 `json:"add_tip_amount_cent"` // 小费金额分(必填)
|
||||
ThirdIndexId int64 `json:"third_index_id"` // 本次加小费唯一标识 每个订单内 不可重复, 会用来做幂等,相同third_index_id的后续请求会被忽略
|
||||
OrderId string `json:"order_id"` // 订单号 订单号和外部订单号必填1个
|
||||
PartnerOrderCode string `json:"partner_order_code"` // 外部订单号
|
||||
AddTipAmountCent int64 `json:"add_tip_amount_cent"` // 小费金额分(必填)
|
||||
ThirdIndexId int64 `json:"third_index_id"` // 本次加小费唯一标识 每个订单内 不可重复, 会用来做幂等,相同third_index_id的后续请求会被忽略
|
||||
}
|
||||
|
||||
// 业务出参 "business_data": "{\"result\":true}"
|
||||
@@ -390,6 +403,12 @@ type GetCancelReasonListRes struct {
|
||||
}
|
||||
}
|
||||
|
||||
// preCancelOrder 预取消订单接口
|
||||
type PreCancelOrderReq struct {
|
||||
GetOrderDetailReq
|
||||
OrderCancelCode int64 `json:"order_cancel_code"` // 从可用取消原因列表接口返回结果选择(必填)
|
||||
}
|
||||
|
||||
// cancelOrder 正式取消订单接口
|
||||
type CancelOrderReq struct {
|
||||
GetOrderDetailReq
|
||||
@@ -428,3 +447,5 @@ type OrderClaimSkuDto struct {
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#endregion
|
||||
|
||||
Reference in New Issue
Block a user