121212
This commit is contained in:
@@ -57,9 +57,9 @@ public class EquController : ControllerBase
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
|
||||
if (equInfo.suitCode != "0" && !string.IsNullOrEmpty(equInfo.suitCode))
|
||||
if (ueInfo.suitCode != "0" && !string.IsNullOrEmpty(ueInfo.suitCode))
|
||||
{
|
||||
suit = await _equService.GetEuqSuitInfo(equInfo.suitCode);
|
||||
suit = await _equService.GetEuqSuitInfo(ueInfo.suitCode);
|
||||
}
|
||||
|
||||
user = await UserModelTool.GetUserView(ueInfo.owerId);
|
||||
@@ -67,5 +67,70 @@ public class EquController : ControllerBase
|
||||
|
||||
return PoAction.Ok(new { equ = equInfo, suit, equData = ueInfo,user });
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取套装详情
|
||||
/// </summary>
|
||||
/// <param name="suitCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetEquSuitInfo(string suitCode)
|
||||
{
|
||||
var data = await _equService.GetEuqSuitInfo(suitCode);
|
||||
if (data == null)
|
||||
{
|
||||
return PoAction.Message("套装不存在!");
|
||||
}
|
||||
|
||||
return PoAction.Ok(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定操作
|
||||
/// </summary>
|
||||
/// <param name="ueId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> EquLock(string ueId)
|
||||
{
|
||||
var userId = StateHelper.userId;
|
||||
var equInfo = await _equService.GetUserEquInfo(ueId);
|
||||
if (equInfo == null)
|
||||
{
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
if (equInfo.userId != userId)
|
||||
{
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
if (equInfo.isAppr == 0)
|
||||
{
|
||||
return PoAction.Message("装备未鉴定!");
|
||||
}
|
||||
|
||||
|
||||
equInfo.isLock = equInfo.isLock == 0 ? 1 : 0;
|
||||
|
||||
bool result = await _equService.UpdateUserEquInfo(equInfo);
|
||||
if (result)
|
||||
{
|
||||
string msg = equInfo.isLock == 1 ? "成功绑定装备!" : "成功解除装备绑定!";
|
||||
return PoAction.Ok(true, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("操作失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 穿/卸装备
|
||||
/// </summary>
|
||||
/// <param name="ueId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> DownOrUpEqu(string ueId)
|
||||
{
|
||||
return PoAction.Ok(true);
|
||||
}
|
||||
}
|
||||
@@ -115,13 +115,7 @@ public class TeamController : ControllerBase
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
var teamInfo = await _teamService.GetTeamDataByTeamId(teamId);
|
||||
int isMyTeam = teamInfo.user.Any(it => it.user.userId == userId) ? 1 : 0;
|
||||
int manger = teamInfo.team.masterId == userId ? 1 : 0;
|
||||
return PoAction.Ok(new
|
||||
{
|
||||
data = teamInfo,
|
||||
isMyTeam = isMyTeam
|
||||
});
|
||||
return PoAction.Ok(teamInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,9 +16,10 @@ public class UserController : ControllerBase
|
||||
private readonly IGameGoodsService _goodsService;
|
||||
private readonly IGameChatService _chatService;
|
||||
private readonly IGameSkillService _skillService;
|
||||
private readonly IGameTeamService _teamService;
|
||||
public UserController(IUnitUserService userService, IUnitUserAttrService attrService,
|
||||
IUnitUserAccService accService, IGameMapService mapService, IUnitUserRelationService relationService,
|
||||
IGameGoodsService goodsService, IGameChatService chatService,IGameSkillService skillService)
|
||||
IGameGoodsService goodsService, IGameChatService chatService,IGameSkillService skillService,IGameTeamService teamService)
|
||||
{
|
||||
_userService = userService;
|
||||
_attrService = attrService;
|
||||
@@ -28,6 +29,7 @@ public class UserController : ControllerBase
|
||||
_goodsService = goodsService;
|
||||
_chatService = chatService;
|
||||
_skillService = skillService;
|
||||
_teamService = teamService;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +162,8 @@ public class UserController : ControllerBase
|
||||
string onMapName = $"{onCity.cityName}-{onMapInfo.mapName}";
|
||||
bool isFriend = await _relationService.CheckIsFriend(userId, userInfo.userId);
|
||||
bool isEnemy = await _relationService.CheckUserEnemy(userId, userInfo.userId);
|
||||
object result = new { user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy };
|
||||
var team = await _teamService.GetUserTeamInfo(userInfo.userId);
|
||||
object result = new { user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy ,team};
|
||||
return PoAction.Ok(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user