This commit is contained in:
Putoo
2026-06-09 17:51:12 +08:00
parent 9f3e4871a4
commit 46bacd1e38
10 changed files with 279 additions and 24 deletions

View File

@@ -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);
}
}