feat(api): add client app service endpoints
This commit is contained in:
23
backend/api/internal/models/wallet_recharge_order.go
Normal file
23
backend/api/internal/models/wallet_recharge_order.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
"time"
|
||||
)
|
||||
|
||||
// WalletRechargeOrder 保存客户端钱包充值订单。
|
||||
type WalletRechargeOrder struct {
|
||||
Entity // 公共实体字段
|
||||
RechargeStatus int `gorm:"column:recharge_status;not null;default:10;index" json:"recharge_status"` // 充值订单状态
|
||||
WalletBasicID uint64 `gorm:"column:wallet_basic_id;not null;index" json:"wallet_basic_id"` // 钱包内部主键
|
||||
RechargeNo string `gorm:"column:recharge_no;type:varchar(64);not null;uniqueIndex" json:"recharge_no"` // 充值订单号
|
||||
RequestNo string `gorm:"column:request_no;type:varchar(128);not null;uniqueIndex" json:"request_no"` // 创建幂等号
|
||||
Amount int64 `gorm:"column:amount;not null;check:amount > 0" json:"amount"` // 充值金额,单位分
|
||||
Channel string `gorm:"column:channel;type:varchar(32);not null" json:"channel"` // 支付渠道
|
||||
OwnerType string `gorm:"column:owner_type;type:varchar(32);not null;index" json:"owner_type"` // 钱包主体类型
|
||||
OwnerIdentity string `gorm:"column:owner_identity;type:varchar(36);not null;index" json:"owner_identity"` // 钱包主体业务标识
|
||||
CompletedAt *time.Time `gorm:"column:completed_at;type:timestamptz" json:"completed_at"` // 支付完成时间
|
||||
}
|
||||
|
||||
func init() { database.AppendMigrate(&WalletRechargeOrder{}) }
|
||||
func (*WalletRechargeOrder) TableName() string { return "wallet_recharge_order" }
|
||||
Reference in New Issue
Block a user