feat: 添加战胜规则配置模块
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
This commit is contained in:
39
modules/config/model/fight_rule.go
Normal file
39
modules/config/model/fight_rule.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
)
|
||||
|
||||
// 表名常量
|
||||
const TableNameFightRule = "config_fight_rule"
|
||||
|
||||
// FightRule 战胜规则配置表
|
||||
// 对应 rule 包中 Rule300-Rule316 的配置参数
|
||||
type FightRule struct {
|
||||
*cool.Model // 嵌入基础Model(包含主键、创建/更新时间等通用字段)
|
||||
|
||||
RuleIdx uint32 `gorm:"not null;uniqueIndex:idx_rule_idx;comment:'规则索引(300-316)'" json:"rule_idx"`
|
||||
Args []int `gorm:"type:jsonb;comment:'规则参数(JSON数组,对应RuleBase.args)'" json:"args"`
|
||||
Desc string `gorm:"type:varchar(255);default:'';comment:'规则描述'" json:"desc"`
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (*FightRule) TableName() string {
|
||||
return TableNameFightRule
|
||||
}
|
||||
|
||||
// GroupName 指定表分组
|
||||
func (*FightRule) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewFightRule 创建战胜规则表实例
|
||||
func NewFightRule() *FightRule {
|
||||
return &FightRule{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
cool.CreateTable(&FightRule{})
|
||||
}
|
||||
@@ -53,7 +53,7 @@ type MapNode struct {
|
||||
//完成后的脚本回调,比如战胜和击败绑定不同的任务ID,以及剧情绑定不同的ID
|
||||
//回调通boss打完给前端发送固定事件
|
||||
//PlotFinishScript string `gorm:"type:text;comment:'剧情完成后脚本回调'" json:"plot_finish_script" description:"剧情完成后脚本回调"`
|
||||
|
||||
Rule []uint32 `gorm:"type:jsonb; ;comment:'战胜规则'" json:"rule"`
|
||||
BossIds []uint32 `gorm:"type:jsonb; ;comment:'塔层BOSS ID列表'" json:"boss_ids"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user