feat(pet): 修改宠物价格字段类型为uint32 统一宠物价格相关字段的数据类型,将sale_price从float32改为uint32, 以保持数据类型一致性并避免浮点数精度问题。 - 更新controller中PriseReq结构体的Price字段类型 - 修改model中Pet结构体的SalePrice字段类型 - 调整service中UPdatePrice方法的参数类型 ```
This commit is contained in:
@@ -25,11 +25,11 @@ const TableNamePet = "player_pet"
|
||||
// Pet mapped from table <pet>
|
||||
type Pet struct {
|
||||
Base
|
||||
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
IsSale int `gorm:"not null;default:0;comment:'是否出售'" json:"is_sale"`
|
||||
SalePrice float32 `gorm:"not null;default:0;comment:'出售价格'" json:"sale_price"`
|
||||
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
IsSale int `gorm:"not null;default:0;comment:'是否出售'" json:"is_sale"`
|
||||
SalePrice uint32 `gorm:"not null;default:0;comment:'出售价格'" json:"sale_price"`
|
||||
// Owner uint32 `struc:"skip"` //仅作为存储
|
||||
// FreedTime uint32 `struc:"skip"` //放生时间
|
||||
//是否可交易,这里应该定义在精灵ID里
|
||||
|
||||
Reference in New Issue
Block a user