1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-22 18:13:23 +00:00

Remise en place card data json

This commit is contained in:
Yan Maniez 2018-05-07 00:44:07 +02:00
parent 31089eb04d
commit c230fe4362
3 changed files with 42 additions and 29 deletions

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AideDeJeuLib.Cards;
using AideDeJeuLib.Spells;
using Microsoft.AspNetCore.Mvc;
@ -12,13 +13,22 @@ namespace AideDeJeuWeb.Controllers
{
// GET api/values
[HttpGet]
public async Task<IEnumerable<Spell>> Get()
public async Task<IEnumerable<CardData>> Get()
{
var scrapper = new SpellsScrappers();
var spells = await scrapper.GetSpells();
var spellIds = await scrapper.GetSpellIds("c");
var spells = await scrapper.GetSpells(spellIds);
var cardDatas = new List<CardData>();
foreach (var spell in spells)
{
cardDatas.AddRange(Converters.ToCardDatas(spell));
}
return cardDatas;
//var spellIds = spells.Select(spell => spell.Id);
//var fullspells = await scrapper.GetSpells(spellIds);
return spells;
//return spells;
//return await scrapper.GetSpellIds("");
//return await new SpellsScrappers().GetSpells();
//return new string[] { "value1", "value2" };