重构支付接口,以动态支持多种产品类型,整合长短效套餐的购买支付逻辑;引入 decimal 类型的金额计算;
This commit is contained in:
@@ -30,7 +30,7 @@ func newRefund(db *gorm.DB, opts ...gen.DOOption) refund {
|
||||
_refund.ID = field.NewInt32(tableName, "id")
|
||||
_refund.TradeID = field.NewInt32(tableName, "trade_id")
|
||||
_refund.ProductID = field.NewInt32(tableName, "product_id")
|
||||
_refund.Amount = field.NewFloat64(tableName, "amount")
|
||||
_refund.Amount = field.NewField(tableName, "amount")
|
||||
_refund.Reason = field.NewString(tableName, "reason")
|
||||
_refund.Status = field.NewInt32(tableName, "status")
|
||||
_refund.CreatedAt = field.NewField(tableName, "created_at")
|
||||
@@ -46,15 +46,15 @@ type refund struct {
|
||||
refundDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32 // 退款ID
|
||||
TradeID field.Int32 // 订单ID
|
||||
ProductID field.Int32 // 产品ID
|
||||
Amount field.Float64 // 退款金额
|
||||
Reason field.String // 退款原因
|
||||
Status field.Int32 // 退款状态:0-待处理,1-已退款,2-已拒绝
|
||||
CreatedAt field.Field // 创建时间
|
||||
UpdatedAt field.Field // 更新时间
|
||||
DeletedAt field.Field // 删除时间
|
||||
ID field.Int32 // 退款ID
|
||||
TradeID field.Int32 // 订单ID
|
||||
ProductID field.Int32 // 产品ID
|
||||
Amount field.Field // 退款金额
|
||||
Reason field.String // 退款原因
|
||||
Status field.Int32 // 退款状态:0-待处理,1-已退款,2-已拒绝
|
||||
CreatedAt field.Field // 创建时间
|
||||
UpdatedAt field.Field // 更新时间
|
||||
DeletedAt field.Field // 删除时间
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func (r *refund) updateTableName(table string) *refund {
|
||||
r.ID = field.NewInt32(table, "id")
|
||||
r.TradeID = field.NewInt32(table, "trade_id")
|
||||
r.ProductID = field.NewInt32(table, "product_id")
|
||||
r.Amount = field.NewFloat64(table, "amount")
|
||||
r.Amount = field.NewField(table, "amount")
|
||||
r.Reason = field.NewString(table, "reason")
|
||||
r.Status = field.NewInt32(table, "status")
|
||||
r.CreatedAt = field.NewField(table, "created_at")
|
||||
|
||||
Reference in New Issue
Block a user