parent
8ab04ca908
commit
967cc8bbfa
20 changed files with 1389 additions and 114 deletions
@ -0,0 +1,900 @@ |
||||
package common |
||||
|
||||
import ( |
||||
"encoding/json" |
||||
"fmt" |
||||
) |
||||
|
||||
// SheetRoomConfig 房间通用结构
|
||||
type SheetRoomConfig struct { |
||||
GameID int `json:"GameID" redis:"GameID" table:"game_id"` |
||||
RoomID int `json:"RoomID" redis:"RoomID" table:"room_id"` |
||||
RoomName string `json:"RoomName" redis:"RoomName" table:"room_name"` |
||||
RoomType int `json:"RoomType" redis:"RoomType" table:"room_type"` |
||||
MinPlayer int `json:"MinPlayer" redis:"MinPlayer" table:"min_players"` |
||||
MaxPlayer int `json:"MaxPlayer" redis:"MaxPlayer" table:"max_players"` |
||||
StartTime int `json:"StartTime" redis:"StartTime" table:"start_time"` |
||||
IsOpen bool `json:"IsOpen" redis:"IsOpen" table:"is_open"` |
||||
BootRecharge int `json:"BootRecharge" redis:"BootRecharge" table:"boot_recharge"` |
||||
CurrenyType CurrencyType `json:"CurrenyType" redis:"CurrenyType" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"CarryInitial" redis:"CarryInitial" table:"carry_initial_value"` |
||||
Boot int `json:"Boot" redis:"Boot" table:"boot"` |
||||
TurnTime int `json:"TurnTime" redis:"TurnTime" table:"turn_time"` |
||||
MinTakeIn int64 `json:"MinTakeIn" redis:"MinTakeIn" table:"min_buyin"` |
||||
MaxTakeIn int64 `json:"MaxTakeIn" redis:"MaxTakeIn" table:"max_buyin"` |
||||
MaxBlinds int `json:"MaxBlinds" redis:"MaxBlinds" table:"max_blinds"` |
||||
TurnLimit int `json:"TurnLimit" redis:"TurnLimit" table:"turn_limit"` |
||||
ChaalLimit int `json:"ChaalLimit" redis:"ChaalLimit" table:"chaal_limit"` |
||||
PotLimit int64 `json:"PotLimit" redis:"PotLimit" table:"pot_limit"` |
||||
IsCharge bool `json:"IsCharge" redis:"IsCharge" table:"is_charge"` |
||||
ChargeType int `json:"ChargeType" redis:"ChargeType" table:"charge_type"` |
||||
ChargeMode int `json:"ChargeMode" redis:"ChargeMode" table:"charge_mode"` |
||||
Charge int64 `json:"Charge" redis:"Charge" table:"charge"` |
||||
PlayTime int `json:"PlayTime" redis:"PlayTime" table:"playing_time"` |
||||
BetTime int `json:"BetTime" redis:"BetTime" table:"bet_time"` |
||||
LotteryTime int `json:"LotteryTime" redis:"LotteryTime" table:"lottery_time"` |
||||
BetNumAmount []int `json:"BetNumAmount" redis:"BetNumAmount" table:"betnum_amount"` |
||||
BetAmount [][]int `json:"BetAmount" redis:"BetAmount" table:"bet_amount"` |
||||
BetLimit []int64 `json:"BetLimit" redis:"BetLimit" table:"bet_limit"` |
||||
BetOdds []int `json:"BetOdds" redis:"BetOdds" table:"bet_odds"` |
||||
BetMin int64 `json:"BetMin" redis:"BetMin" table:"bet_min"` // 最低下注限制
|
||||
ChangePer []int `json:"ChangePer" redis:"ChangePer" table:"change_pr"` |
||||
} |
||||
|
||||
func (s *SheetRoomConfig) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetRoomConfig) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
type GameRoomConfig interface { |
||||
MinTake() int |
||||
MaxTake() int |
||||
Open() bool |
||||
} |
||||
|
||||
type SheetTP_Config struct { |
||||
RoomName string `gorm:"column:room_name;type:varchar(32);comment:房间名称" json:"RoomName" redis:"room_name" table:"room_name"` |
||||
RoomID int `gorm:"column:room_id;type:int(11);comment:房间id" json:"RoomID" redis:"room_id" table:"room_id"` |
||||
RoomType int `gorm:"column:room_type;type:int(11);comment:房间类型 1现金场 2练习场" json:"RoomType" redis:"room_type" table:"room_type"` |
||||
MinPlayerCount int `gorm:"column:min_players;type:int(11);comment:玩牌人数下限" json:"MinPlayerCount" redis:"min_players" table:"min_players"` |
||||
MaxPlayerCount int `gorm:"column:max_players;type:int(11);comment:玩牌人数上限" json:"MaxPlayerCount" redis:"max_players" table:"max_players"` |
||||
StartTime int `gorm:"column:start_time;type:int(11);comment:开局时长" json:"StartTime" redis:"start_time" table:"start_time"` |
||||
IsOpen bool `gorm:"column:is_open;type:int(11);comment:是否开启 0关闭 1开启" json:"IsOpen" redis:"is_open" table:"is_open"` |
||||
BootRecharge int `gorm:"column:boot_recharge;type:int(11);comment:推荐充值" json:"BootRecharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
CurrenyType CurrencyType `gorm:"column:currency_type;type:int(11);comment:货币类型 1金币 2筹码" json:"CurrenyType" json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `gorm:"column:carry_initial_value;type:int(11);comment:初始携带货币" json:"CarryInitialValue" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
Boot int `gorm:"column:boot;type:int(11);comment:底注" json:"Boot" redis:"boot" table:"boot"` |
||||
TurnTime int `gorm:"column:turn_time;type:int(11);comment:操作时长" json:"TurnTime" redis:"turn_time" table:"turn_time"` |
||||
MinTakeIn int `gorm:"column:min_buyin;type:int(11);comment:入场下限" json:"MinTakeIn" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `gorm:"column:max_buyin;type:int(11);comment:入场上限" json:"MaxTakeIn" redis:"max_buyin" table:"max_buyin"` |
||||
MaxBlinds int `gorm:"column:max_blinds;type:int(11);comment:盲注轮数" json:"MaxBlinds" redis:"max_blinds" table:"max_blinds"` |
||||
TurnLimit int `gorm:"column:turn_limit;type:int(11);comment:轮数上限" json:"TurnLimit" redis:"turn_limit" table:"turn_limit"` |
||||
ChaalLimit int `gorm:"column:chaal_limit;type:int(11);comment:加注上限" json:"ChaalLimit" redis:"chaal_limit" table:"chaal_limit"` |
||||
PotLimit int `gorm:"column:pot_limit;type:int(11);comment:奖池上限" json:"PotLimit" redis:"pot_limit" table:"pot_limit"` |
||||
IsCharge int `gorm:"column:is_charge;type:int(11);comment:是否抽水 0不抽 1抽" json:"IsCharge" redis:"is_charge" table:"is_charge"` |
||||
ChargeType int `gorm:"column:charge_type;type:int(11);comment:抽水类型 1赢家 2全体" json:"ChargeType" redis:"charge_type" table:"charge_type"` |
||||
ChargeMode int `gorm:"column:charge_mode;type:int(11);comment:抽水方式 1百分比 2固定" json:"ChargeMode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `gorm:"column:charge;type:int(11);comment:抽水金额" json:"ChargeAmount" redis:"charge" table:"charge"` |
||||
} |
||||
|
||||
func (s *SheetTP_Config) TableName() string { |
||||
return "game_teenpatti_config" |
||||
} |
||||
|
||||
func (s *SheetTP_Config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetTP_Config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetTP_Config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetTP_Config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetTP_Config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetRummy_config struct { |
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
StartTime int `json:"start_time" redis:"start_time" table:"start_time"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
Boot int `json:"boot" redis:"boot" table:"boot"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxBlinds int `json:"max_blinds" redis:"max_blinds" table:"max_blinds"` |
||||
TurnLimit int `json:"turn_limit" redis:"turn_limit" table:"turn_limit"` |
||||
ChaalLimit int `json:"chaal_limit" redis:"chaal_limit" table:"chaal_limit"` |
||||
PotLimit int `json:"pot_limit" redis:"pot_limit" table:"pot_limit"` |
||||
// TurnTime int `json:"turn_time" redis:"turn_time" table:"turn_time"`
|
||||
TouchTime int `json:"touch_time" redis:"touch_time" table:"touch_time"` |
||||
PlayTime int `json:"playing_time" redis:"playing_time" table:"playing_time"` |
||||
CarryAmount int `json:"carry_amount" redis:"carry_amount" table:"carry_amount"` |
||||
IsCharge int `json:"is_charge" redis:"is_charge" table:"is_charge"` |
||||
ChargeType int `json:"charge_type" redis:"charge_type" table:"charge_type"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
} |
||||
|
||||
func (s *SheetRummy_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetRummy_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetRummy_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetRummy_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetRummy_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetDvt_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` |
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
PKTime int `json:"pk_time" redis:"pk_time" table:"pk_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *SheetDvt_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetDvt_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetDvt_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetDvt_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetDvt_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type Sheet7up7down_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` |
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
LotteryTime int `json:"lottery_time" redis:"lottery_time" table:"lottery_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *Sheet7up7down_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *Sheet7up7down_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *Sheet7up7down_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *Sheet7up7down_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *Sheet7up7down_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetAndar_bahar_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` // 扩大100倍运算
|
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
LotteryTime int `json:"lottery_time" redis:"lottery_time" table:"lottery_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *SheetAndar_bahar_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetAndar_bahar_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetAndar_bahar_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetAndar_bahar_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetAndar_bahar_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetJhandi_Munda_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` // 房间名称
|
||||
BetOdds [][]int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` // 投注赔率
|
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` // 投注上限
|
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` // 投注金额
|
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` // 游戏id
|
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` // 计量方式
|
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` // 货币类型
|
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` // 初始携带货币
|
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` // 入场下限货币
|
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` // 入场上限货币
|
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` // 玩牌人数上限
|
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` // 推荐充值
|
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` // 投注时长
|
||||
LotteryTime int `json:"lottery_time" redis:"lottery_time" table:"lottery_time"` // 开奖时长
|
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` // 玩牌人数下限
|
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` // 房间类型
|
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` // 房间id
|
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` // 抽水方式
|
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` // 抽水金额
|
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` // 是否开启
|
||||
Dice1 int `json:"dice1" redis:"dice1" table:"dice1"` // 骰子1 概率
|
||||
Dice2 int `json:"dice2" redis:"dice2" table:"dice2"` // 骰子2 概率
|
||||
} |
||||
|
||||
func (s *SheetJhandi_Munda_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetJhandi_Munda_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetJhandi_Munda_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetJhandi_Munda_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetJhandi_Munda_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetHorse_Racing_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
// BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` // 扩大100倍运算
|
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
RacingTime int `json:"racing_time" redis:"racing_time" table:"racing_time"` |
||||
SettlementTime int `json:"settlement_time" redis:"settlement_time" table:"settlement_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *SheetHorse_Racing_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetHorse_Racing_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetHorse_Racing_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetHorse_Racing_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetHorse_Racing_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetFruit_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` // 扩大100倍运算
|
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
ChangePer []int `json:"change_pr" redis:"change_pr" table:"change_pr"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
LotteryTime int `json:"lottery_time" redis:"lottery_time" table:"lottery_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *SheetFruit_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetFruit_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetFruit_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetFruit_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetFruit_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
type SheetCar_config struct { |
||||
BetMin int64 `json:"bet_min" redis:"bet_min" table:"bet_min"` // 最低下注限制
|
||||
RoomName string `json:"room_name" redis:"room_name" table:"room_name"` |
||||
Poker []int `json:"poker" redis:"poker" table:"poker"` |
||||
BetOdds []int `json:"bet_odds" redis:"bet_odds" table:"bet_odds"` // 扩大100倍运算
|
||||
BetLimit []int64 `json:"bet_limit" redis:"bet_limit" table:"bet_limit"` |
||||
ChangePer []int `json:"change_pr" redis:"change_pr" table:"change_pr"` |
||||
BetAmount []int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
MeterageMode int `json:"meterage_mode" redis:"meterage_mode" table:"meterage_mode"` |
||||
CurrenyType CurrencyType `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
CarryInitialValue int64 `json:"carry_initial_value" redis:"carry_initial_value" table:"carry_initial_value"` |
||||
MinTakeIn int `json:"min_buyin" redis:"min_buyin" table:"min_buyin"` |
||||
MaxTakeIn int `json:"max_buyin" redis:"max_buyin" table:"max_buyin"` |
||||
MaxPlayerCount int `json:"max_players" redis:"max_players" table:"max_players"` |
||||
PokerNumber int `json:"poker_number" redis:"poker_number" table:"poker_number"` |
||||
BootRecharge int `json:"boot_recharge" redis:"boot_recharge" table:"boot_recharge"` |
||||
BetTime int `json:"bet_time" redis:"bet_time" table:"bet_time"` |
||||
LotteryTime int `json:"lottery_time" redis:"lottery_time" table:"lottery_time"` |
||||
MinPlayerCount int `json:"min_players" redis:"min_players" table:"min_players"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` |
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` |
||||
IsOpen bool `json:"is_open" redis:"is_open" table:"is_open"` |
||||
} |
||||
|
||||
func (s *SheetCar_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetCar_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
func (s *SheetCar_config) MinTake() int { |
||||
return s.MinTakeIn |
||||
} |
||||
|
||||
func (s *SheetCar_config) MaxTake() int { |
||||
return s.MaxTakeIn |
||||
} |
||||
|
||||
func (s *SheetCar_config) Open() bool { |
||||
return s.IsOpen |
||||
} |
||||
|
||||
// SheetTp_robot_ai_config
|
||||
type SheetTp_robot_ai_config struct { |
||||
RandomTime []int `json:"random_time" redis:"random_time" table:"random_time"` |
||||
ID int `json:"serial" redis:"serial" table:"serial"` |
||||
GameResult bool `json:"game_result" redis:"game_result" table:"game_result"` // 输赢
|
||||
TypeID int `json:"type_id" redis:"type_id" table:"type_id"` // 方案id
|
||||
PlayerLower int `json:"player_lower" redis:"player_lower" table:"player_lower"` |
||||
PlayerUpper int `json:"player_upper" redis:"player_upper" table:"player_upper"` |
||||
PokerType int `json:"poker_type" redis:"poker_type" table:"poker_type"` |
||||
PokerColor int `json:"poker_color" redis:"poker_color" table:"poker_color"` |
||||
Poker1Lower int `json:"poker1_lower" redis:"poker1_lower" table:"poker1_lower"` |
||||
Poker1Upper int `json:"poker1_upper" redis:"poker1_upper" table:"poker1_upper"` |
||||
Poker2Lower int `json:"poker2_lower" redis:"poker2_lower" table:"poker2_lower"` |
||||
Poker2Upper int `json:"poker2_upper" redis:"poker2_upper" table:"poker2_upper"` |
||||
Poker3Lower int `json:"poker3_lower" redis:"poker3_lower" table:"poker3_lower"` |
||||
Poker3Upper int `json:"poker3_upper" redis:"poker3_upper" table:"poker3_upper"` |
||||
JackpotLower float64 `json:"jackpot_lower" redis:"jackpot_lower" table:"jackpot_lower"` |
||||
JackpotUpper float64 `json:"jackpot_upper" redis:"jackpot_upper" table:"jackpot_upper"` |
||||
RoundLower int `json:"round_lower" redis:"round_lower" table:"round_lower"` |
||||
RoundUpper int `json:"round_upper" redis:"round_upper" table:"round_upper"` |
||||
MultiplesLower int `json:"multiples_lower" redis:"multiples_lower" table:"multiples_lower"` |
||||
MultiplesUpper int `json:"multiples_upper" redis:"multiples_upper" table:"multiples_upper"` |
||||
IfSideShow int `json:"if_side_show" redis:"if_side_show" table:"if_side_show"` |
||||
IfShow int `json:"if_show" redis:"if_show" table:"if_show"` |
||||
ActionType int `json:"action_type" redis:"action_type" table:"action_type"` |
||||
SeeStatus int `json:"see_status" redis:"see_status" table:"see_status"` |
||||
PackPr float64 `json:"pack_pr" redis:"pack_pr" table:"pack_pr"` |
||||
SeePr float64 `json:"see_pr" redis:"see_pr" table:"see_pr"` |
||||
BlindPr float64 `json:"blind_pr" redis:"blind_pr" table:"blind_pr"` |
||||
DoubleBlindPr float64 `json:"double_blind_pr" redis:"double_blind_pr" table:"double_blind_pr"` |
||||
ChaalPr float64 `json:"chaal_pr" redis:"chaal_pr" table:"chaal_pr"` |
||||
DoubleChaalPr float64 `json:"double_chaal_pr" redis:"double_chaal_pr" table:"double_chaal_pr"` |
||||
SideShowPr float64 `json:"side_show_pr" redis:"side_show_pr" table:"side_show_pr"` |
||||
BeSideShowPr float64 `json:"beside_show_pr" redis:"beside_show_pr" table:"beside_show_pr"` // 接受比牌概率
|
||||
ShowPr float64 `json:"show_pr" redis:"show_pr" table:"show_pr"` |
||||
} |
||||
|
||||
func (s *SheetTp_robot_ai_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetTp_robot_ai_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetMillionRobotConfig 百人场机器人通用结构
|
||||
type SheetMillionRobotConfig struct { |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
Group int `json:"group_number" redis:"group_number" table:"group_number"` // 分组号
|
||||
Period [][]int `json:"incoming_period" redis:"incoming_period" table:"incoming_period"` // 入局时段
|
||||
Serial int `json:"serial" redis:"serial" table:"sserial"` |
||||
LastResult int `json:"last_result" redis:"last_result" table:"last_result"` // 上局结果
|
||||
ContinuityResult []int `json:"continuity_result" redis:"continuity_result" table:"continuity_result"` // 连开局数
|
||||
// PlayerBet [][]int `json:"player_bet" redis:"player_bet" table:"player_bet"` // 玩家投注
|
||||
BetArea []int `json:"bet_region" redis:"bet_region" table:"bet_region"` // 投注区域
|
||||
BetAmount int `json:"bet_amount" redis:"bet_amount" table:"bet_amount"` // 投注额度
|
||||
BetNumber int `json:"bet_number" redis:"bet_number" table:"bet_number"` // 投注次数
|
||||
Interval int `json:"interval_duration" redis:"interval_duration" table:"interval_duration"` // 间隔时长(s)
|
||||
} |
||||
|
||||
func (s *SheetMillionRobotConfig) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetMillionRobotConfig) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetRobot_config
|
||||
type SheetRobot_config struct { |
||||
Name string `json:"name" redis:"name" table:"name"` |
||||
UID int `json:"uid" redis:"uid"` |
||||
ID int `json:"robot_uid" redis:"robot_uid" table:"robot_uid"` |
||||
Gold int64 `json:"gold" redis:"gold" table:"gold"` |
||||
Avatar int `json:"head" redis:"head" table:"head"` |
||||
Group int `json:"group_number" redis:"group_number"` |
||||
} |
||||
|
||||
func (s *SheetRobot_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetRobot_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetRobot_play_config
|
||||
type SheetRobot_play_config struct { |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` // gameID
|
||||
Group int `json:"group_number" redis:"group_number" table:"group_number"` // 分组号
|
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` // room_id
|
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` // room_type
|
||||
ID int `json:"robot_uid" redis:"robot_uid" table:"robot_uid"` // id
|
||||
IfCharge int `json:"if_charge" redis:"if_charge" table:"if_charge"` // 是否抽水
|
||||
ChargeType int `json:"charge_type" redis:"charge_type" table:"charge_type"` // 昵称
|
||||
ChargeMode int `json:"charge_mode" redis:"charge_mode" table:"charge_mode"` // 抽水方式,1百分比2固定值,0无
|
||||
ChargeAmount int `json:"charge" redis:"charge" table:"charge"` // 抽水金额
|
||||
} |
||||
|
||||
func (s *SheetRobot_play_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetRobot_play_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetWithdraw_amount_config
|
||||
type SheetWithdraw_amount_config struct { |
||||
ID int `json:"amount_id" redis:"amount_id" table:"amount_id"` // id
|
||||
Method int `json:"withdrawal_method" redis:"withdrawal_method" table:"withdrawal_method"` // 提现方式 1UPI 2Bank 3UPI+Bank
|
||||
Amount int `json:"withdrawal_amount" redis:"withdrawal_amount" table:"withdrawal_amount"` |
||||
ServiceCharge int `json:"service_charge" redis:"service_charge" table:"service_charge"` |
||||
PayGold int64 `json:"pay_gold" redis:"pay_gold" table:"pay_gold"` |
||||
ReceiptType int `json:"receipt_type" redis:"receipt_type" table:"receipt_type"` // 到账类型 1实时 2延时
|
||||
} |
||||
|
||||
func (s *SheetWithdraw_amount_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetWithdraw_amount_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetWithdraw_condition_config
|
||||
type SheetWithdraw_condition_config struct { |
||||
ID int `json:"serial" redis:"serial" table:"serial"` // id
|
||||
Type int `json:"type" redis:"type" table:"type"` // 提现类型 1免费 2额外
|
||||
WithdrawTimes int `json:"withdrawal_times" redis:"withdrawal_times" table:"withdrawal_times"` // 提现次数(天)
|
||||
Combination int `json:"combination" redis:"combination" table:"combination"` // 条件组合 1同时 2任一
|
||||
Event1 int `json:"event_1" redis:"event_1" table:"event_1"` // 1玩牌 2充值 3登录
|
||||
LiftingTimes1 int `json:"lifting_times_1" redis:"lifting_times_1" table:"lifting_times_1"` // 满足条件可提现次数
|
||||
SubClassEvent1 int `json:"subclass_event_1" redis:"subclass_event_1" table:"subclass_event_1"` // 达成事件 1金额 2次数 3局数
|
||||
Cycle1 int `json:"cycle_1" redis:"cycle_1" table:"cycle_1"` // 1天数 —1无限制 0无
|
||||
EventTarget1 int `json:"event_target_1" redis:"event_target_1" table:"event_target_1"` // 达成事件数量 -1任意 0无
|
||||
Event2 int `json:"event_2" redis:"event_2" table:"event_2"` // 1玩牌 2充值 3登录
|
||||
LiftingTimes2 int `json:"lifting_times_2" redis:"lifting_times_2" table:"lifting_times_2"` // 满足条件可提现次数
|
||||
SubClassEvent2 int `json:"subclass_event_2" redis:"subclass_event_2" table:"subclass_event_2"` // 达成事件 1金额 2次数 3局数
|
||||
Cycle2 int `json:"cycle_2" redis:"cycle_2" table:"cycle_2"` // 1天数 —1无限制 0无
|
||||
EventTarget2 int `json:"event_target_2" redis:"event_target_2" table:"event_target_2"` // 达成事件数量 -1任意 0无
|
||||
} |
||||
|
||||
func (s *SheetWithdraw_condition_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetWithdraw_condition_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetGoods_config
|
||||
type SheetGoods_config struct { |
||||
Describe string `json:"describe" redis:"describe" table:"describe"` |
||||
Name1 string `json:"goods_name_1" redis:"goods_name_1" table:"goods_name_1"` |
||||
Name2 string `json:"goods_name_2" redis:"goods_name_2" table:"goods_name_2"` |
||||
ResourcePicture string `json:"resource_picture" redis:"resource_picture" table:"resource_picture"` |
||||
ID int `json:"goods_id" redis:"goods_id" table:"goods_id"` |
||||
EffectiveTime int `json:"effective_time" redis:"effective_time" table:"effective_time"` |
||||
Type int `json:"type" redis:"type" table:"type"` |
||||
EffectiveDays int `json:"effective_days" redis:"effective_days" table:"effective_days"` |
||||
StackLimit int `json:"stack_limit" redis:"stack_limit" table:"stack_limit"` |
||||
IfStack bool `json:"if_stack" redis:"if_stack" table:"if_stack"` |
||||
IfWithdrawal bool `json:"if_withdrawal" redis:"if_withdrawal" table:"if_withdrawal"` |
||||
IfTrade bool `json:"if_trade" redis:"if_trade" table:"if_trade"` |
||||
IfDiscard bool `json:"if_discard" redis:"if_discard" table:"if_discard"` |
||||
} |
||||
|
||||
func (s *SheetGoods_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetGoods_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetReport_activity_config
|
||||
type SheetReport_activity_config struct { |
||||
Name1 string `json:"activity_name_1" redis:"activity_name_1" table:"activity_name_1"` |
||||
Name2 string `json:"activity_name_2" redis:"activity_name_2" table:"activity_name_2"` |
||||
CumulativeDay []int `json:"cumulative_day" redis:"cumulative_day" table:"cumulative_day"` |
||||
CumulativeReward [][]GoodsPair `json:"cumulative_reward" redis:"cumulative_reward" table:"cumulative_reward"` |
||||
Reward []GoodsPair `json:"reward_check" redis:"reward_check" table:"reward_check"` |
||||
Sort int `json:"sort" redis:"sort" table:"sort"` |
||||
ID int `json:"activity_id" redis:"activity_id" table:"activity_id"` |
||||
LoopNumber int `json:"loop_number" redis:"loop_number" table:"loop_number"` |
||||
SignCycle int `json:"sign_cycle" redis:"sign_cycle" table:"sign_cycle"` |
||||
CumulativeCycle int `json:"cumulative_cycle" redis:"cumulative_cycle" table:"cumulative_cycle"` |
||||
RewardNumber int `json:"reward_number" redis:"reward_number" table:"reward_number"` |
||||
IfLoop bool `json:"if_loop" redis:"if_loop" table:"if_loop"` |
||||
} |
||||
|
||||
func (s *SheetReport_activity_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetReport_activity_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetMatching_table_config
|
||||
// match_pr 匹配出现概率
|
||||
type SheetMatching_table_config struct { |
||||
WaittimeRange []int `json:"waittime_range" redis:"waittime_range" table:"waittime_range"` |
||||
PlayGold []int `json:"player_gold" redis:"player_gold" table:"player_gold"` |
||||
Quantity2 []int `json:"quantity_2" redis:"quantity_2" table:"quantity_2"` |
||||
Quantity1 []int `json:"quantity_1" redis:"quantity_1" table:"quantity_1"` |
||||
RobotRange []int `json:"robot_range" redis:"robot_range" table:"robot_range"` |
||||
EmptyPositionNumber []int `json:"empty_position_number" redis:"empty_position_number" table:"empty_position_number"` |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` |
||||
Order int `json:"match_table_order" redis:"match_table_order" table:"match_table_order"` |
||||
TableState int `json:"table_state" redis:"table_state" table:"table_state"` |
||||
ExitCondition1 int `json:"exit_condition_1" redis:"exit_condition_1" table:"exit_condition_1"` |
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` |
||||
ExitCondition2 int `json:"exit_condition_2" redis:"exit_condition_2" table:"exit_condition_2"` |
||||
RoomType int `json:"room_type" redis:"room_type" table:"room_type"` |
||||
ExitCondition3 int `json:"exit_condition_3" redis:"exit_condition_3" table:"exit_condition_3"` |
||||
Quantity3 []int `json:"quantity_3" redis:"quantity_3" table:"quantity_3"` |
||||
MatchType int `json:"type_match" redis:"type_match" table:"type_match"` |
||||
MatchPer int `json:"match_pr" redis:"match_pr" table:"match_pr"` |
||||
} |
||||
|
||||
func (s *SheetMatching_table_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetMatching_table_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetNoticeConfig mysql表结构
|
||||
type SheetNoticeConfig struct { |
||||
Id int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" redis:"id"` |
||||
SheetNotice_config |
||||
} |
||||
|
||||
func (s *SheetNoticeConfig) TableName() string { |
||||
return fmt.Sprintf("config_sheet_notice") |
||||
} |
||||
|
||||
// SheetNotice_config
|
||||
type SheetNotice_config struct { |
||||
Content2 string `json:"notice_content2" redis:"notice_content2" table:"notice_content2"` // 公告内容_2(印地语)
|
||||
Title1 string `json:"notice_title1" redis:"notice_title1" table:"notice_title1"` // 公告标题_1(英语)
|
||||
Content1 string `json:"notice_content1" redis:"notice_content1" table:"notice_content1"` // 公告内容_1(英语)
|
||||
Title2 string `json:"notice_title2" redis:"notice_title2" table:"notice_title2"` // 公告标题_2(印地语)
|
||||
Type int `json:"notice_type" redis:"notice_type" table:"notice_type"` // 公告类型 (1.紧急 2.常规)
|
||||
IsRelease int `json:"is_release" redis:"is_release" table:"is_release"` // 是否发布
|
||||
ReleaseMethod int `json:"release_method" redis:"release_method" table:"release_method"` // 发布方式
|
||||
ReleaseTime int64 `json:"release_time" redis:"release_time" table:"release_time"` // 发布时间
|
||||
IsTips int `json:"is_tips" redis:"is_tips" table:"is_tips"` // 是否提示
|
||||
Interval int `json:"interval_duration" redis:"interval_duration" table:"interval_duration"` // 间隔时常
|
||||
PushTimes int `json:"push_times" redis:"push_times" table:"push_times"` // 推送次数
|
||||
} |
||||
|
||||
func (s *SheetNotice_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetNotice_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetBroadcastConfig mysql表结构
|
||||
type SheetBroadcastConfig struct { |
||||
Id int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" redis:"id"` |
||||
Content string `json:"radio_news" redis:"radio_news" table:"radio_news"` // 广播消息
|
||||
Amount string `json:"amount" redis:"amount" table:"amount"` // 数量 eg: 111,222,333 []int 存db时需要字符串,取出来时需要转[]int
|
||||
DisplayLocation string `json:"display_location" redis:"display_location" table:"display_location"` // 展示位置 eg: 111,222,333 []int 存db时需要字符串,取出来时需要转[]int
|
||||
RadioId int `json:"radio_id" redis:"radio_id" table:"radio_id"` // 广播ID
|
||||
Event int `json:"event" redis:"event" table:"event"` // 事件
|
||||
TargetID int `json:"target_id" redis:"target_id" table:"target_id"` // 目标Id
|
||||
Type int `json:"type" redis:"type" table:"type"` // 类型
|
||||
Priority int `json:"priority" redis:"priority" table:"priority"` // 优先级
|
||||
LoopFrequency int `json:"loop_frequency" redis:"loop_frequency" table:"loop_frequency"` // 循环次数
|
||||
Interval int `json:"interval_duration" redis:"interval_duration" table:"interval_duration"` // 间隔时常
|
||||
GenerationType int `json:"generation_type" redis:"generation_type" table:"generation_type"` // 生成类型
|
||||
IsRelease int `json:"is_release" redis:"is_release" table:"is_release"` // 是否发布
|
||||
} |
||||
|
||||
func (s *SheetBroadcastConfig) TableName() string { |
||||
return fmt.Sprintf("config_sheet_broadcast") |
||||
} |
||||
|
||||
// SheetBroadcast_config
|
||||
type SheetBroadcast_config struct { |
||||
Content string `json:"radio_news" redis:"radio_news" table:"radio_news"` |
||||
Amount []int `json:"amount" redis:"amount" table:"amount"` |
||||
DisplayLocation []int `json:"display_location" redis:"display_location" table:"display_location"` |
||||
ID int `json:"radio_id" redis:"radio_id" table:"radio_id"` |
||||
Event int `json:"event" redis:"event" table:"event"` // 2登录 3连赢 4赢钱 5活动奖励
|
||||
TargetID int `json:"target_id" redis:"target_id" table:"target_id"` |
||||
Type int `json:"type" redis:"type" table:"type"` // 1玩家局数 2游戏金币 3提现金币
|
||||
Priority int `json:"priority" redis:"priority" table:"priority"` |
||||
LoopFrequency int `json:"loop_frequency" redis:"loop_frequency" table:"loop_frequency"` |
||||
Interval int `json:"interval_duration" redis:"interval_duration" table:"interval_duration"` |
||||
GenerationType int `json:"generation_type" redis:"generation_type" table:"generation_type"` |
||||
IsRelease int `json:"is_release" redis:"is_release" table:"is_release"` |
||||
} |
||||
|
||||
func (s *SheetBroadcast_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetBroadcast_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetActivity_config
|
||||
// type SheetActivity_config struct {
|
||||
// ResourcePath string `json:"resource_path" redis:"resource_path" table:"resource_path"`
|
||||
// JumpPosition string `json:"jump_position" redis:"jump_position" table:"jump_position"`
|
||||
// ID int `json:"activity_id" redis:"activity_id" table:"activity_id"`
|
||||
// Sort int `json:"sort" redis:"sort" table:"sort"`
|
||||
// Start int64 `json:"start_date" redis:"start_date" table:"start_date"`
|
||||
// End int64 `json:"end_date" redis:"end_date" table:"end_date"`
|
||||
// IsRelease int `json:"is_release" redis:"is_release" table:"is_release"`
|
||||
// ReleaseMethod int `json:"release_method" redis:"release_method" table:"release_method"`
|
||||
// ReleaseTime int64 `json:"release_time" redis:"release_time" table:"release_time"`
|
||||
// ReleasePosition int64 `json:"release_position" redis:"release_position" table:"release_position"`
|
||||
// PushFrequency int `json:"push_frequency" redis:"push_frequency" table:"push_frequency"`
|
||||
// Push bool `json:"if_push" redis:"if_push" table:"if_push"`
|
||||
// }
|
||||
|
||||
// func (s *SheetActivity_config) MarshalBinary() ([]byte, error) {
|
||||
// return json.Marshal(s)
|
||||
// }
|
||||
|
||||
// func (s *SheetActivity_config) UnmarshalBinary(data []byte) error {
|
||||
// return json.Unmarshal(data, s)
|
||||
// }
|
||||
|
||||
// Expire 判断活动是否可用
|
||||
// func (s *SheetActivity_config) IsValid() bool {
|
||||
// now := time.Now().Unix()
|
||||
// if s.IsRelease == 0 || s.Start > now || (s.End < now && s.End > 0) {
|
||||
// return false
|
||||
// }
|
||||
// return true
|
||||
// }
|
||||
|
||||
// SheetRecharge1_config
|
||||
type SheetRecharge1_config struct { |
||||
ActivityName1 string `json:"activity_name_1" redis:"activity_name_1" table:"activity_name_1"` |
||||
ActivityName2 string `json:"activity_name_2" redis:"activity_name_2" table:"activity_name_2"` |
||||
CashbackRate string `json:"cashback_rate" redis:"cashback_rate" table:"cashback_rate"` |
||||
ID int `json:"activity_id" redis:"activity_id" table:"activity_id"` |
||||
FirstRecharge int `json:"first_recharge" redis:"first_recharge" table:"first_recharge"` |
||||
GoodsID int `json:"goods_id" redis:"goods_id" table:"goods_id"` |
||||
RechargeAmount int `json:"recharge_amount" redis:"recharge_amount" table:"recharge_amount"` |
||||
Getcoins1 int `json:"getcoins_1" redis:"getcoins_1" table:"getcoins_1"` |
||||
Amount1 int `json:"amount_1" redis:"amount_1" table:"amount_1"` |
||||
Getcoins2 int `json:"getcoins_2" redis:"getcoins_2" table:"getcoins_2"` |
||||
Amount2 int `json:"amount_2" redis:"amount_2" table:"amount_2"` |
||||
CurrencyType int `json:"currency_type" redis:"currency_type" table:"currency_type"` |
||||
} |
||||
|
||||
func (s *SheetRecharge1_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetRecharge1_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetChat_config
|
||||
type SheetChat_config struct { |
||||
Type int `json:"chat_type" redis:"chat_type" table:"chat_type"` // 聊天类型
|
||||
Msg string `json:"chat_message" redis:"chat_message" table:"chat_message"` // 聊天消息
|
||||
Rate int `json:"probability" redis:"probability" table:"probability"` // 概率
|
||||
Resource string `json:"resource_path" redis:"resource_path" table:"resource_path"` // 表情资源路径
|
||||
} |
||||
|
||||
func (s *SheetChat_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetChat_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetHelp_config
|
||||
type SheetHelp_config struct { |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` // 游戏ID
|
||||
Languages int `json:"languages" redis:"languages" table:"languages"` // 聊天消息
|
||||
ContentEG string `json:"play_help_eg" redis:"play_help_eg" table:"play_help_eg"` // 玩法帮助英语
|
||||
ContentHI string `json:"play_help_hi" redis:"play_help_hi" table:"play_help_hi"` // 玩法帮助印地语
|
||||
IfDisplay bool `json:"if_display" redis:"if_display" table:"if_display"` // 是否显示
|
||||
} |
||||
|
||||
func (s *SheetHelp_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetHelp_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// SheetChange_config 百人场机器人投注逻辑
|
||||
type SheetChange_config struct { |
||||
GameID int `json:"game_id" redis:"game_id" table:"game_id"` // 游戏ID
|
||||
RoomID int `json:"room_id" redis:"room_id" table:"room_id"` // 房间ID
|
||||
ChangePer []int `json:"change_pr" redis:"change_pr" table:"change_pr"` // 下注区域数量权重
|
||||
PlacePer []int `json:"place_pr" redis:"place_pr" table:"place_pr"` // 下注区域权重
|
||||
TimePer []int `json:"time_pr" redis:"time_pr" table:"time_pr"` // 下注时间分配
|
||||
} |
||||
|
||||
func (s *SheetChange_config) MarshalBinary() ([]byte, error) { |
||||
return json.Marshal(s) |
||||
} |
||||
|
||||
func (s *SheetChange_config) UnmarshalBinary(data []byte) error { |
||||
return json.Unmarshal(data, s) |
||||
} |
||||
|
||||
// GoodsPair 物品id,数量对
|
||||
type GoodsPair struct { |
||||
ID int // 物品id
|
||||
Value int64 // 数量
|
||||
Rate int // 获得概率
|
||||
} |
||||
@ -0,0 +1,127 @@ |
||||
package notice |
||||
|
||||
import ( |
||||
"server/call" |
||||
"server/common" |
||||
"server/db" |
||||
"server/modules/backend/app" |
||||
"server/modules/backend/values" |
||||
"server/natsClient" |
||||
"server/pb" |
||||
|
||||
"github.com/gin-gonic/gin" |
||||
"github.com/liangdas/mqant/log" |
||||
) |
||||
|
||||
// 添加广播
|
||||
func AddBroadcast(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.AddAddBroadcastReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
if len(req.List) <= 0 { |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err := db.Mysql().C().Model(&common.SheetBroadcastConfig{}).CreateInBatches(&req.List, len(req.List)).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeRetry |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadBroadcast}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
|
||||
// 获取广播
|
||||
func GetBroadcast(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.GetBroadcastReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
var SheetBroadcastConfig []common.SheetBroadcastConfig |
||||
_, err := db.Mysql().QueryAll("", "", &common.SheetBroadcastConfig{}, &SheetBroadcastConfig) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeRetry |
||||
return |
||||
} |
||||
|
||||
a.Data = SheetBroadcastConfig |
||||
} |
||||
|
||||
// 编辑广播
|
||||
func EditBroadcast(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.EditBroadcastReq) |
||||
if !a.S(req) { |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err := db.Mysql().C().Model(&common.SheetBroadcastConfig{}).Where("id = ?", req.Id).Updates(map[string]interface{}{ |
||||
"content": req.Broadcast.Content, |
||||
"amount": req.Broadcast.Amount, |
||||
"display_location": req.Broadcast.DisplayLocation, |
||||
"event": req.Broadcast.Event, |
||||
"radio_id": req.Broadcast.RadioId, |
||||
"target_id": req.Broadcast.TargetID, |
||||
"type": req.Broadcast.Type, |
||||
"priority": req.Broadcast.Priority, |
||||
"loop_frequency": req.Broadcast.LoopFrequency, |
||||
"interval": req.Broadcast.Interval, |
||||
"generation_type": req.Broadcast.GenerationType, |
||||
"is_release": req.Broadcast.IsRelease, |
||||
}).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadBroadcast}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
|
||||
// 删除广播
|
||||
func DeleteBroadcast(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.DeleteBroadcastReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
err := db.Mysql().C().Where("id = ?", req.Id).Unscoped().Delete(&common.SheetBroadcastConfig{}).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadBroadcast}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
@ -0,0 +1,121 @@ |
||||
package notice |
||||
|
||||
import ( |
||||
"server/call" |
||||
"server/common" |
||||
"server/db" |
||||
"server/modules/backend/app" |
||||
"server/modules/backend/values" |
||||
"server/natsClient" |
||||
"server/pb" |
||||
"time" |
||||
|
||||
"github.com/gin-gonic/gin" |
||||
"github.com/liangdas/mqant/log" |
||||
) |
||||
|
||||
// 系统公告配置
|
||||
func AddSystemNotice(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.AddSystemNoticeReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
if len(req.List) <= 0 { |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
for i := 0; i < len(req.List); i++ { |
||||
if req.List[i].ReleaseTime == 0 { |
||||
req.List[i].ReleaseTime = time.Now().Unix() |
||||
} |
||||
} |
||||
|
||||
err := db.Mysql().C().Model(&common.SheetNoticeConfig{}).CreateInBatches(&req.List, len(req.List)).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeRetry |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadNotice}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
|
||||
// 系统公告配置
|
||||
func GetSystemNotice(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.GetSystemNoticeReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
var SheetNoticeConfig []common.SheetNoticeConfig |
||||
_, err := db.Mysql().QueryAll("", "", &common.SheetNoticeConfig{}, &SheetNoticeConfig) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeRetry |
||||
return |
||||
} |
||||
|
||||
a.Data = SheetNoticeConfig |
||||
} |
||||
|
||||
// 编辑系统公告
|
||||
func EditSystemNotice(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.EditSystemNoticeReq) |
||||
if !a.S(req) { |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err := db.Mysql().C().Where("id = ?", req.Id).Save(req.Notice).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadNotice}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
|
||||
// 删除系统公告
|
||||
func DeleteSystemNotice(c *gin.Context) { |
||||
a := app.NewApp(c) |
||||
defer func() { |
||||
a.Response() |
||||
}() |
||||
req := new(values.DeleteSystemNoticeReq) |
||||
if !a.S(req) { |
||||
return |
||||
} |
||||
|
||||
err := db.Mysql().C().Where("id = ?", req.Id).Unscoped().Delete(&common.SheetNoticeConfig{}).Error |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
a.Code = values.CodeParam |
||||
return |
||||
} |
||||
|
||||
err = call.Publish(natsClient.TopicReloadConfig, &pb.ReloadGameConfig{Type: common.ReloadNotice}) |
||||
if err != nil { |
||||
log.Error(err.Error()) |
||||
} |
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
package routers |
||||
|
||||
import ( |
||||
handler "server/modules/backend/handler/notice" |
||||
|
||||
"github.com/gin-gonic/gin" |
||||
) |
||||
|
||||
func notice(e *gin.Engine) { |
||||
// 公告请求
|
||||
e.POST("/sys/notice/add", handler.AddSystemNotice) |
||||
e.POST("/sys/notice/get", handler.GetSystemNotice) |
||||
e.POST("/sys/notice/edit", handler.EditSystemNotice) |
||||
e.POST("/sys/notice/delete", handler.DeleteSystemNotice) |
||||
|
||||
// 广播请求
|
||||
e.POST("/sys/broadcast/add", handler.AddBroadcast) |
||||
e.POST("/sys/broadcast/get", handler.GetBroadcast) |
||||
e.POST("/sys/broadcast/edit", handler.EditBroadcast) |
||||
e.POST("/sys/broadcast/delete", handler.DeleteBroadcast) |
||||
} |
||||
@ -0,0 +1,48 @@ |
||||
package values |
||||
|
||||
import "server/common" |
||||
|
||||
// AddSystemNoticeReq 添加系统公告
|
||||
type AddSystemNoticeReq struct { |
||||
List []common.SheetNoticeConfig |
||||
} |
||||
|
||||
// GetSystemNoticeReq 获取系统公告
|
||||
type GetSystemNoticeReq struct { |
||||
} |
||||
|
||||
// GetSystemNoticeResp 获取系统公告
|
||||
type GetSystemNoticeResp struct { |
||||
List []common.SheetNoticeConfig |
||||
} |
||||
|
||||
// EditSystemNoticeReq 编辑公告
|
||||
type EditSystemNoticeReq struct { |
||||
Id int64 `json:"Id" binding:"required"` |
||||
Notice common.SheetNoticeConfig |
||||
} |
||||
|
||||
// DeleteSystemNoticeReq 删除公告
|
||||
type DeleteSystemNoticeReq struct { |
||||
Id int64 `json:"Id" binding:"required"` // 公告id
|
||||
} |
||||
|
||||
// AddAddBroadcastReq 添加广播
|
||||
type AddAddBroadcastReq struct { |
||||
List []common.SheetBroadcastConfig |
||||
} |
||||
|
||||
// GetBroadcastReq 获取广播
|
||||
type GetBroadcastReq struct { |
||||
} |
||||
|
||||
// EditBroadcastReq 编辑广播
|
||||
type EditBroadcastReq struct { |
||||
Id int64 `json:"Id" binding:"required"` |
||||
Broadcast common.SheetBroadcastConfig |
||||
} |
||||
|
||||
// DeleteBroadcastReq 删除广播
|
||||
type DeleteBroadcastReq struct { |
||||
Id int64 `json:"Id" binding:"required"` // id
|
||||
} |
||||
Loading…
Reference in new issue