Files
bl/modules/config/model/boss_pet.go
昔念 813eb4c3cd
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的提交信息模板:
```
docs(readme): 更新文档说明

- 添加了项目使用说明
- 补充了配置项解释
- 优化了文档结构
```
2026-02-24 22:10:49 +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 (
TableNameBossConfig = "config_boss" // BOSS配置表全量包含基础/奖励/护盾/捕捉/特效/世界野怪/地图费用/战斗通用逻辑)
)
// BossConfig BOSS配置模型覆盖所有补充的配置项GBTL/非VIP费用/首场景/战斗通用逻辑)
type BossConfig struct {
*cool.Model // 嵌入通用Model包含ID/创建时间/更新时间等通用字段)
PetBaseConfig
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
BossID int32 `gorm:"not null;index;comment:'所属BOSSID'" json:"boss_id" description:"BOSSID"`
Order int32 `gorm:"not null;comment:'排序'" json:"order" description:"排序"`
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
}
// TableName 指定BossConfig对应的数据库表名
func (*BossConfig) TableName() string {
return TableNameBossConfig
}
// GroupName 指定表所属的分组(保持和怪物刷新表一致)
func (*BossConfig) GroupName() string {
return "default"
}
// NewBossConfig 创建一个新的BossConfig实例初始化通用Model字段+所有默认值)
func NewBossConfig() *BossConfig {
return &BossConfig{
Model: cool.NewModel(),
}
}
// init 程序启动时自动创建/同步boss_config表结构
func init() {
cool.CreateTable(&BossConfig{})
}