diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/WordPressController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/WordPressController.cs index 473b807..774a534 100644 --- a/LaDOSE.Src/LaDOSE.Api/Controllers/WordPressController.cs +++ b/LaDOSE.Src/LaDOSE.Api/Controllers/WordPressController.cs @@ -77,7 +77,7 @@ namespace LaDOSE.Api.Controllers [HttpGet("UpdateDb")] public bool UpdateDb() { - return _service.UpdateBooking(); + return false; } [HttpGet("CreateChallonge/{gameId:int}/{wpEventId:int}")] diff --git a/LaDOSE.Src/LaDOSE.Api/LaDOSE.Api.csproj b/LaDOSE.Src/LaDOSE.Api/LaDOSE.Api.csproj index 8d02db7..cb92e74 100644 --- a/LaDOSE.Src/LaDOSE.Api/LaDOSE.Api.csproj +++ b/LaDOSE.Src/LaDOSE.Api/LaDOSE.Api.csproj @@ -1,8 +1,9 @@  - net6.0 + net8.0 AnyCPU;x64 + 12 @@ -10,13 +11,13 @@ - - - - - + + + + + - + diff --git a/LaDOSE.Src/LaDOSE.DTO/LaDOSE.DTO.csproj b/LaDOSE.Src/LaDOSE.DTO/LaDOSE.DTO.csproj index 71b992e..7532cee 100644 --- a/LaDOSE.Src/LaDOSE.DTO/LaDOSE.DTO.csproj +++ b/LaDOSE.Src/LaDOSE.DTO/LaDOSE.DTO.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 AnyCPU;x64 diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj index cbe7ac2..f23ba79 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj @@ -1,11 +1,12 @@  WinExe - net6.0 + net8.0 enable true app.manifest true + 12 @@ -24,8 +25,8 @@ - - + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs index a787393..6e431ce 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs @@ -38,9 +38,9 @@ sealed class Program var restUser = builder["REST:User"].ToString(); var restPassword = builder["REST:Password"].ToString(); - currentMutable.RegisterLazySingleton(() => + currentMutable.Register(() => { - var restService = new RestService(); + var restService = new RestService(new Uri(restUrl), restUser, restPassword); try { restService.Connect(new Uri(restUrl), restUser, restPassword); @@ -53,7 +53,7 @@ sealed class Program return restService; }); - + } // Avalonia configuration, don't remove; also used by visual designer. diff --git a/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj b/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj index 990f4ef..df9db20 100644 --- a/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj +++ b/LaDOSE.Src/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj @@ -2,16 +2,16 @@ Exe - net6.0 + net8.0 AnyCPU;x64 - - - - - + + + + + diff --git a/LaDOSE.Src/LaDOSE.Entity/LaDOSE.Entity.csproj b/LaDOSE.Src/LaDOSE.Entity/LaDOSE.Entity.csproj index d3b942f..e0fff87 100644 --- a/LaDOSE.Src/LaDOSE.Entity/LaDOSE.Entity.csproj +++ b/LaDOSE.Src/LaDOSE.Entity/LaDOSE.Entity.csproj @@ -2,12 +2,18 @@ AnyCPU;x64 - net6.0;netcoreapp3.1 + net8.0 + - + + + + + ..\..\..\..\.nuget\packages\microsoft.entityframeworkcore\8.0.11\lib\net8.0\Microsoft.EntityFrameworkCore.dll + diff --git a/LaDOSE.Src/LaDOSE.REST/LaDOSE.REST.csproj b/LaDOSE.Src/LaDOSE.REST/LaDOSE.REST.csproj index e7a3342..13ceb2c 100644 --- a/LaDOSE.Src/LaDOSE.REST/LaDOSE.REST.csproj +++ b/LaDOSE.Src/LaDOSE.REST/LaDOSE.REST.csproj @@ -1,13 +1,14 @@ - net6.0 + net8.0 AnyCPU;x64 + 12 - + diff --git a/LaDOSE.Src/LaDOSE.REST/RestService.cs b/LaDOSE.Src/LaDOSE.REST/RestService.cs index 68eef0f..fdffbd7 100644 --- a/LaDOSE.Src/LaDOSE.REST/RestService.cs +++ b/LaDOSE.Src/LaDOSE.REST/RestService.cs @@ -29,13 +29,19 @@ namespace LaDOSE.REST { } - - - public void Connect(Uri url, string user, string password) + public RestService(Uri url, string user, string password) { Client = new RestClient(url); this.username = user; this.password = password; + } + + + public void Connect(Uri url, string user, string password) + { + // Client = new RestClient(url); + // this.username = user; + // this.password = password; string token; try { @@ -79,7 +85,7 @@ namespace LaDOSE.REST private void CheckToken() { - if (this.Auth == null || this.Auth.Expire <= DateTime.Now) + if (this.Auth == null || this.Auth.Expire.ToUniversalTime() <= DateTime.Now.ToUniversalTime()) { GetToken(this.username,this.password); } diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/IWordPressService.cs b/LaDOSE.Src/LaDOSE.Service/Interface/IWordPressService.cs index 88745ba..a09ae1f 100644 --- a/LaDOSE.Src/LaDOSE.Service/Interface/IWordPressService.cs +++ b/LaDOSE.Src/LaDOSE.Service/Interface/IWordPressService.cs @@ -11,7 +11,6 @@ namespace LaDOSE.Business.Interface List GetWpEvent(); List GetBooking(int wpEventId, Game game); List GetBookingOptions(int wpEventId, Game game); - bool UpdateBooking(); string CreateChallonge(int gameId, int wpEventId, IList additionPlayers); Task GetLastChallonge(); diff --git a/LaDOSE.Src/LaDOSE.Service/LaDOSE.Business.csproj b/LaDOSE.Src/LaDOSE.Service/LaDOSE.Business.csproj index da5cda1..3b99468 100644 --- a/LaDOSE.Src/LaDOSE.Service/LaDOSE.Business.csproj +++ b/LaDOSE.Src/LaDOSE.Service/LaDOSE.Business.csproj @@ -1,15 +1,16 @@  - net6.0 + net8.0 LaDOSE.Business LaDOSE.Business AnyCPU;x64 - - + + + diff --git a/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs b/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs index 2e01cee..438c86e 100644 --- a/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs +++ b/LaDOSE.Src/LaDOSE.Service/Service/BotEventService.cs @@ -6,6 +6,7 @@ using LaDOSE.Entity.BotEvent; using LaDOSE.Entity.Context; using Microsoft.EntityFrameworkCore; + namespace LaDOSE.Business.Service { public class BotEventService : BaseService, IBotEventService diff --git a/LaDOSE.Src/LaDOSE.Service/Service/WordPressService.cs b/LaDOSE.Src/LaDOSE.Service/Service/WordPressService.cs index 9c0d473..71db42d 100644 --- a/LaDOSE.Src/LaDOSE.Service/Service/WordPressService.cs +++ b/LaDOSE.Src/LaDOSE.Service/Service/WordPressService.cs @@ -42,14 +42,7 @@ namespace LaDOSE.Business.Service .Include(e => e.WPBookings).ThenInclude(e => e.WPUser).FirstOrDefault(e => Enumerable.Count(e.WPBookings) != 0); return wpEvents; } - - public bool UpdateBooking() - { - _context.Database.SetCommandTimeout(60); - _context.Database.ExecuteSqlRaw("call ladoseapi.ImportEvent();"); - _context.Database.SetCommandTimeout(30); - return true; - } + public List GetBooking(int wpEventId, Game game) { var selectedGameWpId = game.WordPressTag.Split(';'); diff --git a/LaDOSE.Src/LinuxTest/LinuxTest.csproj b/LaDOSE.Src/LinuxTest/LinuxTest.csproj index d8cc1c0..3f8a58b 100644 --- a/LaDOSE.Src/LinuxTest/LinuxTest.csproj +++ b/LaDOSE.Src/LinuxTest/LinuxTest.csproj @@ -2,9 +2,10 @@ Exe - net6.0 + net8.0 enable enable + 12 diff --git a/LaDOSE.Src/LinuxTest/Program.cs b/LaDOSE.Src/LinuxTest/Program.cs index 42fd272..c265a85 100644 --- a/LaDOSE.Src/LinuxTest/Program.cs +++ b/LaDOSE.Src/LinuxTest/Program.cs @@ -2,18 +2,18 @@ internal class Program { public static void Main(string[] args) - { - Console.WriteLine("Rest Test"); - var p = new LaDOSE.REST.RestService(); - Console.WriteLine("[+] Connect"); - - p.Connect(new Uri("http://localhost:5000/"),"dev","dev"); - Console.WriteLine("[+] Test"); - var games = p.GetGames(); - foreach (var ga in games) { - Console.WriteLine(ga.Name); - } + // Console.WriteLine("Rest Test"); + // var p = new LaDOSE.REST.RestService(); + // Console.WriteLine("[+] Connect"); + // + // p.Connect(new Uri("http://localhost:5000/"),"dev","dev"); + // Console.WriteLine("[+] Test"); + // var games = p.GetGames(); + // foreach (var ga in games) + // { + // Console.WriteLine(ga.Name); + // } } } \ No newline at end of file diff --git a/LaDOSE.Src/global.json b/LaDOSE.Src/global.json index 9e5e1fd..dad2db5 100644 --- a/LaDOSE.Src/global.json +++ b/LaDOSE.Src/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.0", + "version": "8.0.0", "rollForward": "latestMajor", "allowPrerelease": true }