Files
Go-Web-Template/server/model/app/app_asset_transaction.go
2026-04-23 15:29:07 +08:00

36 lines
1.4 KiB
Go

package app
import "time"
type AppAssetType string
const (
AppAssetTypeAccount AppAssetType = "account"
AppAssetTypeGameCoin AppAssetType = "game_coin"
)
type AppRechargeType string
const (
AppRechargeTypeOffline AppRechargeType = "offline"
AppRechargeTypeOnlineNotArrived AppRechargeType = "online_not_arrived"
AppRechargeTypeActivitySubsidy AppRechargeType = "activity_subsidy"
AppRechargeTypeManualAdjustment AppRechargeType = "manual_adjustment"
)
// AppAssetTransaction 玩家资产流水(金额单位:厘)
type AppAssetTransaction struct {
ID uint `json:"id" gorm:"primaryKey"`
AppUserID uint `json:"appUserId" gorm:"index;not null"`
AssetType AppAssetType `json:"assetType" gorm:"type:varchar(16);index;not null"`
RechargeType AppRechargeType `json:"rechargeType" gorm:"type:varchar(32);index;not null;default:'manual_adjustment'"`
DeltaLi int64 `json:"deltaLi" gorm:"not null;comment:变动(厘)"`
BeforeLi int64 `json:"beforeLi" gorm:"not null"`
AfterLi int64 `json:"afterLi" gorm:"not null"`
Reason string `json:"reason" gorm:"size:255;not null"`
OperatorUserID uint `json:"operatorUserId" gorm:"index;not null;comment:后台操作人ID"`
CreatedAt time.Time `json:"createdAt"`
}
func (AppAssetTransaction) TableName() string { return "app_asset_transactions" }