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

39 lines
1.1 KiB
C#
Raw Normal View History

namespace Application.Game.Card.Read;
public record ReadTitleQuery(long CardId) : IRequestWrapper<string>;
2023-02-16 17:38:01 +01:00
public class ReadTitleQueryHandler : RequestHandlerBase<ReadTitleQuery, string>
{
2023-02-13 17:38:19 +01:00
private const string TITLE_XPATH = "/root/title/record";
public ReadTitleQueryHandler(ICardDependencyAggregate aggregate) : base(aggregate)
{
}
public override Task<ServiceResult<string>> Handle(ReadTitleQuery request, CancellationToken cancellationToken)
{
2023-02-13 17:38:19 +01:00
var count = Config.TitleCount;
var list = new List<TitleDto>();
for (int i = 0; i < count; i++)
{
var soundEffect = new TitleDto
{
Id = i,
CardId = request.CardId,
2023-02-16 08:26:13 +01:00
TitleId = i + 1,
2023-02-13 17:38:19 +01:00
Created = "2013-01-01 08:00:00",
Modified = "2013-01-01 08:00:00",
NewFlag = 0,
UseFlag = 1
};
list.Add(soundEffect);
}
var result = list.SerializeCardDataList(TITLE_XPATH);
return Task.FromResult(new ServiceResult<string>(result));
}
}