添加下单接口

This commit is contained in:
邹宗楠
2022-06-27 15:36:47 +08:00
parent 1eb31e2b92
commit 1400845af3
6 changed files with 266 additions and 11 deletions

View File

@@ -0,0 +1,80 @@
package model
import "git.rosy.net.cn/jx-callback/business/model/dao"
type UserVendorOrder struct {
ModelIDCUL
UserId string `orm:"size(128);column(user_id);index" json:"userID"` // 用户ID
LocalWayBill string `orm:"size(128);column(local_way_bill);index" json:"localWayBill"` // 本地订单ID
OtherWayBill string `orm:"size(128);column(other_way_bill);index" json:"otherWayBill"` // 第三方运单ID
Goods string `orm:"column(goods)" json:"goods"` // 商品名称
GuaranteeValueAmount float64 `orm:"column(guarantee_value_amount)" json:"guaranteeValueAmount"` // 保价金额
Weight int `orm:"size(64);column(weight)" json:"weight"` // 重量kg
Length int `orm:"size(64);column(length)" json:"length"` // 所有包裹累计长cm
Height int `orm:"size(64);column(height)" json:"height"` // 所有包裹累计高cm
Width int `orm:"size(64);column(width)" json:"width"` // 所有包裹累计宽cm向上取整
OrderSendTime string `orm:"size(128);column(orderSendTime)" json:"orderSendTime"` // 预约时间
PackageNum int `orm:"size(128);column(package_num)" json:"packageNum"` // 包裹数量
ReceiveAddressID int64 `orm:"size(128);column(receive_address_id)" json:"receiveAddressID"` // 收件人地址ID
Remark string `orm:"size(512);column(remark)" json:"remark"` // 运单备注
SenderAddressID int64 `orm:"size(128);column(sender_address_id)" json:"senderAddressID"` // 寄件人地址ID
ThirdPlatform int `orm:"size(16);column(third_platform)" json:"thirdPlatform"` // 第三方平台-京东商家下单传3
Type int `orm:"size(8);column(type)" json:"type"` // 快递公司
PromiseTimeType int `orm:"size(8);column(promise_Time_type)" json:"promiseTimeType"` // 快递时效产品
DeliveryType int `orm:"size(8);column(delivery_type)" json:"deliveryType"` // 产品类型
ChannelFee float64 `orm:"column(channel_fee)" json:"channelFee"` // 渠道价
ServiceCharge float64 `orm:"column(service_charge)" json:"serviceCharge"` // 服务费
GuarantFee float64 `orm:"column(guarant_fee)" json:"guarantFee"` // 保价费用
OriginalFee float64 `orm:"column(original_fee)" json:"originalFee"` // 原价
Bulk float64 `orm:"column(bulk)" json:"bulk"` // 体积抛比系数
Increment float64 `orm:"column(increment)" json:"increment"` // 增值(物流)
ChannelType int `orm:"size(8);column(channel_type)" json:"channelType"` // 渠道类型1-快递2-物流3-国际物流4-整车)
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(1-待支付2-支付失败3-支付成功4-取件5-配送6-4-取消)
Img string `orm:"text;column(img)" json:"img"` // 包裹图片
}
func (*UserVendorOrder) TableUnique() [][]string {
return [][]string{
[]string{"LocalWayBill", "DeletedAt"},
[]string{"OtherWayBill", "DeletedAt"},
[]string{"CreatedAt", "DeletedAt"},
}
}
func (u *UserVendorOrder) CreateVendorOrder() error {
return dao.CreateEntity(dao.GetDB(), u)
}
// MakeOrderParamReq 下订单请求参数
type MakeOrderParamReq struct {
PromiseTimeType int `json:"promiseTimeType"` // 快递时效产品
DeliveryType int `json:"deliveryType"` // 产品类型
Goods string `json:"goods"` // 商品名称
GuaranteeValueAmount float64 `json:"guaranteeValueAmount"` // 保价金额
Weight int `json:"weight"` // 重量kg
Length int `json:"length"` // 所有包裹累计长cm
Height int `json:"height"` // 所有包裹累计高cm
Width int `json:"width"` // 所有包裹累计宽cm向上取整
OrderSendTime string `json:"orderSendTime"` // 预约时间
PackageNum int `json:"packageNum"` // 包裹数量
ReceiveAddressId int64 `json:"receiveAddressId"` // 收件人ID
ReceiveAddress string `json:"receiveAddress"` // 收件人地址
ReceiveName string `json:"receiveName"` // 收件人姓名
ReceivePhone string `json:"receivePhone"` // 收件人手机号
Remark string `json:"remark"` // 运单备注
SenderAddressID int64 `json:"senderAddressId"` // 寄件人地址Id
SenderAddress string `json:"senderAddress"` // 寄件人地址
SenderName string `json:"senderName"` // 寄件人姓名
SenderPhone string `json:"senderPhone"` // 寄件人手机号
ThirdPlatform int `json:"thirdPlatform"` // 第三方平台-京东商家下单传3
Type int `json:"type"` // 快递公司
ChannelType int `json:"channelType"` // 渠道类型1-快递2-物流3-国际物流4-整车)
Img string `json:"img"` // 包裹图片
// 快递费
ChannelFee float64 `json:"channel_fee"` // 渠道价
Bulk float64 `json:"bulk"` // 体积抛比系数
ServiceCharge float64 `json:"service_charge"` // 服务费
GuarantFee float64 `json:"guarant_fee"` // 保价费用
OriginalFee float64 `json:"original_fee"` // 原价
Increment float64 `json:"increment"` // 物流
}