根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的提交信息模板:
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
``` docs(readme): 更新文档说明 - 添加了项目使用说明 - 补充了配置项解释 - 优化了文档结构 ```
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -29,12 +29,15 @@ func init() {
|
||||
|
||||
func main() {
|
||||
// superMaps := &xmlres.MonsterRoot{}
|
||||
// err := xml.Unmarshal([]byte(gfile.GetBytes("public/config/地图配置野怪.xml")), superMaps)
|
||||
// err := xml.Unmarshal([]byte(gfile.GetBytes("help/地图配置野怪.xml")), superMaps)
|
||||
// for _, v := range superMaps.Maps {
|
||||
|
||||
// if v.Monsters != nil {
|
||||
// for _, v1 := range v.Monsters.Monsters {
|
||||
// fmt.Println(v.Name, v1.ID, "|", v1.Lv)
|
||||
// for _, v1 := range v.Bosses {
|
||||
// if strings.Index(v1.Name, "SPT") != -1 {
|
||||
// //fmt.Println(v.Name, v1)
|
||||
// g.Dump(v.Name, v1)
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ const (
|
||||
type BossConfig struct {
|
||||
*cool.Model // 嵌入通用Model(包含ID/创建时间/更新时间等通用字段)
|
||||
PetBaseConfig
|
||||
//绑定地图地图ID
|
||||
MapID []int32 `gorm:"type:int[];comment:'绑定地图地图ID'" json:"map_id"`
|
||||
*Event
|
||||
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
|
||||
// ISboss uint32 `gorm:"not null;default:0;comment:'是否是Boss'" json:"is_boss"`
|
||||
|
||||
// ISgift uint32 `gorm:"not null;default:0;comment:'是否是礼物'" json:"is_gif"`
|
||||
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对应的数据库表名
|
||||
@@ -36,7 +36,6 @@ func (*BossConfig) GroupName() string {
|
||||
func NewBossConfig() *BossConfig {
|
||||
return &BossConfig{
|
||||
Model: cool.NewModel(),
|
||||
Event: &Event{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
48
modules/config/model/map_boos.go
Normal file
48
modules/config/model/map_boos.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
)
|
||||
|
||||
const (
|
||||
TableNameMapBoss = "config_map_boss" // 地图BOSS配置表(记录BOSS归属、属性、刷新规则、奖励等)
|
||||
)
|
||||
|
||||
// MapBoss 地图BOSS核心配置模型(完全仿照MapPit实现风格)
|
||||
type MapBoss struct {
|
||||
*BaseConfig // 复用通用基础配置(ID/创建时间/更新时间/删除时间/备注等)
|
||||
*Event // 嵌入BOSS事件配置
|
||||
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
|
||||
// BOSS唯一标识ID
|
||||
BossID int `gorm:"not null;index;comment:'BOSSID'" json:"boss_id"`
|
||||
BossName string `gorm:"type:varchar(100);default:'';comment:'BOSS名称'" json:"boss_name" description:"BOSS名称"`
|
||||
BossMonID []int `gorm:"type:int[];comment:'BOSS怪ID列表'" json:"boss_mon_id"`
|
||||
|
||||
WinBonusID []int `gorm:"type:int[];comment:'胜利奖励ID'" json:"win_bonus_id"`
|
||||
FailBonusID []int `gorm:"type:int[];comment:'失败奖励ID'" json:"fail_bonus_id"`
|
||||
//是否可捕捉MapPit
|
||||
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
|
||||
}
|
||||
|
||||
// TableName 指定MapBoss对应的数据库表名(遵循原模型规范)
|
||||
func (*MapBoss) TableName() string {
|
||||
return TableNameMapBoss
|
||||
}
|
||||
|
||||
// GroupName 指定表所属的分组(保持和MapPit一致)
|
||||
func (*MapBoss) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewMapBoss 创建一个新的MapBoss实例(初始化通用BaseConfig和BossEvent)
|
||||
func NewMapBoss() *MapBoss {
|
||||
return &MapBoss{
|
||||
BaseConfig: NewBaseConfig(),
|
||||
Event: &Event{},
|
||||
}
|
||||
}
|
||||
|
||||
// init 初始化表结构(程序启动时自动创建/同步表)
|
||||
func init() {
|
||||
cool.CreateTable(&MapBoss{})
|
||||
}
|
||||
@@ -15,6 +15,7 @@ func NewBossService() *BossService {
|
||||
Model: model.NewBossConfig(),
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
KeyWordField: []string{"desc"},
|
||||
FieldEQ: []string{"boss_id", "map_id"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user