Files
bl/modules/config/model/monster_refresh.go
昔念 026689f3ed ```
feat(cache): 添加复合键缓存操作支持

添加了基于 uint32+string 组合键的缓存操作方法,包括
GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和
ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景

fix(vscode): 添加 cSpell 配置支持 struc 词汇

refactor(session): 移除过时的会话管理方法

移除了基于单一字符串键的会话管理方法,因为已迁移到使用
复合键的缓存操作方式
```
2026-01-19 18:51:56 +08:00

56 lines
2.3 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 (
TableNameMonsterRefresh = "config_monster_refresh" // 怪物刷新规则表(地图-精灵等级-刷新脚本配置)
)
// MonsterRefresh 怪物刷新规则模型(对应前端配置的地图/精灵/等级/脚本配置)
type MonsterRefresh struct {
*cool.Model // 嵌入通用Model包含ID/创建时间/更新时间等通用字段)
MapID int32 `gorm:"not null;comment:'地图ID'" json:"map_id"`
MonsterID string `gorm:"not null;comment:'精灵ID,填0为填充数组'" json:"monster_id"`
MinLevel int32 `gorm:"not null;comment:'精灵最低等级'" json:"min_level"`
MaxLevel int32 `gorm:"not null;comment:'精灵最高等级'" json:"max_level"`
FixPos int32 `gorm:"not null;comment:'固定位置刷新0:随机位置,没有固定位置的时候就会取一个随机位置,如果没有随机位置就不刷新1-9:固定位置)'" json:"fix_pos"`
Script string `gorm:"type:text;not null;comment:'刷新脚本JS格式对应前端编辑器配置'" json:"value"`
// 以下为原模型保留的异色相关字段(前端暂未配置,如需移除可删除)
ShinyID string `gorm:"not null;comment:'异色唯一标识ID'" json:"shiny_id"`
// ShinyFilter string `gorm:"type:text;not null;comment:'异色滤镜效果(文本描述或配置参数)'" json:"shiny_filter"`
// ShinyEffect string `gorm:"type:text;not null;comment:'异色光效效果(文本描述或配置参数)'" json:"shiny_effect"`
// TODO: 增加ruffle的显示异色效果如需保留则完善无需则删除
}
type MonsterRefreshEX struct {
MonsterRefresh
MonsterID []uint32 `json:"monster_id"`
ShinyID []uint32 `json:"shiny_id"`
}
// TableName 指定MonsterRefresh对应的数据库表名
func (*MonsterRefresh) TableName() string {
return TableNameMonsterRefresh
}
// GroupName 指定表所属的分组(保持和参考示例一致)
func (*MonsterRefresh) GroupName() string {
return "default"
}
// NewMonsterRefresh 创建一个新的MonsterRefresh实例初始化通用Model
func NewMonsterRefresh() *MonsterRefresh {
return &MonsterRefresh{
Model: cool.NewModel(),
}
}
// init 初始化表结构(程序启动时自动创建/同步表)
func init() {
cool.CreateTable(&MonsterRefresh{})
}