2023-02-16 09:53:02 +01:00
|
|
|
|
namespace Application.Game.Card.OnlineMatching;
|
2023-02-13 19:47:08 +01:00
|
|
|
|
|
|
|
|
|
public record UploadOnlineMatchingResultCommand(long CardId, string Data) : IRequestWrapper<string>;
|
|
|
|
|
|
2023-02-16 17:38:01 +01:00
|
|
|
|
public class UploadOnlineMatchingResultCommandHandler : RequestHandlerBase<UploadOnlineMatchingResultCommand, string>
|
2023-02-10 18:24:24 +01:00
|
|
|
|
{
|
2023-02-26 19:43:13 +01:00
|
|
|
|
private const string XPATH = "/root/online_battle_result";
|
|
|
|
|
|
2023-02-13 19:47:08 +01:00
|
|
|
|
public UploadOnlineMatchingResultCommandHandler(ICardDependencyAggregate aggregate) : base(aggregate)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Task<ServiceResult<string>> Handle(UploadOnlineMatchingResultCommand request, CancellationToken cancellationToken)
|
|
|
|
|
{
|
2023-02-26 19:43:13 +01:00
|
|
|
|
var result = new OnlineMatchingResult { Status = 1 }.SerializeCardData(XPATH);
|
|
|
|
|
return Task.FromResult(new ServiceResult<string>(result));
|
2023-02-13 19:47:08 +01:00
|
|
|
|
}
|
2023-02-26 19:43:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OnlineMatchingResult
|
|
|
|
|
{
|
|
|
|
|
[XmlElement(ElementName = "status")]
|
|
|
|
|
public int Status { get; set; }
|
2023-02-10 18:24:24 +01:00
|
|
|
|
}
|