Files
bl/modules/config/model/map.go
昔念 922f7c3622
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
1
2026-02-20 21:34:27 +08:00

46 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
// 表名常量定义:地图配置表
const (
TableNameMapConfig = "config_map" // 地图配置表记录地图ID、刷野怪开关、天气开关、掉落物配置等核心信息
)
// MapConfig 地图核心配置模型(包含地图基础属性、刷怪配置、天气配置、掉落物配置)
type MapConfig struct {
*BaseConfig
// 核心字段
MapID uint32 `gorm:"not null;primaryKey;comment:'地图唯一ID主键'" json:"map_id" description:"地图ID"`
IsSpawnMonster int32 `gorm:"not null;default:0;comment:'是否开启刷怪1:开启0:关闭)'" json:"is_spawn_monster" description:"是否开启刷怪"`
//`gorm:"type:int[];comment:'副宠物IDs1,2,3'" json:"sub_pet_ids"`
WeatherType []uint32 `gorm:"type:int[];comment:'天气类型( 1-雨天2-雪天)'" json:"weather_type"`
// 掉落物配置
DropItemIds []uint32 `gorm:"type:int[];comment:'掉落物IDs" json:"drop_item_ids"`
}
// -------------------------- 核心配套方法(遵循项目规范)--------------------------
func (*MapConfig) TableName() string {
return TableNameMapConfig
}
func (*MapConfig) GroupName() string {
return "default"
}
func NewMapConfig() *MapConfig {
return &MapConfig{
BaseConfig: NewBaseConfig(),
}
}
// -------------------------- 表结构自动同步 --------------------------
func init() {
cool.CreateTable(&MapConfig{})
}