gomod引用

This commit is contained in:
2025-12-12 16:20:47 +08:00
parent 0393931e91
commit a4ba4dd715
27 changed files with 2886 additions and 87 deletions

View File

@@ -2,6 +2,8 @@ package entity
import (
"go.mongodb.org/mongo-driver/v2/bson"
"gitee.com/red-future---jilin-g/common/do"
)
// PaymentConfig 支付配置
@@ -9,12 +11,11 @@ import (
// 支持微信支付和支付宝支付
type PaymentConfig struct {
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
TenantID string `bson:"tenant_id" json:"tenant_id"` // 租户ID
PayMethod string `bson:"pay_method" json:"pay_method"` // 支付方式wechat/alipay
ConfigName string `bson:"config_name" json:"config_name"` // 配置名称
Description string `bson:"description" json:"description"` // 配置描述
Enabled bool `bson:"enabled" json:"enabled"` // 是否启用
do.MongoBaseDO `bson:",inline"`
PayMethod string `bson:"pay_method" json:"pay_method"` // 支付方式wechat/alipay
ConfigName string `bson:"config_name" json:"config_name"` // 配置名称
Description string `bson:"description" json:"description"` // 配置描述
Enabled bool `bson:"enabled" json:"enabled"` // 是否启用
// 通用配置
AppID string `bson:"app_id" json:"app_id"` // 应用ID
@@ -46,37 +47,31 @@ type PaymentConfig struct {
// 记录每次支付操作的结果
type PaymentRecord struct {
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
TenantID string `bson:"tenant_id" json:"tenant_id"` // 租户ID
OrderID bson.ObjectID `bson:"order_id" json:"order_id"` // 订单ID
OrderNo string `bson:"order_no" json:"order_no"` // 订单号
PayMethod string `bson:"pay_method" json:"pay_method"` // 支付方式
PayType string `bson:"pay_type" json:"pay_type"` // 支付类型
Amount int64 `bson:"amount" json:"amount"` // 支付金额(分)
TransactionID string `bson:"transaction_id" json:"transaction_id"` // 支付平台交易
OutTradeNo string `bson:"out_trade_no" json:"out_trade_no"` // 商户订单
TradeNo string `bson:"trade_no" json:"trade_no"` // 交易号
PrepayID string `bson:"prepay_id,omitempty" json:"prepay_id"` // 支付ID
Status string `bson:"status" json:"status"` // 支付状态success/failed
ErrorMsg string `bson:"error_msg,omitempty" json:"error_msg"` // 错误信息
CreatedAt int64 `bson:"created_at" json:"created_at"` // 创建时间
UpdatedAt int64 `bson:"updated_at" json:"updated_at"` // 更新时间
do.MongoBaseDO `bson:",inline"`
OrderID bson.ObjectID `bson:"order_id" json:"order_id"` // 订单ID
OrderNo string `bson:"order_no" json:"order_no"` // 订单
PayMethod string `bson:"pay_method" json:"pay_method"` // 支付方式
PayType string `bson:"pay_type" json:"pay_type"` // 支付类型
Amount int64 `bson:"amount" json:"amount"` // 支付金额(分)
TransactionID string `bson:"transaction_id" json:"transaction_id"` // 支付平台交易号
OutTradeNo string `bson:"out_trade_no" json:"out_trade_no"` // 商户订单
TradeNo string `bson:"trade_no" json:"trade_no"` // 交易
PrepayID string `bson:"prepay_id,omitempty" json:"prepay_id"` // 预支付ID
Status string `bson:"status" json:"status"` // 支付状态success/failed
ErrorMsg string `bson:"error_msg,omitempty" json:"error_msg"` // 错误信息
}
// RefundRecord 退款记录
// 记录每次退款操作的结果
type RefundRecord struct {
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
TenantID string `bson:"tenant_id" json:"tenant_id"` // 租户ID
OrderID bson.ObjectID `bson:"order_id" json:"order_id"` // 订单ID
OrderNo string `bson:"order_no" json:"order_no"` // 单号
RefundNo string `bson:"refund_no" json:"refund_no"` // 退款单号
RefundID string `bson:"refund_id" json:"refund_id"` // 退款ID
RefundAmount int64 `bson:"refund_amount" json:"refund_amount"` // 退款金额(分)
Reason string `bson:"reason" json:"reason"` // 退款原因
Status string `bson:"status" json:"status"` // 退款状态success/failed
ErrorMsg string `bson:"error_msg,omitempty" json:"error_msg"` // 错误信息
CreatedAt int64 `bson:"created_at" json:"created_at"` // 创建时间
UpdatedAt int64 `bson:"updated_at" json:"updated_at"` // 更新时间
do.MongoBaseDO `bson:",inline"`
OrderID bson.ObjectID `bson:"order_id" json:"order_id"` // 订单ID
OrderNo string `bson:"order_no" json:"order_no"` // 订单
RefundNo string `bson:"refund_no" json:"refund_no"` // 退款单号
RefundID string `bson:"refund_id" json:"refund_id"` // 退款ID
RefundAmount int64 `bson:"refund_amount" json:"refund_amount"` // 退款金额(分)
Reason string `bson:"reason" json:"reason"` // 退款原因
Status string `bson:"status" json:"status"` // 退款状态success/failed
ErrorMsg string `bson:"error_msg,omitempty" json:"error_msg"` // 错误信息
}