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

57 lines
3.0 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 TableNamePlayerInfo = "player_info"
// PlayerInfo mapped from table <player_info>
type PlayerInfo struct {
*cool.Model
AccountID uint64 `gorm:"not null;uniqueIndex:idx_player_info_unique_by_account_id;comment:'所属账户ID'" json:"account_id"`
Nickname string `gorm:"type:varchar(16);not null;default:'nieo';comment:'昵称'" json:"nickname"`
NieoBean int64 `gorm:"not null;default:0;comment:'尼尔豆(基础货币uint32)'" json:"nieo_bean"`
NieoGoldBean string `gorm:"type:decimal(12,2);not null;default:0;comment:'尼尔金豆(特殊货币uint32)'" json:"nieo_gold_bean"`
EquipmentHead int32 `gorm:"not null;default:0;comment:'头部穿戴装备ID(0=未穿戴)'" json:"equipment_head"`
EquipmentFace int32 `gorm:"not null;default:0;comment:'脸部穿戴装备ID'" json:"equipment_face"`
EquipmentHand int32 `gorm:"not null;default:0;comment:'手部穿戴装备ID'" json:"equipment_hand"`
EquipmentWaist int32 `gorm:"not null;default:0;comment:'腰部穿戴装备ID'" json:"equipment_waist"`
EquipmentLeg int32 `gorm:"not null;default:0;comment:'腿部穿戴装备ID'" json:"equipment_leg"`
EquipmentBackground int32 `gorm:"not null;default:0;comment:'背景穿戴装备ID'" json:"equipment_background"`
RobotColor int64 `gorm:"not null;default:0;comment:'RGB颜色值(uint32,实际为3个uint8)'" json:"robot_color"`
HasNono bool `gorm:"default:false;not null;comment:'是否拥普通NONO(布尔转TINYINT)'" json:"has_nono"`
HasSuperNono bool `gorm:"default:false;not null;comment:'是否拥超能NONO'" json:"has_super_nono"`
NonoNickname string `gorm:"type:varchar(16);not null;default:'NONO';comment:'NONO昵称(byte[16])'" json:"nono_nickname"`
NonoColor int64 `gorm:"not null;default:0;comment:'NONO颜色值'" json:"nono_color"`
ExpPool int64 `gorm:"not null;default:0;comment:'累计经验池'" json:"exp_pool"`
Pet1 int64 `gorm:"not null;default:0;comment:'背包精灵1(首发精灵),捕获时间戳'" json:"pet1"`
Pet2 int64 `gorm:"not null;default:0;comment:'背包精灵2'" json:"pet2"`
Pet3 int64 `gorm:"not null;default:0;comment:'背包精灵3'" json:"pet3"`
Pet4 int64 `gorm:"not null;default:0;comment:'背包精灵4'" json:"pet4"`
Pet5 int64 `gorm:"not null;default:0;comment:'背包精灵5'" json:"pet5"`
Pet6 int64 `gorm:"not null;default:0;comment:'背包精灵6'" json:"pet6"`
}
// TableName PlayerInfo's table name
func (*PlayerInfo) TableName() string {
return TableNamePlayerInfo
}
// GroupName PlayerInfo's table group
func (*PlayerInfo) GroupName() string {
return "default"
}
// NewPlayerInfo create a new PlayerInfo
func NewPlayerInfo() *PlayerInfo {
return &PlayerInfo{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&PlayerInfo{})
}