refactor(user): 重构用户服务相关代码,将login模块功能迁移至user模块并优化相关结构体定义

This commit is contained in:
1
2025-09-22 09:15:26 +00:00
parent 47614c4d57
commit 1b62f6fec1
9 changed files with 31 additions and 36 deletions

View File

@@ -5,25 +5,26 @@ import (
"blazing/cool"
"blazing/logic/service/common"
"blazing/logic/service/login"
"blazing/logic/service/player"
"blazing/logic/service/space"
"blazing/logic/service/user"
blservice "blazing/modules/blazing/service"
"strings"
)
// 处理命令: 1001
func (h *Controller) CreatePlayer(data *login.CreatePlayerInboundInfo, c *player.Conn) (result *login.CreatePlayerOutInfo, err errorcode.ErrorCode) {
func (h *Controller) CreatePlayer(data *user.CreatePlayerInboundInfo, c *player.Conn) (result *user.CreatePlayerOutInfo, err errorcode.ErrorCode) {
blservice.NewUserService(data.Head.UserID).Reg(cool.Filter.Replace(data.Nickname, '*'), data.Color)
return result, 0
}
func (h *Controller) ChangePlayerName(data *login.ChangePlayerNameInboundInfo, c *player.Player) (result *login.ChangePlayerNameOutboundInfo, err errorcode.ErrorCode) {
func (h *Controller) ChangePlayerName(data *user.ChangePlayerNameInboundInfo, c *player.Player) (result *user.ChangePlayerNameOutboundInfo, err errorcode.ErrorCode) {
newnice := cool.Filter.Replace(strings.Trim(data.Nickname, "\x00"), '*')
c.Info.Nick = newnice
result = &login.ChangePlayerNameOutboundInfo{
result = &user.ChangePlayerNameOutboundInfo{
Nickname: newnice,
UserID: c.Info.UserID,
}