1
0
mirror of synced 2024-12-19 09:45:54 +01:00
GC-local-server-rewrite/Application/Game/Card/Read/ReadTotalTrophyQuery.cs

34 lines
970 B
C#
Raw Normal View History

using Application.Common.Extensions;
using Application.Common.Models;
2023-02-13 17:38:19 +01:00
using Application.Dto;
using Application.Interfaces;
using Domain.Enums;
using Microsoft.EntityFrameworkCore;
namespace Application.Game.Card.Read;
public record ReadTotalTrophyQuery(long CardId) : IRequestWrapper<string>;
public class ReadTotalTrophyQueryHandler : CardRequestHandlerBase<ReadTotalTrophyQuery, string>
{
2023-02-13 17:38:19 +01:00
private const string TOTAL_TROPHY_XPATH = "/root/total_trophy";
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));
}
}