2025-12-21 18:13:54 +00:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 表名常量定义:炫彩皮肤表
|
|
|
|
|
|
const (
|
2026-01-19 18:51:56 +08:00
|
|
|
|
TableNameColorfulSkin = "config_shiny" // 炫彩皮肤表(记录炫彩皮肤颜色、光环、绑定精灵等核心配置)
|
2025-12-21 18:13:54 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// ColorfulSkin 炫彩皮肤核心配置模型(完整保留原有字段,仅更名适配)
|
|
|
|
|
|
type ColorfulSkin struct {
|
2025-12-26 23:46:10 +08:00
|
|
|
|
*cool.Model
|
2025-12-21 18:13:54 +00:00
|
|
|
|
|
|
|
|
|
|
// 核心必填字段
|
|
|
|
|
|
Color string `gorm:"not null;default:'';comment:'炫彩皮肤颜色(唯一标识每条配置)'" json:"color" description:"炫彩皮肤颜色"`
|
|
|
|
|
|
|
|
|
|
|
|
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用(0-禁用 1-启用)'" json:"is_enabled" description:"是否启用"`
|
|
|
|
|
|
Author string `gorm:"not null;size:64;default:'';comment:'炫彩皮肤配置作者(创建人/配置者名称)'" json:"author" description:"作者"`
|
|
|
|
|
|
RefreshCount uint32 `gorm:"not null;default:0;comment:'累计刷新次数(炫彩皮肤外观刷新次数统计)'" json:"refresh_count" description:"刷新次数"`
|
|
|
|
|
|
UsageCount uint32 `gorm:"not null;default:0;comment:'累计使用次数(炫彩皮肤使用次数统计)'" json:"usage_count" description:"使用次数"`
|
2025-12-26 23:46:10 +08:00
|
|
|
|
BindElfIds []uint32 `gorm:"not null;type:jsonb;default:'[]';comment:'绑定精灵ID数组,关联config_pet_boss表主键,空数组表示未绑定具体精灵'" json:"bind_elf_ids" description:"绑定精灵数组"`
|
2025-12-21 18:13:54 +00:00
|
|
|
|
//野生精灵概率
|
|
|
|
|
|
ElfProbability uint32 `gorm:"not null;default:0;comment:'野生精灵概率(0-10000)'" json:"elf_probability" description:"野生精灵概率"`
|
2026-01-05 01:04:52 +08:00
|
|
|
|
//投票
|
|
|
|
|
|
VoteCount uint32 `gorm:"not null;default:0;comment:'投票次数'" json:"vote_count" description:"投票次数"`
|
2025-12-21 18:13:54 +00:00
|
|
|
|
|
|
|
|
|
|
// 辅助备注字段
|
|
|
|
|
|
Remark string `gorm:"size:512;default:'';comment:'炫彩皮肤备注'" json:"remark" description:"备注信息"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------- 核心配套方法(仅更名适配,逻辑不变)--------------------------
|
|
|
|
|
|
func (*ColorfulSkin) TableName() string {
|
|
|
|
|
|
return TableNameColorfulSkin
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (*ColorfulSkin) GroupName() string {
|
|
|
|
|
|
return "default"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewColorfulSkin() *ColorfulSkin {
|
|
|
|
|
|
return &ColorfulSkin{
|
|
|
|
|
|
Model: cool.NewModel(),
|
|
|
|
|
|
Color: "",
|
|
|
|
|
|
|
|
|
|
|
|
IsEnabled: 1,
|
|
|
|
|
|
Author: "",
|
|
|
|
|
|
RefreshCount: 0,
|
|
|
|
|
|
UsageCount: 0,
|
|
|
|
|
|
BindElfIds: []uint32{},
|
|
|
|
|
|
|
|
|
|
|
|
Remark: "",
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------- 表结构自动同步 --------------------------
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
cool.CreateTable(&ColorfulSkin{})
|
|
|
|
|
|
}
|