1212
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user