Files
bl/logic/controller/pet_info_helpers.go

41 lines
970 B
Go
Raw Normal View History

package controller
import (
"blazing/logic/service/pet"
"blazing/modules/player/model"
)
func buildPetShortInfo(info model.PetInfo) pet.PetShortInfo {
return pet.PetShortInfo{
ID: info.ID,
CatchTime: info.CatchTime,
Level: info.Level,
SkinID: info.SkinID,
ShinyLen: info.ShinyLen,
ShinyInfo: info.ShinyInfo,
}
}
func buildPetListOutboundInfo(petList []model.PetInfo) *pet.GetPetListOutboundInfo {
result := &pet.GetPetListOutboundInfo{
ShortInfoList: make([]pet.PetShortInfo, len(petList)),
}
for i := range petList {
result.ShortInfoList[i] = buildPetShortInfo(petList[i])
}
return result
}
func buildPetShowOutboundInfo(userID, flag uint32, info *model.PetInfo) *pet.PetShowOutboundInfo {
return &pet.PetShowOutboundInfo{
UserID: userID,
CatchTime: info.CatchTime,
ID: info.ID,
Flag: flag,
Dv: info.Dv,
ShinyLen: info.ShinyLen,
ShinyInfo: info.ShinyInfo,
SkinID: info.SkinID,
}
}