<feat>解决冲突

This commit is contained in:
Rzy 2024-08-06 17:12:18 +08:00
parent fa6b385209
commit 6cfc7c0c06
7 changed files with 17 additions and 16 deletions

View File

@ -60,7 +60,8 @@ func closeOrder() {
PrivateKey: wx.PrivateKey,
}
case common.PAY_CHANNLE_TYPE_ZFB:
ali := backend.AliPayChannel{}
var ali backend.AliPayChannel
req.PayChannel = payCommon.PAY_CHANNLE_TYPE_ZFB
_ = json.Unmarshal([]byte(orderInfo.ExtJson), &ali)
req.Ali = paymentService.AliPay{
@ -183,7 +184,7 @@ func queryOrder() {
// 更新订单状态 todo
orderUpdate := ordersmodel.Orders{
Id: orderInfo.Id,
Status: int32(status),
Status: status,
}
session := ordersmodel.GetInstance().GetDb().NewSession()

View File

@ -29,11 +29,11 @@ const (
ORDER_STATUS_FAILED = 4
ORDER_STATUS_CLOSE = 5
STATUS_ENABLE int32 = 1
STATUS_DISABLED int32 = 2
STATUS_ENABLE = 1
STATUS_DISABLED = 2
ORDER_TYPE_PAY int32 = 1
ORDER_TYPE_REFUND int32 = 2
ORDER_TYPE_PAY = 1
ORDER_TYPE_REFUND = 2
PAY_CHANNLE_TYPE_WECHAT = 1 // 支付类型: 微信
PAY_CHANNLE_TYPE_ZFB = 2 // 支付类型:支付宝
@ -57,7 +57,7 @@ var PayChannelList = map[int]string{
PAY_CHANNEL_ALIPAY_JSAPI: "支付宝JSAPI",
}
var OrderTypeList = map[int32]string{
var OrderTypeList = map[int]string{
ORDER_TYPE_PAY: "付款",
ORDER_TYPE_REFUND: "退款",
}

View File

@ -112,7 +112,7 @@ type OrderRequestLogResponse struct {
MerchantRequest string `json:"merchant_request"`
MerchantResponse string `json:"merchant_response"`
CreateTime string `json:"create_time"`
Status int32 `json:"status"`
Status int `json:"status"`
}
func (o *OrderRequestLogResponse) ResponseFromDb(db orderrequestlogmodel.OrderRequestLog) {
@ -133,7 +133,7 @@ type OrderThirdLogResponse struct {
CreateTime string `json:"create_time"`
PayCallback string `json:"pay_callback"`
Status int `json:"status"`
MerchantParam string `json:"merchant_param"`
PayParam string `json:"pay_param"`
MerchantCallback string `json:"merchant_callback"`
}
@ -142,7 +142,7 @@ func (o *OrderThirdLogResponse) ResponseFromDb(db orderthirdpaylogmodel.OrderThi
o.OrderId = db.OrderId
o.PayCallback = db.PayCallback
o.Status = db.Status
o.MerchantParam = db.MerchantParam
o.PayParam = db.PayParam
o.MerchantCallback = db.MerchantCallback
o.CreateTime = db.CreateTime.Format("2006-01-02 15:04:05")
}

View File

@ -15,7 +15,7 @@ type PayReqs struct {
ApiCommonBody
PayChannelId int64 `json:"pay_channel_id" validate:"required" label:"支付渠道"`
OutTradeNo string `json:"out_trade_no" validate:"required" label:"外侧商户订单号"`
OrderType int32 `json:"order_type" validate:"required" label:"订单类型,支付,退款"`
OrderType int `json:"order_type" validate:"required" label:"订单类型,支付,退款"`
Amount int `json:"amount" validate:"required" label:"支付金额,单位分"`
ExtJson string `json:"ext_json" label:"扩展参数"`
Desc string `json:"desc" validate:"max=100" label:"商品描述"`

View File

@ -20,7 +20,7 @@ type OrderRequestLog struct {
MerchantResponse string `xorm:"'merchant_response' JSON"`
CreateTime time.Time `xorm:"'create_time' datetime created"`
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
Status int32 `xorm:"'status' TINYINT"`
Status int `xorm:"'status' TINYINT"`
}
// 表名

View File

@ -18,14 +18,14 @@ type Orders struct {
PayChannelId int64 `xorm:"'pay_channel_id' bigint(20)"`
AppId int64 `xorm:"'app_id' bigint(20)"`
OutTreadNo string `xorm:"'out_tread_no' varchar(50)"`
OrderType int32 `xorm:"'order_type' TINYINT"`
OrderType int `xorm:"'order_type' TINYINT"`
Amount int `xorm:"'amount' int(11)"`
PayerTotal int `xorm:"'payer_total' int(11)"`
ExtJson string `xorm:"'ext_json' varchar(1024)"`
Desc string `xorm:"'desc' varchar(100)"`
CreateTime time.Time `xorm:"'create_time' datetime created"`
UpdateTime time.Time `xorm:"'update_time' timestamp updated"`
Status int32 `xorm:"'status' TINYINT"`
Status int `xorm:"'status' TINYINT"`
DeleteTime time.Time `xorm:"'delete_time' timestamp deleted"`
}

View File

@ -2,9 +2,9 @@ package types
type PayResp struct {
OrderNo int64 `json:"order_no"`
OrderType int32 `json:"out_trade_no"`
OrderType int `json:"out_trade_no"`
Amount int `json:"order_type"`
Desc string `json:"amount"`
IsNewCreate bool `json:"is_new_create"`
Status int32 `json:"status"`
Status int `json:"status"`
}