This commit is contained in:
Putoo
2026-05-26 18:38:55 +08:00
parent 61cf882b66
commit 6b7193b4c0
33 changed files with 1021 additions and 42 deletions

View File

@@ -12,12 +12,15 @@ public class BagController : ControllerBase
private readonly IUnitUserWeight _weightService;
private readonly IGameGoodsService _goodsService;
private readonly IGameEquService _equService;
private readonly IUnitUserAccService _accService;
public BagController(IUnitUserWeight weightService, IGameGoodsService goodsService, IGameEquService equService)
public BagController(IUnitUserWeight weightService, IGameGoodsService goodsService, IGameEquService equService,
IUnitUserAccService accService)
{
_weightService = weightService;
_goodsService = goodsService;
_equService = equService;
_accService = accService;
}
/// <summary>
@@ -28,14 +31,15 @@ public class BagController : ControllerBase
public async Task<IPoAction> GetUserBagData()
{
string userId = StateHelper.userId;
int onWeight = 0;
int maxWeight = 0;
int gold = 0;
int cowry = 0;
long copper = 0;
var accInfo = await _accService.GetUserAccInfo(userId);
long gold = (long)accInfo.gold;
long cowry = (long)accInfo.cowry;
long copper = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
var userWeight = await _weightService.GetUserWeightInfo(userId);
onWeight = (int)userWeight.onWeight;
maxWeight = (int)userWeight.maxWeight;
int onWeight = (int)userWeight.onWeight;
int maxWeight = (int)userWeight.maxWeight;
return PoAction.Ok(new { onWeight, maxWeight, cowry, gold, copper });
}