feat(pack): /pack/get_gacha_point_rewards endpoint
This commit is contained in:
@@ -28,6 +28,7 @@ public class PackController : SVSimController
|
||||
private readonly IRandom _rng;
|
||||
private readonly SVSimDbContext _db;
|
||||
private readonly ICardAcquisitionService _acquisition;
|
||||
private readonly IGachaPointService _gachaPoint;
|
||||
|
||||
public PackController(
|
||||
IPackRepository packs,
|
||||
@@ -35,7 +36,8 @@ public class PackController : SVSimController
|
||||
ICardPoolProvider pools,
|
||||
IRandom rng,
|
||||
SVSimDbContext db,
|
||||
ICardAcquisitionService acquisition)
|
||||
ICardAcquisitionService acquisition,
|
||||
IGachaPointService gachaPoint)
|
||||
{
|
||||
_packs = packs;
|
||||
_opener = opener;
|
||||
@@ -43,6 +45,7 @@ public class PackController : SVSimController
|
||||
_rng = rng;
|
||||
_db = db;
|
||||
_acquisition = acquisition;
|
||||
_gachaPoint = gachaPoint;
|
||||
}
|
||||
|
||||
[HttpPost("info")]
|
||||
@@ -146,6 +149,20 @@ public class PackController : SVSimController
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost("get_gacha_point_rewards")]
|
||||
public async Task<ActionResult<GetGachaPointRewardsResponse>> GetGachaPointRewards(
|
||||
GetGachaPointRewardsRequest request)
|
||||
{
|
||||
if (!TryGetViewerId(out long viewerId)) return Unauthorized();
|
||||
|
||||
var rewards = await _gachaPoint.GetRewardsAsync(request.ParentGachaId, viewerId);
|
||||
|
||||
return new GetGachaPointRewardsResponse
|
||||
{
|
||||
GachaPointRewards = rewards.ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost("open")]
|
||||
[HttpPost("/tutorial/pack_open")]
|
||||
public async Task<ActionResult<PackOpenResponse>> Open(PackOpenRequest request)
|
||||
|
||||
Reference in New Issue
Block a user