This commit is contained in:
@@ -77,7 +77,7 @@ namespace LaDOSE.Api.Controllers
|
||||
[HttpGet("UpdateDb")]
|
||||
public bool UpdateDb()
|
||||
{
|
||||
return _service.UpdateBooking();
|
||||
return false;
|
||||
}
|
||||
|
||||
[HttpGet("CreateChallonge/{gameId:int}/{wpEventId:int}")]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -10,13 +11,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.12" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.12" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -24,8 +25,8 @@
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
|
||||
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ sealed class Program
|
||||
var restUser = builder["REST:User"].ToString();
|
||||
var restPassword = builder["REST:Password"].ToString();
|
||||
|
||||
currentMutable.RegisterLazySingleton<RestService>(() =>
|
||||
currentMutable.Register<RestService>(() =>
|
||||
{
|
||||
var restService = new RestService();
|
||||
var restService = new RestService(new Uri(restUrl), restUser, restPassword);
|
||||
try
|
||||
{
|
||||
restService.Connect(new Uri(restUrl), restUser, restPassword);
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DSharpPlus" Version="4.2.0" />
|
||||
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.2.0" />
|
||||
<PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
|
||||
<PackageReference Include="DSharpPlus" Version="4.5.0" />
|
||||
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.5.0" />
|
||||
<PackageReference Include="DSharpPlus.Interactivity" Version="4.5.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -2,12 +2,18 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.12" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.EntityFrameworkCore">
|
||||
<HintPath>..\..\..\..\.nuget\packages\microsoft.entityframeworkcore\8.0.11\lib\net8.0\Microsoft.EntityFrameworkCore.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="RestSharp" Version="110.2.0" />
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace LaDOSE.Business.Interface
|
||||
List<WPEvent> GetWpEvent();
|
||||
List<WPUser> GetBooking(int wpEventId, Game game);
|
||||
List<WPUser> GetBookingOptions(int wpEventId, Game game);
|
||||
bool UpdateBooking();
|
||||
string CreateChallonge(int gameId, int wpEventId, IList<WPUser> additionPlayers);
|
||||
|
||||
Task<string> GetLastChallonge();
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AssemblyName>LaDOSE.Business</AssemblyName>
|
||||
<RootNamespace>LaDOSE.Business</RootNamespace>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GraphQL.Client" Version="4.0.2" />
|
||||
<PackageReference Include="GraphQL.Client.Serializer.Newtonsoft" Version="4.0.2" />
|
||||
<PackageReference Include="GraphQL.Client" Version="6.1.0" />
|
||||
<PackageReference Include="GraphQL.Client.Serializer.Newtonsoft" Version="6.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.12" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using LaDOSE.Entity.BotEvent;
|
||||
using LaDOSE.Entity.Context;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
namespace LaDOSE.Business.Service
|
||||
{
|
||||
public class BotEventService : BaseService<BotEvent>, IBotEventService
|
||||
|
||||
@@ -43,13 +43,6 @@ namespace LaDOSE.Business.Service
|
||||
return wpEvents;
|
||||
}
|
||||
|
||||
public bool UpdateBooking()
|
||||
{
|
||||
_context.Database.SetCommandTimeout(60);
|
||||
_context.Database.ExecuteSqlRaw("call ladoseapi.ImportEvent();");
|
||||
_context.Database.SetCommandTimeout(30);
|
||||
return true;
|
||||
}
|
||||
public List<WPUser> GetBooking(int wpEventId, Game game)
|
||||
{
|
||||
var selectedGameWpId = game.WordPressTag.Split(';');
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,17 +3,17 @@ 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);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "6.0.0",
|
||||
"version": "8.0.0",
|
||||
"rollForward": "latestMajor",
|
||||
"allowPrerelease": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user