2023-02-12 18:46:08 +01:00
|
|
|
namespace Application.Game.Card.Read;
|
|
|
|
|
|
|
|
|
2023-02-12 19:12:26 +01:00
|
|
|
public record ReadTotalTrophyQuery(long CardId) : IRequestWrapper<string>;
|
2023-02-12 18:46:08 +01:00
|
|
|
|
2023-02-16 17:38:01 +01:00
|
|
|
public class ReadTotalTrophyQueryHandler : RequestHandlerBase<ReadTotalTrophyQuery, string>
|
2023-02-12 18:46:08 +01:00
|
|
|
{
|
2023-02-13 17:38:19 +01:00
|
|
|
private const string TOTAL_TROPHY_XPATH = "/root/total_trophy";
|
|
|
|
|
2023-02-12 18:46:08 +01:00
|
|
|
public ReadTotalTrophyQueryHandler(ICardDependencyAggregate aggregate) : base(aggregate)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public override Task<ServiceResult<string>> Handle(ReadTotalTrophyQuery request, CancellationToken cancellationToken)
|
|
|
|
{
|
2023-02-13 17:38:19 +01:00
|
|
|
var trophy = new TotalTrophyDto
|
|
|
|
{
|
|
|
|
CardId = request.CardId,
|
|
|
|
TrophyNum = 8
|
|
|
|
};
|
|
|
|
|
|
|
|
var result = trophy.SerializeCardData(TOTAL_TROPHY_XPATH);
|
|
|
|
|
|
|
|
return Task.FromResult(new ServiceResult<string>(result));
|
2023-02-12 18:46:08 +01:00
|
|
|
}
|
|
|
|
}
|