This commit is contained in:
Putoo
2026-06-08 18:56:28 +08:00
parent 1927e3f960
commit 9f3e4871a4
23 changed files with 1113 additions and 19 deletions

View File

@@ -13,12 +13,15 @@ public class ChatController : ControllerBase
private readonly IGameChatService _chatService;
private readonly IGameGoodsService _goodsService;
private readonly IUnitUserService _userService;
private readonly IGameTeamService _teamService;
public ChatController(IGameChatService chatService, IGameGoodsService goodsService, IUnitUserService userService)
public ChatController(IGameChatService chatService, IGameGoodsService goodsService, IUnitUserService userService,
IGameTeamService teamService)
{
_chatService = chatService;
_goodsService = goodsService;
_userService = userService;
_teamService = teamService;
}
/// <summary>
@@ -32,7 +35,8 @@ public class ChatController : ControllerBase
{
string userId = StateHelper.userId;
int areaId = StateHelper.areaId;
string teamId = "";
var myTeam = await _teamService.GetUserTeamData(userId);
string teamId = myTeam.teamId;
string groupId = "";
RefAsync<int> Total = 0;
var data = await _chatService.GetChatData(userId, type, areaId, teamId, groupId, page, 10, Total);
@@ -88,9 +92,10 @@ public class ChatController : ControllerBase
goodsId = GameConfig.SendChatGoodsBase;
break;
case 1:
isSend = true;
code = nameof(GameChatEnum.Code.Team);
par = "";
var myTeam = await _teamService.GetUserTeamData(userId);
par = myTeam.teamId;
isSend = par != "0";
break;
case 2:
isSend = true;