Files
bl/logic/controller/user_info.go
昔念 502d497dce ```
refactor(controller): 重构控制器函数命名和代码注释

- 重命名 EGG 函数为 EggGamePlay,更新宠物生成逻辑
- 重命名 Leiyi 函数为 GetLeiyiTrainStatus
- 重命名 Cacthpet 函数为 CatchPet,添加详细函数注释
- 为 ArenaSetOwner、ArenaFightOwner、ArenaGetInfo、ArenaUpfight、ArenaOwnerAcce
  等擂台相关函数添加注释前缀
- 重命名 PETKing 函数为 PetKing
- 重命名 FRESH_CHOICE_FIGHT_LEVEL 函数为 FreshChoiceFightLevel,添加详细参数说明
- 重命名 BuyMItem 函数为 BuyMultipleItems
- 重命名 ITEM_S
2025-12-24 19:03:11 +08:00

51 lines
1.7 KiB
Go

package controller
import (
"blazing/common/socket/errorcode"
"blazing/logic/service/item"
"blazing/logic/service/player"
"blazing/logic/service/user"
"github.com/jinzhu/copier"
)
// UserSimInfo 根据用户ID获取模拟用户信息
// data: 包含用户ID的输入信息
// c: 玩家对象
// GetUserSimInfo 返回: 模拟用户信息及错误码
func (h Controller) GetUserSimInfo(data *user.SimUserInfoInboundInfo, c *player.Player) (result *user.SimUserInfoOutboundInfo, err errorcode.ErrorCode) {
ret := &user.SimUserInfoOutboundInfo{}
copier.Copy(ret, c.Service.Info.Person(data.UserId))
return ret, 0
}
// UserMoreInfo 获取用户的更多信息。
// data: 包含用户ID的输入信息。
// c: 当前玩家对象。
// GetUserMoreInfo 返回: 包含用户更多信息的输出结果和错误码。
func (h Controller) GetUserMoreInfo(data *user.MoreUserInfoInboundInfo, c *player.Player) (result *user.MoreUserInfoOutboundInfo, err errorcode.ErrorCode) {
ret := &user.MoreUserInfoOutboundInfo{}
info := c.Service.Info.Person(data.UserId)
copier.CopyWithOption(ret, info, copier.Option{IgnoreEmpty: true, DeepCopy: true})
//todo 待实现
return ret, 0
}
func (h Controller) GetPlayerGoldCount(data *item.GoldOnlineRemainInboundInfo, c *player.Player) (result *item.GoldOnlineRemainOutboundInfo, err errorcode.ErrorCode) {
return &item.GoldOnlineRemainOutboundInfo{
GoldNumber: c.User.GetGold(uint(c.Info.UserID)),
Coin: c.Info.Coins,
}, 0
}
func (h Controller) GetPlayerExp(data *item.ExpTotalRemainInboundInfo, c *player.Player) (result *item.ExpTotalRemainOutboundInfo, err errorcode.ErrorCode) {
return &item.ExpTotalRemainOutboundInfo{
TotalExp: uint32(c.Info.ExpPool),
}, 0
}