You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
3.8 KiB
91 lines
3.8 KiB
package common |
|
|
|
import "fmt" |
|
|
|
const ( |
|
JackpotTypeActivity = iota + 1 |
|
JackpotTypeGame |
|
) |
|
|
|
var ( |
|
GameModulePrefix = "game" // 游戏模块名字前缀 |
|
) |
|
|
|
func GetGameModuleName(gid int) string { |
|
return fmt.Sprintf("%v%v", GameModulePrefix, gid) |
|
} |
|
|
|
// Jackpot 记录各个奖池 |
|
type Jackpot struct { |
|
ID int `gorm:"primarykey"` |
|
Type int `gorm:"column:type;not null;type:int(11);comment:类型 活动1 游戏2" json:"Type"` |
|
TypeID int `gorm:"column:type_id;not null;type:int(11);uniqueIndex:type_id;comment:奖池标记id,可以是活动id,游戏id" json:"TypeID"` |
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:奖池" json:"Amount"` |
|
Max int64 `gorm:"column:max;type:bigint(20);default:0;comment:奖池最大额度" json:"Max"` |
|
} |
|
|
|
func (j *Jackpot) TableName() string { |
|
return "jackpot" |
|
} |
|
|
|
const ( |
|
SessionTypeBet = iota + 1 |
|
SessionTypeSettle |
|
SessionTypeActivity |
|
SessionTypeAdjustment // 调整玩家余额 |
|
SessionTypeJackpot |
|
SessionTypeBonus |
|
SessionTypeBuyIn // 直接扣钱操作 |
|
SessionTypeBuyOut // 直接加钱操作 |
|
) |
|
|
|
// 提供商下单记录 |
|
type ProviderBetRecord struct { |
|
ID int `gorm:"primarykey"` |
|
UID int `gorm:"column:uid;not null;type:int(11);index:uid;comment:uid"` |
|
Provider int `gorm:"column:provider;not null;type:int(11);uniqueIndex:p_uuid;comment:供应商id"` |
|
Currency string `gorm:"column:currency;type:varchar(64);comment:货币名称"` |
|
CurrencyType CurrencyType `gorm:"column:currency_type;default:1;type:int(11);comment:货币id"` |
|
GameID int `gorm:"column:game_id;not null;type:int(11);comment:游戏id"` |
|
GameName string `gorm:"column:game_name;type:varchar(64);default:'';comment:游戏名"` |
|
UUID string `gorm:"column:uuid;type:varchar(255);uniqueIndex:p_uuid;comment:供应商唯一识别值"` |
|
SessionID string `gorm:"column:session_id;type:varchar(255);comment:牌局类型时的牌局id"` |
|
Type int `gorm:"column:type;type:bigint(20);uniqueIndex:p_uuid;comment:类型 1下注 2结算"` |
|
Time int64 `gorm:"column:time;type:bigint(20);default:0;comment:时间戳"` |
|
ProviderTime int64 `gorm:"column:provider_time;type:bigint(20);default:0;comment:厂商时间戳"` |
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:下注额"` |
|
Settle int64 `gorm:"column:settle;type:bigint(20);default:0;comment:结算额"` |
|
Preserve int64 `gorm:"column:preserve;type:bigint(20);default:0;comment:预扣款"` |
|
TurnOver int64 `gorm:"column:turnover;type:bigint(20);default:0;comment:有效投注额"` |
|
MyUUID int64 `gorm:"column:my_uuid;type:bigint(20);comment:我方唯一识别值"` |
|
Esi int64 `gorm:"column:esi;type:bigint(20);default:1;comment:额外字段"` // tada 表示本局是否已失败 2已失败,后续不再接收 |
|
Esi1 int64 `gorm:"column:esi1;type:bigint(20);default:1;comment:额外字段1"` // awc标识注单无效原因 |
|
Ess string `gorm:"column:ess;type:varchar(64);default:'';comment:额外字符串字段"` // 活动时,标识活动代码 |
|
} |
|
|
|
func (t *ProviderBetRecord) TableName() string { |
|
return "provider_bet_record" |
|
} |
|
|
|
const ( |
|
GameType = iota |
|
GameTypeInHouse |
|
GameTypeSlots |
|
GameTypeLive |
|
GameTypeTable |
|
GameTypeSpecial |
|
GameTypeESport |
|
GameTypeSportBook |
|
) |
|
|
|
type PlayerFavorite struct { |
|
Id int `gorm:"column:id;type:int(11) AUTO_INCREMENT;primary_key" json:"id"` |
|
Uid int `gorm:"column:uid;type:int(11);NOT NULL" json:"uid"` |
|
Provider int `gorm:"column:provider;type:int(11);NOT NULL" json:"provider"` |
|
GameId int `gorm:"column:game_id;type:int(11);NOT NULL" json:"game_id"` |
|
CreateAt int64 `gorm:"column:create_at;type:bigint(20);NOT NULL" json:"create_at"` |
|
} |
|
|
|
func (m *PlayerFavorite) TableName() string { |
|
return "player_favorite" |
|
}
|
|
|