Files
bl/modules/base/model/base_sys_user.go
昔念 35c89215f7 ```
feat(player): 重构玩家金币系统,使用BaseSysUserService管理金币

将玩家金币逻辑从PlayerInfo中移除,改为通过BaseSysUserService进行统一管理。
新增了金币的获取与设置方法,支持以分为单位的精确计算。
调整了登录时用户服务的初始化逻辑,确保User字段正确赋值。

fix(pet): 修复宠物性格道具使用逻辑错误

更新了多个性格相关道具的处理方式,包括新增的性格转换道具范围。
修正了性格随机与指定逻辑,避免越界问题并增强可维护性。

feat(fight): 战斗初始化时恢复宠物状态

在战斗初始化阶段调用宠物治愈方法,确保战斗开始前宠物处于健康状态。

feat(admin): 调整管理员会话获取接口参数类型

修改GetPerson方法传入参数为uint32类型,提高数据一致性与安全性。

refactor(model): 移除PlayerInfo中的GoldBean字段

金币字段不再存储于PlayerInfo结构体中,转而由BaseSysUser模块统一管理。
```
2025-12-06 23:59:00 +08:00

42 lines
1.5 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 TableNameBaseSysUser = "base_sys_user"
// BaseSysUser mapped from table <base_sys_user>
type BaseSysUser struct {
*cool.Model
DepartmentID uint `gorm:"column:departmentId;type:bigint;index" json:"departmentId"` // 部门ID
Username string `gorm:"column:username;type:varchar(100);not null;Index" json:"username"` // 用户名
Password string `gorm:"column:password;type:varchar(255);not null" json:"password"` // 密码
PasswordV *int32 `gorm:"column:passwordV;type:int;not null;default:1" json:"passwordV"` // 密码版本, 作用是改完密码让原来的token失效
HeadImg *string `gorm:"column:headImg;type:varchar(255)" json:"headImg"` // 头像
Email *string `gorm:"column:email;type:varchar(255)" json:"email"` // 邮箱
Status *int32 `gorm:"column:status;not null;default:1" json:"status"` // 状态 0:禁用 1启用
GoldBean float64 `gorm:"column:goldBean;type:decimal;not null;default:0" json:"goldBean"`
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
Debug int32 `gorm:"column:debug;type:int;not null;default:0" json:"debug"` // 是否可以进入2服
}
// TableName BaseSysUser's table name
func (*BaseSysUser) TableName() string {
return TableNameBaseSysUser
}
// NewBaseSysUser 创建一个新的BaseSysUser
func NewBaseSysUser() *BaseSysUser {
return &BaseSysUser{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&BaseSysUser{})
}