2026-01-02 04:11:37 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
2026-04-01 02:48:09 +08:00
|
|
|
TableNameRarePetTowerConfig = "config_tower_1"
|
|
|
|
|
TableNamedARKTowerConfig = "config_tower_110"
|
|
|
|
|
TableNameTrialTowerConfig = "config_tower_500"
|
|
|
|
|
TableNameBraveTowerConfig = "config_tower_600"
|
2026-01-02 04:11:37 +08:00
|
|
|
)
|
|
|
|
|
|
2026-01-08 23:57:22 +08:00
|
|
|
type BaseTowerConfig struct {
|
2026-02-13 22:57:05 +08:00
|
|
|
*BaseConfig
|
2026-04-01 02:48:09 +08:00
|
|
|
Name string `gorm:"type:varchar(100);default:'';comment:'name'" json:"name" description:"name"`
|
|
|
|
|
TowerLevel uint32 `gorm:"not null;default:0;uniqueIndex;comment:'tower level'" json:"tower_level"`
|
|
|
|
|
BossIds []uint32 `gorm:"type:jsonb;comment:'boss ids'" json:"boss_ids"`
|
2026-01-08 23:57:22 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-13 22:57:05 +08:00
|
|
|
func NewBaseTowerConfig() *BaseTowerConfig {
|
|
|
|
|
return &BaseTowerConfig{
|
|
|
|
|
BaseConfig: NewBaseConfig(),
|
2026-01-08 23:57:22 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 02:48:09 +08:00
|
|
|
type Tower1Config struct {
|
|
|
|
|
*BaseTowerConfig
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-02 04:11:37 +08:00
|
|
|
type Tower110Config struct {
|
2026-02-13 22:57:05 +08:00
|
|
|
*BaseTowerConfig
|
2026-01-02 04:11:37 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-08 23:57:22 +08:00
|
|
|
type Tower500Config struct {
|
2026-02-13 22:57:05 +08:00
|
|
|
*BaseTowerConfig
|
2026-01-08 23:57:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Tower600Config struct {
|
2026-02-13 22:57:05 +08:00
|
|
|
*BaseTowerConfig
|
2026-01-08 23:57:22 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 02:48:09 +08:00
|
|
|
func (*Tower1Config) TableName() string {
|
|
|
|
|
return TableNameRarePetTowerConfig
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*Tower1Config) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New1TowerConfig() *Tower1Config {
|
|
|
|
|
return &Tower1Config{
|
|
|
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-08 23:57:22 +08:00
|
|
|
|
2026-01-02 04:11:37 +08:00
|
|
|
func (*Tower110Config) TableName() string {
|
|
|
|
|
return TableNamedARKTowerConfig
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*Tower110Config) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New110TowerConfig() *Tower110Config {
|
|
|
|
|
return &Tower110Config{
|
|
|
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-08 23:57:22 +08:00
|
|
|
func (*Tower500Config) TableName() string {
|
|
|
|
|
return TableNameTrialTowerConfig
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*Tower500Config) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New500TowerConfig() *Tower500Config {
|
|
|
|
|
return &Tower500Config{
|
|
|
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*Tower600Config) TableName() string {
|
|
|
|
|
return TableNameBraveTowerConfig
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*Tower600Config) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New600TowerConfig() *Tower600Config {
|
|
|
|
|
return &Tower600Config{
|
|
|
|
|
BaseTowerConfig: NewBaseTowerConfig(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-02 04:11:37 +08:00
|
|
|
func init() {
|
2026-04-01 02:48:09 +08:00
|
|
|
cool.CreateTable(&Tower1Config{})
|
2026-01-02 04:11:37 +08:00
|
|
|
cool.CreateTable(&Tower110Config{})
|
2026-01-08 23:57:22 +08:00
|
|
|
cool.CreateTable(&Tower500Config{})
|
|
|
|
|
cool.CreateTable(&Tower600Config{})
|
2026-01-02 04:11:37 +08:00
|
|
|
}
|