diff --git a/AideDeJeu.sln b/AideDeJeu.sln index 89755c1e..8942700d 100644 --- a/AideDeJeu.sln +++ b/AideDeJeu.sln @@ -9,9 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AideDeJeu.iOS", "AideDeJeu\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AideDeJeu.UWP", "AideDeJeu\AideDeJeu.UWP\AideDeJeu.UWP.csproj", "{7E8B5E35-7000-487A-A5C6-E87376F81631}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AideDeJeu", "AideDeJeu\AideDeJeu\AideDeJeu.csproj", "{C0597D88-5C09-4314-80A3-64712B02D0E9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AideDeJeu", "AideDeJeu\AideDeJeu\AideDeJeu.csproj", "{C0597D88-5C09-4314-80A3-64712B02D0E9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AideDeJeuLib", "AideDeJeu\AideDeJeuLib\AideDeJeuLib.csproj", "{948BB32D-BAB8-485D-8A6F-BE5391E824A3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AideDeJeuLib", "AideDeJeu\AideDeJeuLib\AideDeJeuLib.csproj", "{948BB32D-BAB8-485D-8A6F-BE5391E824A3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AideDeJeuWeb", "AideDeJeu\AideDeJeuWeb\AideDeJeuWeb.csproj", "{D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -301,6 +303,54 @@ Global {948BB32D-BAB8-485D-8A6F-BE5391E824A3}.Release|x64.Build.0 = Release|Any CPU {948BB32D-BAB8-485D-8A6F-BE5391E824A3}.Release|x86.ActiveCfg = Release|Any CPU {948BB32D-BAB8-485D-8A6F-BE5391E824A3}.Release|x86.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|ARM.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|iPhone.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|x64.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|x64.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|x86.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.AppStore|x86.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|ARM.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|iPhone.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|x64.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|x64.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|x86.ActiveCfg = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Debug|x86.Build.0 = Debug|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|Any CPU.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|ARM.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|ARM.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|iPhone.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|iPhone.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|x64.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|x64.Build.0 = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|x86.ActiveCfg = Release|Any CPU + {D5065DC7-7B51-4D25-8FA5-DDF0F3E6FCE4}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AideDeJeu/AideDeJeuWeb/AideDeJeuWeb.csproj b/AideDeJeu/AideDeJeuWeb/AideDeJeuWeb.csproj new file mode 100644 index 00000000..15908674 --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/AideDeJeuWeb.csproj @@ -0,0 +1,23 @@ + + + + netcoreapp2.0 + + + + + + + + + + + + + + + + + + + diff --git a/AideDeJeu/AideDeJeuWeb/Controllers/ValuesController.cs b/AideDeJeu/AideDeJeuWeb/Controllers/ValuesController.cs new file mode 100644 index 00000000..c30ad15f --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/Controllers/ValuesController.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AideDeJeuLib.Spells; +using Microsoft.AspNetCore.Mvc; + +namespace AideDeJeuWeb.Controllers +{ + [Route("api/[controller]")] + public class ValuesController : Controller + { + // GET api/values + [HttpGet] + public async Task> Get() + { + var scrapper = new SpellsScrappers(); + var spells = await scrapper.GetSpells(); + //var spellIds = spells.Select(spell => spell.Id); + //var fullspells = await scrapper.GetSpells(spellIds); + return spells; + //return await scrapper.GetSpellIds(""); + //return await new SpellsScrappers().GetSpells(); + //return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public string Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody]string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody]string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/AideDeJeu/AideDeJeuWeb/Program.cs b/AideDeJeu/AideDeJeuWeb/Program.cs new file mode 100644 index 00000000..6e68d601 --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace AideDeJeuWeb +{ + public class Program + { + public static void Main(string[] args) + { + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + } +} diff --git a/AideDeJeu/AideDeJeuWeb/Properties/launchSettings.json b/AideDeJeu/AideDeJeuWeb/Properties/launchSettings.json new file mode 100644 index 00000000..6709b9ce --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/Properties/launchSettings.json @@ -0,0 +1,29 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:58892/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "AideDeJeuWeb": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:58893/" + } + } +} diff --git a/AideDeJeu/AideDeJeuWeb/Startup.cs b/AideDeJeu/AideDeJeuWeb/Startup.cs new file mode 100644 index 00000000..6ec424a1 --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/Startup.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace AideDeJeuWeb +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseMvc(); + } + } +} diff --git a/AideDeJeu/AideDeJeuWeb/appsettings.Development.json b/AideDeJeu/AideDeJeuWeb/appsettings.Development.json new file mode 100644 index 00000000..fa8ce71a --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/AideDeJeu/AideDeJeuWeb/appsettings.json b/AideDeJeu/AideDeJeuWeb/appsettings.json new file mode 100644 index 00000000..26bb0ac7 --- /dev/null +++ b/AideDeJeu/AideDeJeuWeb/appsettings.json @@ -0,0 +1,15 @@ +{ + "Logging": { + "IncludeScopes": false, + "Debug": { + "LogLevel": { + "Default": "Warning" + } + }, + "Console": { + "LogLevel": { + "Default": "Warning" + } + } + } +}