2025-12-01 23:31:48 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import "blazing/cool"
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
TableNamePetFusionMaterial = "pet_fusion_material" // 宠物融合材料表(子表)
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// PetFusionMaterial 融合材料模型(与配方主表一对一关联)
|
|
|
|
|
|
type PetFusionMaterial struct {
|
|
|
|
|
|
*cool.Model // 嵌入通用Model(ID/创建时间/更新时间等)
|
|
|
|
|
|
|
|
|
|
|
|
// 4个材料ID(对应XML ItemGroup的Idx=1-4,无材料填0)
|
2025-12-02 03:59:28 +08:00
|
|
|
|
Material1 uint32 `gorm:"not null;comment:'材料1ID(如400030)'" json:"material1"`
|
|
|
|
|
|
Material2 uint32 `gorm:"not null;comment:'材料2ID(如400030)'" json:"material2"`
|
|
|
|
|
|
Material3 uint32 `gorm:"not null;comment:'材料3ID(如400028)'" json:"material3"`
|
|
|
|
|
|
Material4 uint32 `gorm:"not null;comment:'材料4ID(如400030)'" json:"material4"`
|
2025-12-01 23:31:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 4个特性ID(对应XML MaterialGroup的特性索引,4-4对应)
|
2025-12-02 03:59:28 +08:00
|
|
|
|
Trait1Idx uint32 `gorm:"not null;comment:'特性1索引(如1008)'" json:"trait1_idx"`
|
|
|
|
|
|
Trait2Idx uint32 `gorm:"not null;comment:'特性2索引(如1018)'" json:"trait2_idx"`
|
|
|
|
|
|
Trait3Idx uint32 `gorm:"not null;comment:'特性3索引(如1023)'" json:"trait3_idx"`
|
|
|
|
|
|
Trait4Idx uint32 `gorm:"not null;comment:'特性4索引(如1031)'" json:"trait4_idx"`
|
2025-12-01 23:31:48 +08:00
|
|
|
|
|
|
|
|
|
|
IsEnable int32 `gorm:"not null;default:1;comment:'是否启用该组合(1:启用,0:禁用)'" json:"is_enable"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TableName 指定子表名
|
|
|
|
|
|
func (*PetFusionMaterial) TableName() string {
|
|
|
|
|
|
return TableNamePetFusionMaterial
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GroupName 表分组(与主表一致)
|
|
|
|
|
|
func (*PetFusionMaterial) GroupName() string {
|
|
|
|
|
|
return "default"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// NewPetFusionMaterial 创建材料实例
|
|
|
|
|
|
func NewPetFusionMaterial() *PetFusionMaterial {
|
|
|
|
|
|
return &PetFusionMaterial{
|
|
|
|
|
|
Model: cool.NewModel(),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// init 初始化子表结构
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
cool.CreateTable(&PetFusionMaterial{})
|
|
|
|
|
|
}
|