mysql

package
v0.0.0-...-63414f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPaymentDB

func NewPaymentDB(client *gorm.DB) repository.PaymentDB

Types

type PaymentLedger

type PaymentLedger struct {
	ID                        int64           `gorm:"primaryKey;autoIncrement;comment:支付退款的唯一标识"`
	OrderID                   int64           `gorm:"size:64;not null;comment:关联的商户订单号"`
	UserID                    int64           `gorm:"not null;comment:用户的唯一标识"`
	RefundAmount              decimal.Decimal `gorm:"type:decimal(15,4);not null;comment:退款金额,单位为元"`
	RefundReason              string          `gorm:"size:255;comment:退款原因"`
	Status                    int64           `gorm:"not null;default:0;comment:退款状态:0-待处理,1-处理中,2-成功退款,3-退款失败"`
	MaskedCreditCardNumber    string          `gorm:"size:19;comment:信用卡号(仅存储掩码,如 **** **** **** 1234)"`
	CreditCardExpirationYear  int64           `gorm:"comment:信用卡到期年"`
	CreditCardExpirationMonth int64           `gorm:"comment:信用卡到期月"`
	CreatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;comment:退款申请时间"`
	UpdatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:退款最后更新时间"`
	DeletedAt                 gorm.DeletedAt  `gorm:"index;comment:退款记录删除时间"`
}

PaymentLedger 流水信息表

func (PaymentLedger) TableName

func (PaymentLedger) TableName() string

type PaymentOrder

type PaymentOrder struct {
	ID                        int64           `gorm:"primaryKey;autoIncrement;comment:支付订单的唯一标识"`
	OrderID                   int64           `gorm:"not null;comment:商户订单号"`
	UserID                    int64           `gorm:"not null;comment:用户的唯一标识"`
	Amount                    decimal.Decimal `gorm:"type:decimal(14,4);not null;comment:订单总金额"`
	Status                    int64           `gorm:"not null;default:0;comment:支付状态:0-待支付,1-处理中,2-成功支付,3-支付失败"`
	MaskedCreditCardNumber    string          `gorm:"size:19;comment:信用卡号(仅存储掩码,如 **** **** **** 1234)"`
	CreditCardExpirationYear  int64           `gorm:"comment:信用卡到期年"`
	CreditCardExpirationMonth int64           `gorm:"comment:信用卡到期月"`
	Description               string          `gorm:"size:255;comment:订单描述信息"`
	CreatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;comment:订单创建时间"`
	UpdatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:订单最后更新时间"`
	DeletedAt                 gorm.DeletedAt  `gorm:"index;comment:订单删除时间"`
}

PaymentOrder 支付订单表

func ConvertToDBModel

func ConvertToDBModel(p *model.PaymentOrder) (*PaymentOrder, error)

ConvertToDBModel 转换函数

func (PaymentOrder) TableName

func (PaymentOrder) TableName() string

type PaymentRefund

type PaymentRefund struct {
	ID                        int64           `gorm:"primaryKey;autoIncrement;comment:支付退款的唯一标识"`
	OrderID                   int64           `gorm:"size:64;not null;comment:关联的商户订单号"`
	UserID                    int64           `gorm:"not null;comment:用户的唯一标识"`
	RefundAmount              decimal.Decimal `gorm:"type:decimal(15,4);not null;comment:退款金额,单位为元"`
	RefundReason              string          `gorm:"size:255;comment:退款原因"`
	Status                    int64           `gorm:"not null;default:0;comment:退款状态:0-待处理,1-处理中,2-成功退款,3-退款失败"`
	MaskedCreditCardNumber    string          `gorm:"size:19;comment:信用卡号(仅存储掩码,如 **** **** **** 1234)"`
	CreditCardExpirationYear  int64           `gorm:"comment:信用卡到期年"`
	CreditCardExpirationMonth int64           `gorm:"comment:信用卡到期月"`
	CreatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;comment:退款申请时间"`
	UpdatedAt                 time.Time       `gorm:"not null;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:退款最后更新时间"`
	DeletedAt                 gorm.DeletedAt  `gorm:"index;comment:退款记录删除时间"`
}

PaymentRefund 退款表

func ConvertRefundToDBModel

func ConvertRefundToDBModel(p *model.PaymentRefund) (*PaymentRefund, error)

ConvertRefundToDBModel 转换函数

func (PaymentRefund) TableName

func (PaymentRefund) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL