- Added a new entry for user interaction habit analysis based on agent transcripts, summarizing key insights into communication styles and preferences. - Updated project indices to reflect the latest developments, including the addition of a wallet balance feature and enhancements to the mini program's user interface for better user experience. - Improved the handling of loading states in the chapters page, ensuring a smoother user experience during data retrieval. - Implemented a gift payment sharing feature, allowing users to share payment requests with friends for collaborative purchases.
25 lines
880 B
Go
25 lines
880 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// UserBalance 对应表 user_balances
|
|
type UserBalance struct {
|
|
UserID string `gorm:"column:user_id;primaryKey;size:50"`
|
|
Balance float64 `gorm:"column:balance;type:decimal(10,2);default:0"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at"`
|
|
}
|
|
|
|
func (UserBalance) TableName() string { return "user_balances" }
|
|
|
|
// BalanceTransaction 对应表 balance_transactions
|
|
type BalanceTransaction struct {
|
|
ID string `gorm:"column:id;primaryKey;size:50"`
|
|
UserID string `gorm:"column:user_id;size:50"`
|
|
Type string `gorm:"column:type;size:20"` // recharge, consume, refund, gift
|
|
Amount float64 `gorm:"column:amount;type:decimal(10,2)"`
|
|
OrderID *string `gorm:"column:order_id;size:50"`
|
|
CreatedAt time.Time `gorm:"column:created_at"`
|
|
}
|
|
|
|
func (BalanceTransaction) TableName() string { return "balance_transactions" }
|