``` feat(pet): 重构宠物繁殖系统,添加蛋孵化功能

This commit is contained in:
1
2026-01-20 22:08:36 +00:00
parent cf4660fbe0
commit 5ef922278a
68 changed files with 4467 additions and 584 deletions

View File

@@ -0,0 +1,38 @@
package model
import (
"blazing/cool"
)
// 表名常量
const TableNamePlayerFriend = "player_friend"
// Friend 对应数据库表 player_cdk_log用于记录CDK兑换日志
type Friend struct {
Base
PlayerID uint64 `gorm:"not null;index:idx_player_friend_by_player_id;comment:'所属玩家ID'" json:"player_id"`
Friend []uint32 `gorm:"type:jsonb; comment:'好友列表'" json:"friend"`
Black []uint32 `gorm:"type:jsonb; comment:'黑名单列表'" json:"black"`
}
// TableName 返回表名
func (*Friend) TableName() string {
return TableNamePlayerFriend
}
// GroupName 返回表组名
func (*Friend) GroupName() string {
return "default"
}
// NewFriend 创建一个新的CDK记录
func NewFriend() *Friend {
return &Friend{
Base: *NewBase(),
}
}
// init 程序启动时自动创建表
func init() {
cool.CreateTable(&Friend{})
}