```
feat(room): 更新房间宠物展示逻辑并优化数据结构 - 修改 `OnGetRoomPetShowInfo` 方法,使用 `pet.PetShortInfo` 替代原有的 `room.PetShowInfo` 结构体 - 引入 `github.com/jinzhu/copier` 实现结构体字段自动复制 - 调整 `SET_Pet` 接口实现逻辑以支持批量设置展示中的宠物 - 更新 `PetRoomListOutboundInfo` 中 Pets 字段类型为 `[]pet.PetShortInfo` - 将 `RoomService.Show` 方法参数由单个 uint32 改为切片 []uint32 以支持多宠物展示 - 修改数据库表名常量 `TableNameBaseHouse` 从 "base_house" 更名为 "room_house
This commit is contained in:
@@ -2,6 +2,7 @@ package room
|
||||
|
||||
import (
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/pet"
|
||||
"blazing/modules/blazing/model"
|
||||
)
|
||||
|
||||
@@ -12,6 +13,7 @@ type FitmentUseringInboundInfo struct {
|
||||
TargetUserID uint32 `json:"targetUserId"`
|
||||
}
|
||||
type SET_FITMENT struct {
|
||||
Head common.TomeeHeader `cmd:"10008" struc:"skip"` //玩家登录
|
||||
// RoomID 房间ID
|
||||
// 特殊规则:怀旧服官服固定为1,新服与用户ID(userid)相同
|
||||
RoomID uint32 `json:"roomID"`
|
||||
@@ -34,13 +36,10 @@ type FitmentUseringOutboundInfo struct {
|
||||
}
|
||||
|
||||
// PetShowInfo 宠物展示信息
|
||||
type PetShowInfo struct {
|
||||
TypeId uint32 // 精灵类型ID
|
||||
CatchTime uint32 // 精灵生成时间
|
||||
}
|
||||
|
||||
type PetRoomListOutboundInfo struct {
|
||||
PetsLen uint32 `json:"petsLen" struc:"sizeof=Pets"`
|
||||
Pets []PetShowInfo `json:"pets"`
|
||||
PetsLen uint32 `json:"petsLen" struc:"sizeof=Pets"`
|
||||
Pets []pet.PetShortInfo `json:"pets"`
|
||||
}
|
||||
|
||||
type PetRoomListInboundInfo struct {
|
||||
|
||||
Reference in New Issue
Block a user