Files
bl/modules/blazing/model/soul_orb.go
昔念 3298bad0f2 refactor(blazing): 重构登录模块并移除示例代码
- 重构了登录控制器和登录服务,使用了cool框架的控制器和服务结构
- 移除了注册相关代码和不必要的示例代码
- 更新了登录服务,关联了服务器列表模型
- 删除了与示例相关的模型和服务文件
2025-06-28 16:16:28 +08:00

57 lines
2.6 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 TableNameSoulOrb = "soul_orb"
// SoulOrb mapped from table <soul_orb>
type SoulOrb struct {
*cool.Model
PlayerID uint64 `gorm:"not null;index:idx_soul_orb_by_player_id;comment:'所属玩家ID'" json:"player_id"`
ItemID int64 `gorm:"not null;comment:'对应物品ID'" json:"item_id"`
ObtainTime int64 `gorm:"not null;comment:'捕获时间(时间戳)'" json:"obtain_time"`
StartHatchTime string `gorm:"comment:'开始孵化时间'" json:"start_hatch_time"`
HatchTime int32 `gorm:"not null;default:0;comment:'剩余孵化时间(秒)'" json:"hatch_time"`
PetTypeID int32 `gorm:"not null;comment:'精灵类型ID/精灵图鉴ID'" json:"pet_type_id"`
IndividualValue int16 `gorm:"not null;comment:'个体值(DV)'" json:"individual_value"`
Nature int16 `gorm:"not null;comment:'性格类型'" json:"nature"`
AbilityTypeEnum int16 `gorm:"comment:'特性枚举'" json:"ability_type_enum"`
IsShiny int32 `gorm:"not null;default:0;comment:'是否为闪光宠物(1=是0=否)'" json:"is_shiny"`
Level int16 `gorm:"not null;default:1;comment:'当前等级'" json:"level"`
CurrentExp int32 `gorm:"not null;default:0;comment:'当前等级已获得经验值'" json:"current_exp"`
EvHP int16 `gorm:"not null;default:0;comment:'生命值学习力'" json:"ev_hp"`
EvAttack int16 `gorm:"not null;default:0;comment:'攻击学习力'" json:"ev_attack"`
EvDefense int16 `gorm:"not null;default:0;comment:'防御学习力'" json:"ev_defense"`
EvSpecialAttack int16 `gorm:"not null;default:0;comment:'特殊攻击学习力'" json:"ev_special_attack"`
EvSpecialDefense int16 `gorm:"not null;default:0;comment:'特殊防御学习力'" json:"ev_special_defense"`
EvSpeed int16 `gorm:"not null;default:0;comment:'速度学习力'" json:"ev_speed"`
Skill1ID int32 `gorm:"not null;default:0;comment:'技能1'" json:"skill_1_id"`
Skill2ID int32 `gorm:"not null;default:0;comment:'技能2'" json:"skill_2_id"`
Skill3ID int32 `gorm:"not null;default:0;comment:'技能3'" json:"skill_3_id"`
Skill4ID int32 `gorm:"not null;default:0;comment:'技能4'" json:"skill_4_id"`
}
// TableName SoulOrb's table name
func (*SoulOrb) TableName() string {
return TableNameSoulOrb
}
// GroupName SoulOrb's table group
func (*SoulOrb) GroupName() string {
return "default"
}
// NewSoulOrb create a new SoulOrb
func NewSoulOrb() *SoulOrb {
return &SoulOrb{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&SoulOrb{})
}