From e63d4cfb196ca54b9076318adeb534be03f7a2f4 Mon Sep 17 00:00:00 2001 From: luevard Date: Mon, 2 Oct 2023 20:32:27 +0200 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Ajout=20du=20projet=20Ktor=20et=20?= =?UTF-8?q?de=20la=20d=C3=A9pendance=20=C3=A0=20Ktorm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/.gitignore | 36 +++++ Sources/AllIn.sln | 37 ----- Sources/AllInApi/AllInApi.csproj | 13 -- Sources/AllInApi/Controllers/BetController.cs | 11 -- .../AllInApi/Controllers/GroupController.cs | 11 -- .../AllInApi/Controllers/UserController.cs | 43 ------ Sources/AllInApi/DTO/BetDTO.cs | 12 -- Sources/AllInApi/DTO/GroupDTO.cs | 9 -- Sources/AllInApi/DTO/LargeImageDTO.cs | 7 - Sources/AllInApi/DTO/MiseDTO.cs | 8 - Sources/AllInApi/DTO/UserDTO.cs | 12 -- Sources/AllInApi/Mapper/BetMapper.cs | 6 - Sources/AllInApi/Mapper/GroupMapper.cs | 6 - Sources/AllInApi/Mapper/UserMapper.cs | 6 - Sources/AllInApi/Program.cs | 25 --- .../AllInApi/Properties/launchSettings.json | 31 ---- Sources/AllInApi/appsettings.Development.json | 8 - Sources/AllInApi/appsettings.json | 9 -- Sources/Model/Bet.cs | 102 ------------- Sources/Model/Group.cs | 68 --------- Sources/Model/IDataManager.cs | 40 ----- Sources/Model/LargeImage.cs | 32 ---- Sources/Model/Mise.cs | 20 --- Sources/Model/Model.csproj | 13 -- Sources/Model/User.cs | 134 ---------------- Sources/Shared/IGenericDataManager.cs | 12 -- Sources/Shared/Shared.csproj | 9 -- Sources/pom.xml | 143 ++++++++++++++++++ Sources/src/main/kotlin/allin/Application.kt | 15 ++ .../src/main/kotlin/allin/plugins/Routing.kt | 13 ++ Sources/src/main/resources/logback.xml | 12 ++ .../src/test/kotlin/allin/ApplicationTest.kt | 4 + .../classes/META-INF/allin-api.kotlin_module | Bin 0 -> 76 bytes .../classes/allin/ApplicationKt$main$1.class | Bin 0 -> 1569 bytes .../target/classes/allin/ApplicationKt.class | Bin 0 -> 1738 bytes .../RoutingKt$configureRouting$1$1.class | Bin 0 -> 4373 bytes .../RoutingKt$configureRouting$1.class | Bin 0 -> 1941 bytes .../classes/allin/plugins/RoutingKt.class | Bin 0 -> 1140 bytes Sources/target/classes/logback.xml | 12 ++ .../META-INF/allin-api.kotlin_module | Bin 0 -> 24 bytes .../test-classes/allin/ApplicationTest.class | Bin 0 -> 486 bytes 41 files changed, 235 insertions(+), 684 deletions(-) create mode 100644 Sources/.gitignore delete mode 100644 Sources/AllIn.sln delete mode 100644 Sources/AllInApi/AllInApi.csproj delete mode 100644 Sources/AllInApi/Controllers/BetController.cs delete mode 100644 Sources/AllInApi/Controllers/GroupController.cs delete mode 100644 Sources/AllInApi/Controllers/UserController.cs delete mode 100644 Sources/AllInApi/DTO/BetDTO.cs delete mode 100644 Sources/AllInApi/DTO/GroupDTO.cs delete mode 100644 Sources/AllInApi/DTO/LargeImageDTO.cs delete mode 100644 Sources/AllInApi/DTO/MiseDTO.cs delete mode 100644 Sources/AllInApi/DTO/UserDTO.cs delete mode 100644 Sources/AllInApi/Mapper/BetMapper.cs delete mode 100644 Sources/AllInApi/Mapper/GroupMapper.cs delete mode 100644 Sources/AllInApi/Mapper/UserMapper.cs delete mode 100644 Sources/AllInApi/Program.cs delete mode 100644 Sources/AllInApi/Properties/launchSettings.json delete mode 100644 Sources/AllInApi/appsettings.Development.json delete mode 100644 Sources/AllInApi/appsettings.json delete mode 100644 Sources/Model/Bet.cs delete mode 100644 Sources/Model/Group.cs delete mode 100644 Sources/Model/IDataManager.cs delete mode 100644 Sources/Model/LargeImage.cs delete mode 100644 Sources/Model/Mise.cs delete mode 100644 Sources/Model/Model.csproj delete mode 100644 Sources/Model/User.cs delete mode 100644 Sources/Shared/IGenericDataManager.cs delete mode 100644 Sources/Shared/Shared.csproj create mode 100644 Sources/pom.xml create mode 100644 Sources/src/main/kotlin/allin/Application.kt create mode 100644 Sources/src/main/kotlin/allin/plugins/Routing.kt create mode 100644 Sources/src/main/resources/logback.xml create mode 100644 Sources/src/test/kotlin/allin/ApplicationTest.kt create mode 100644 Sources/target/classes/META-INF/allin-api.kotlin_module create mode 100644 Sources/target/classes/allin/ApplicationKt$main$1.class create mode 100644 Sources/target/classes/allin/ApplicationKt.class create mode 100644 Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1$1.class create mode 100644 Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1.class create mode 100644 Sources/target/classes/allin/plugins/RoutingKt.class create mode 100644 Sources/target/classes/logback.xml create mode 100644 Sources/target/test-classes/META-INF/allin-api.kotlin_module create mode 100644 Sources/target/test-classes/allin/ApplicationTest.class diff --git a/Sources/.gitignore b/Sources/.gitignore new file mode 100644 index 0000000..c426c32 --- /dev/null +++ b/Sources/.gitignore @@ -0,0 +1,36 @@ +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ \ No newline at end of file diff --git a/Sources/AllIn.sln b/Sources/AllIn.sln deleted file mode 100644 index 7fd1212..0000000 --- a/Sources/AllIn.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33424.131 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shared", "Shared\Shared.csproj", "{ACD97125-7DB7-4A05-B9B2-D531D2B08A27}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{94CAC52F-2584-4C8F-85BF-9333FFCE1481}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AllInApi", "AllInApi\AllInApi.csproj", "{3336A244-C3FE-415F-BB19-DDA0DC301524}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ACD97125-7DB7-4A05-B9B2-D531D2B08A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ACD97125-7DB7-4A05-B9B2-D531D2B08A27}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACD97125-7DB7-4A05-B9B2-D531D2B08A27}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ACD97125-7DB7-4A05-B9B2-D531D2B08A27}.Release|Any CPU.Build.0 = Release|Any CPU - {94CAC52F-2584-4C8F-85BF-9333FFCE1481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94CAC52F-2584-4C8F-85BF-9333FFCE1481}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94CAC52F-2584-4C8F-85BF-9333FFCE1481}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94CAC52F-2584-4C8F-85BF-9333FFCE1481}.Release|Any CPU.Build.0 = Release|Any CPU - {3336A244-C3FE-415F-BB19-DDA0DC301524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3336A244-C3FE-415F-BB19-DDA0DC301524}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3336A244-C3FE-415F-BB19-DDA0DC301524}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3336A244-C3FE-415F-BB19-DDA0DC301524}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BDB705DC-223D-4FDE-8D00-67929A13F0FD} - EndGlobalSection -EndGlobal diff --git a/Sources/AllInApi/AllInApi.csproj b/Sources/AllInApi/AllInApi.csproj deleted file mode 100644 index 4289e82..0000000 --- a/Sources/AllInApi/AllInApi.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/Sources/AllInApi/Controllers/BetController.cs b/Sources/AllInApi/Controllers/BetController.cs deleted file mode 100644 index 33e816a..0000000 --- a/Sources/AllInApi/Controllers/BetController.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace AllInApi.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class BetController : ControllerBase - { - } -} diff --git a/Sources/AllInApi/Controllers/GroupController.cs b/Sources/AllInApi/Controllers/GroupController.cs deleted file mode 100644 index 7edfdf9..0000000 --- a/Sources/AllInApi/Controllers/GroupController.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace AllInApi.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class GroupController : ControllerBase - { - } -} diff --git a/Sources/AllInApi/Controllers/UserController.cs b/Sources/AllInApi/Controllers/UserController.cs deleted file mode 100644 index 506acee..0000000 --- a/Sources/AllInApi/Controllers/UserController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 - -namespace AllInApi.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class UserController : ControllerBase - { - // GET: api/ - [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api//5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } - - // POST api/ - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api//5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api//5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/Sources/AllInApi/DTO/BetDTO.cs b/Sources/AllInApi/DTO/BetDTO.cs deleted file mode 100644 index 8268088..0000000 --- a/Sources/AllInApi/DTO/BetDTO.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace AllInApi.DTO -{ - public class BetDTO - { - public string Name { get; set; } - public string Title { get; set; } - public List Choices { get; set; } - public string Themes{ get; set; } - public Dictionary? Bets { get; set; } - - } -} diff --git a/Sources/AllInApi/DTO/GroupDTO.cs b/Sources/AllInApi/DTO/GroupDTO.cs deleted file mode 100644 index 739543b..0000000 --- a/Sources/AllInApi/DTO/GroupDTO.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace AllInApi.DTO -{ - public class GroupDTO - { - public string Name { get; set; } - public DateTime CreationDate { get; set; } - public LargeImageDTO Image { get; set; } - } -} diff --git a/Sources/AllInApi/DTO/LargeImageDTO.cs b/Sources/AllInApi/DTO/LargeImageDTO.cs deleted file mode 100644 index 3845deb..0000000 --- a/Sources/AllInApi/DTO/LargeImageDTO.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace AllInApi.DTO -{ - public class LargeImageDTO - { - public string Base64 { get; set; } - } -} diff --git a/Sources/AllInApi/DTO/MiseDTO.cs b/Sources/AllInApi/DTO/MiseDTO.cs deleted file mode 100644 index 521bc9c..0000000 --- a/Sources/AllInApi/DTO/MiseDTO.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace AllInApi.DTO -{ - public class MiseDTO - { - public int Cost { get; set; } - public int Choices { get; set; } - } -} diff --git a/Sources/AllInApi/DTO/UserDTO.cs b/Sources/AllInApi/DTO/UserDTO.cs deleted file mode 100644 index 6a92a5b..0000000 --- a/Sources/AllInApi/DTO/UserDTO.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace AllInApi.DTO -{ - public class UserDTO - { - public string Name { get; set; } - public string Mail { get; set; } - public LargeImageDTO Image { get; set; } - public int NumberOfCoins { get; set; } - - public List Groups { get; set;} - } -} diff --git a/Sources/AllInApi/Mapper/BetMapper.cs b/Sources/AllInApi/Mapper/BetMapper.cs deleted file mode 100644 index 6c16eec..0000000 --- a/Sources/AllInApi/Mapper/BetMapper.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AllInApi.Mapper -{ - public class BetMapper - { - } -} diff --git a/Sources/AllInApi/Mapper/GroupMapper.cs b/Sources/AllInApi/Mapper/GroupMapper.cs deleted file mode 100644 index 53c39eb..0000000 --- a/Sources/AllInApi/Mapper/GroupMapper.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AllInApi.Mapper -{ - public class GroupMapper - { - } -} diff --git a/Sources/AllInApi/Mapper/UserMapper.cs b/Sources/AllInApi/Mapper/UserMapper.cs deleted file mode 100644 index e6edaa7..0000000 --- a/Sources/AllInApi/Mapper/UserMapper.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AllInApi.Mapper -{ - public class UserMapper - { - } -} diff --git a/Sources/AllInApi/Program.cs b/Sources/AllInApi/Program.cs deleted file mode 100644 index 15eacee..0000000 --- a/Sources/AllInApi/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. - -builder.Services.AddControllers(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.UseHttpsRedirection(); - -app.UseAuthorization(); - -app.MapControllers(); - -app.Run(); diff --git a/Sources/AllInApi/Properties/launchSettings.json b/Sources/AllInApi/Properties/launchSettings.json deleted file mode 100644 index 0c50e51..0000000 --- a/Sources/AllInApi/Properties/launchSettings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:7156", - "sslPort": 44309 - } - }, - "profiles": { - "AllInApi": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7065;http://localhost:5238", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/Sources/AllInApi/appsettings.Development.json b/Sources/AllInApi/appsettings.Development.json deleted file mode 100644 index ff66ba6..0000000 --- a/Sources/AllInApi/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/Sources/AllInApi/appsettings.json b/Sources/AllInApi/appsettings.json deleted file mode 100644 index 4d56694..0000000 --- a/Sources/AllInApi/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/Sources/Model/Bet.cs b/Sources/Model/Bet.cs deleted file mode 100644 index baca56e..0000000 --- a/Sources/Model/Bet.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public class Bet - { - public string Id - { - get => id; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - id = "Unknown"; - return; - } - id = value; - } - } - private readonly string id = null!; - - public string Title - { - get => title; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - title = "Unknown"; - return; - } - title = value; - } - } - private readonly string title = null!; - - public string Name - { - get => name; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - name = "Unknown"; - return; - } - name = value; - } - } - private readonly string name = null!; - - public ReadOnlyDictionary Users { get; private set; } - private Dictionary users = new Dictionary(); - - public ReadOnlyCollection Choices { get; private set; } - private List choices = new(); - - public string Theme - { - get => theme; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - theme = "Unknown"; - return; - } - theme = value; - } - } - private readonly string theme = null!; - - public bool Status { get; set; } - - public string Description { get; set; } - - public DateTime StartDate { get; set; } - - public DateTime EndDate { get; set; } - - public Bet(string id, string title, string name, string theme, bool status, string description, DateTime startDate, DateTime endDate) - { - Id = id; - Title = title; - Name = name; - Choices = new ReadOnlyCollection(choices); - Theme = theme; - Status = status; - Description = description; - StartDate = startDate; - EndDate = endDate; - Users = new ReadOnlyDictionary(users); - } - - } -} diff --git a/Sources/Model/Group.cs b/Sources/Model/Group.cs deleted file mode 100644 index e745ae7..0000000 --- a/Sources/Model/Group.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public class Group - { - public string Id - { - get => id; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - id = "Unknown"; - return; - } - id = value; - } - } - private readonly string id = null!; - - public string Name - { - get => name; - set - { - if (value == null) - { - name = ""; - return; - } - name = value; - } - } - private string name = ""; - - public LargeImage Image { get; set; } - - public DateTime CreationDate { get; set; } - - public Group(string id, string name, DateTime creationDate, string image = "") - { - Id = id; - Name = name; - Image = new LargeImage(image); - CreationDate = creationDate; - } - - public override bool Equals(object? obj) - { - if (ReferenceEquals(obj, null)) return false; - if (ReferenceEquals(obj, this)) return true; - if (GetType() != obj.GetType()) return false; - return Equals(obj as Group); - } - - public override int GetHashCode() - => Id.GetHashCode() % 997; - - public bool Equals(Group? other) - => Id.Equals(other?.Id); - - } -} diff --git a/Sources/Model/IDataManager.cs b/Sources/Model/IDataManager.cs deleted file mode 100644 index cfd65a2..0000000 --- a/Sources/Model/IDataManager.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Shared; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public interface IDataManager - { - IUsersManager UsersMgr { get; } - IBetsManager BetsMgr { get; } - IRunesManager RunesMgr { get; } - } - - public interface IUsersManager : IGenericDataManager - { - Task GetItemByMail(string mail); - Task GetNbItemsByUser(Group? group); - Task> GetItemsByGroup(Group? group, int index, int count, string? orderingPropertyName = null, bool descending = false); - Task GetNbItemsByAllCoins(int allCoins); - Task> GetItemsByAllCoins(int allCoins, int index, int count, string? orderingPropertyName = null, bool descending = false); - - } - - public interface IBetsManager : IGenericDataManager - { - Task GetNbItemsByUser(User? user); - Task> GetItemsByUser(User? user, int index, int count, string? orderingPropertyName = null, bool descending = false); - Task GetNbItemsByDescription(string description); - Task> GetItemsByDescription(string description, int index, int count, string? orderingPropertyName = null, bool descending = false); - - } - - public interface IRunesManager : IGenericDataManager - { - - } -} diff --git a/Sources/Model/LargeImage.cs b/Sources/Model/LargeImage.cs deleted file mode 100644 index 87788be..0000000 --- a/Sources/Model/LargeImage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public class LargeImage : IEquatable - { - public string Base64 { get; set; } - - public LargeImage(string base64) - { - Base64 = base64; - } - - public bool Equals(LargeImage? other) - => other != null && other.Base64.Equals(Base64); - - public override bool Equals(object? obj) - { - if (ReferenceEquals(obj, null)) return false; - if (ReferenceEquals(obj!, this)) return true; - if (GetType() != obj!.GetType()) return false; - return Equals(obj! as LargeImage); - } - - public override int GetHashCode() - => Base64.Substring(0, 10).GetHashCode(); - } -} diff --git a/Sources/Model/Mise.cs b/Sources/Model/Mise.cs deleted file mode 100644 index 9aeccf0..0000000 --- a/Sources/Model/Mise.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Model -{ - public class Mise - { - public int Cost { get; set; } - public string Choice { get; set; } - - public Mise(int cost, string choice) - { - Cost = cost; - Choice = choice; - } - } -} diff --git a/Sources/Model/Model.csproj b/Sources/Model/Model.csproj deleted file mode 100644 index 6c2a3aa..0000000 --- a/Sources/Model/Model.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/Sources/Model/User.cs b/Sources/Model/User.cs deleted file mode 100644 index 151d383..0000000 --- a/Sources/Model/User.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System.Collections.ObjectModel; -using System.Reflection.PortableExecutable; -using System.Security.Claims; -using System.Text; -using System.Xml.Linq; -using static System.Net.Mime.MediaTypeNames; - -namespace Model -{ - public class User - { - public string Id - { - get => id; - private init - { - if (string.IsNullOrWhiteSpace(value)) - { - id = "Unknown"; - return; - } - id = value; - } - } - private readonly string id = null!; - - public string Pseudo - { - get => pseudo; - set - { - if (value == null) - { - pseudo = ""; - return; - } - pseudo = value; - } - } - private string pseudo = ""; - - public string Mail - { - get => mail; - set - { - if (value == null) - { - mail = ""; - return; - } - mail = value; - } - } - private string mail = ""; - - public string Password - { - get => password; - set - { - if (value == null) - { - password = ""; - return; - } - password = value; - } - } - private string password = ""; - - public DateTime CreationDate { get; set; } - - public LargeImage Image { get; set; } - public int AllCoins { get; set; } - - public User(string id, string pseudo, string mail, string password, DateTime date, string image = "", int allCoins = 0) - { - Id = id; - Pseudo = pseudo; - Mail = mail; - Password = password; - Image = new LargeImage(image); - AllCoins = allCoins; - Groups = new ReadOnlyCollection(groups); - } - - public ReadOnlyCollection Groups { get; private set; } - private List groups = new(); - - public bool AddGroup(Group group) - { - if (groups.Contains(group)) - return false; - groups.Add(group); - return true; - } - - public bool RemoveSkin(Group group) - => groups.Remove(group); - - public override bool Equals(object? obj) - { - if (ReferenceEquals(obj, null)) return false; - if (ReferenceEquals(obj, this)) return true; - if (GetType() != obj.GetType()) return false; - return Equals(obj as User); - } - - public override int GetHashCode() - => Id.GetHashCode() % 997; - - public bool Equals(User? other) - => Id.Equals(other?.Id); - - public override string ToString() - { - StringBuilder sb = new StringBuilder($"{Id} ({Mail})"); - if (!string.IsNullOrWhiteSpace(Image.Base64)) - { - sb.AppendLine($"\t{Image.Base64}"); - } - if (Groups.Any()) - { - sb.AppendLine("\tGroup:"); - foreach (var group in Groups) - { - sb.AppendLine($"\t\t{group.Id} - {group.Name}"); - } - } - return sb.ToString(); - } - } -} \ No newline at end of file diff --git a/Sources/Shared/IGenericDataManager.cs b/Sources/Shared/IGenericDataManager.cs deleted file mode 100644 index fabfe51..0000000 --- a/Sources/Shared/IGenericDataManager.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Shared; -public interface IGenericDataManager -{ - Task GetNbItems(); - Task> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false); - Task GetNbItemsByName(string substring); - Task> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false); - Task> GetItemByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false); - Task UpdateItem(T oldItem, T newItem); - Task AddItem(T item); - Task DeleteItem(T item); -} diff --git a/Sources/Shared/Shared.csproj b/Sources/Shared/Shared.csproj deleted file mode 100644 index bafd05b..0000000 --- a/Sources/Shared/Shared.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/Sources/pom.xml b/Sources/pom.xml new file mode 100644 index 0000000..bed0ed5 --- /dev/null +++ b/Sources/pom.xml @@ -0,0 +1,143 @@ + + + 4.0.0 + allin + allin-api + 0.0.1 + allin-api + allin-api + + 2.3.4 + official + 1.9.10 + 1.4.11 + 2.0.9 + UTF-8 + true + allin.ApplicationKt + + + + + + io.ktor + ktor-server-core-jvm + ${ktor_version} + + + io.ktor + ktor-server-netty-jvm + ${ktor_version} + + + org.ktorm + ktorm-core + 3.2.0 + + + ch.qos.logback + logback-classic + ${logback_version} + + + org.slf4j + slf4j-api + ${slf4j_version} + + + io.ktor + ktor-server-tests-jvm + ${ktor_version} + test + + + org.jetbrains.kotlin + kotlin-test-junit + ${kotlin_version} + test + + + org.jetbrains.kotlinx + kotlinx-coroutines-debug + 1.6.4 + test + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + ${project.basedir}/src/main/resources + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin_version} + + 1.8 + + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + + java + + + + + ${main.class} + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.6 + + + jar-with-dependencies + + + + true + ${main.class} + + + + + + assemble-all + package + + single + + + + + + + \ No newline at end of file diff --git a/Sources/src/main/kotlin/allin/Application.kt b/Sources/src/main/kotlin/allin/Application.kt new file mode 100644 index 0000000..7796f9b --- /dev/null +++ b/Sources/src/main/kotlin/allin/Application.kt @@ -0,0 +1,15 @@ +package allin + +import allin.plugins.* +import io.ktor.server.application.* +import io.ktor.server.engine.* +import io.ktor.server.netty.* + +fun main() { + embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module) + .start(wait = true) +} + +fun Application.module() { + configureRouting() +} diff --git a/Sources/src/main/kotlin/allin/plugins/Routing.kt b/Sources/src/main/kotlin/allin/plugins/Routing.kt new file mode 100644 index 0000000..bc358d8 --- /dev/null +++ b/Sources/src/main/kotlin/allin/plugins/Routing.kt @@ -0,0 +1,13 @@ +package allin.plugins + +import io.ktor.server.application.* +import io.ktor.server.response.* +import io.ktor.server.routing.* + +fun Application.configureRouting() { + routing { + get("/") { + call.respondText("Hello World!") + } + } +} diff --git a/Sources/src/main/resources/logback.xml b/Sources/src/main/resources/logback.xml new file mode 100644 index 0000000..3e11d78 --- /dev/null +++ b/Sources/src/main/resources/logback.xml @@ -0,0 +1,12 @@ + + + + %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/Sources/src/test/kotlin/allin/ApplicationTest.kt b/Sources/src/test/kotlin/allin/ApplicationTest.kt new file mode 100644 index 0000000..055425d --- /dev/null +++ b/Sources/src/test/kotlin/allin/ApplicationTest.kt @@ -0,0 +1,4 @@ +package allin + +class ApplicationTest { +} diff --git a/Sources/target/classes/META-INF/allin-api.kotlin_module b/Sources/target/classes/META-INF/allin-api.kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..12d8f45b2b4a1183dcb64dbd0aa63e53e83e8a0e GIT binary patch literal 76 zcmZQzU|?ooU|ZSyF4xjm&-7HCOEpzU zfHAx)*L-a}cAIruDlG!VJ$t30T;sbcwnQM5E1deCSL}A(YI}qo-@;s3`gTqGfgOsV zDFT}xChabugY!yBU7Rm6J>U)}9Az2_r5h$N!7%FX2)EXbeaQn}7epS0E7`8zUu^6OSNG`Mw0;_A(l~`l z3l>hKF@SRneK*B$xksYhzq!e=KUyX*Wnt7*62WDLfi}quNfXF2B%R9Ida1Is%rJQH z5?TzlFpYc)Ib1apEHGqxRgs)?>6sBF&CXLMNx=jjPmy+mVdMbvxzK!*Yi`z2Z${}I zGb2()fPvMF5~a(x(rB|p9P^wl%p=8cwCkbI)HGc#`J2R+Oxbt2SLK1^8=hDQ-+e9I*TnG5{AKYloCOU>4GRbw5(ju4~gYe{EolLkXn=5 zit9!|S<-8MBXGrvG%3g1399?>U8uveG>9YAA$^uGZYD$B#pp-VB1?(1JmRDQgVV9h zKxQyA6#IhA2Qn}`Bx&tm;#ezm#O#tFP2d8Z5jqF*neneUoBxXQCM<#_k_IzQIShme zAh$Mz(N5w5-9I90f`*SVV7Nrc7fCnBixgl&tm*tuT>6YFA93wH{Xc}J)pbEz9cT+P zun8rJ*-nFFEi6j=9g){xaQzc*nmR#qStgk#casdmzzQ8Ps&4_0NsAzgC#`c44xN+a Zd5dhf-yrJXj)S`n?%}?JBIX=C_yhEYisJwP literal 0 HcmV?d00001 diff --git a/Sources/target/classes/allin/ApplicationKt.class b/Sources/target/classes/allin/ApplicationKt.class new file mode 100644 index 0000000000000000000000000000000000000000..739d2f95e337e1110cc8278a51abe63893936eb7 GIT binary patch literal 1738 zcma)7TXWM!6#iB=cC5IGV{Rc$NeKp=&_qsKdcl-7gaib}T*8Ez=4m5u%*OI6qg{F0 zH-18YMqkTAC)0AL{h1Z5k26#kTgWj?PWr`S$qlfB*Osz?XQ;aFU0iRNm_T zekcQOWTft!JQzc1kN3D2a@F=8?(B(xv>AqMmrKQvsV;0W%*e>=m?-wNhwVfl!iP;IG1y1w;+W`hTmneu$ZkgqKd zzGIlAqKkOxxd=KV|3^ILT|tHnSE{K#jzCUnMx9;Q zD&i_WbFqjehOdGr% zJ{T8bZgur%YJ0IMaw zFBv9MWLxeKy|Qaji}*3wpz+d7=xD}I`Hp2wxe*0C+~Tpc_akNHNurGG3Saf4mZbl` zjjM+gA&h;cM7$Pqtp&m1ZbnHQhz)7uo*RYO8U{%DQIi~GEe6QYp&?YM_H(G)5AcO`bOw&LlR0vCF^L9gi$hcTo47`I59p$iP9qN}6{yCqXm4ZA z(`9335Ae;fibLltWxP($GHBB3l3kf3O29)B4tzW!d7boiig;ri86V&Ixas42{NQ61 bw|uPO_BNQtIySaxHrU@Cjf%!Kjl2H=0sz$a literal 0 HcmV?d00001 diff --git a/Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1$1.class b/Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1$1.class new file mode 100644 index 0000000000000000000000000000000000000000..8d7176425bf665b9c1761ae52825c938782b3b9b GIT binary patch literal 4373 zcmeHLTUQ&`8Qn(`2nHDgb}owBL@7!DaT!Fg;{r`fv4|C}MSyG5)*YmS7#Pi{Gb4<9 zi+f4h=7;p5PwpkQSF={j>SKRHe@36%?lZap!eFmH^rfsd=YGz&zsuR@6Mz5LpZ@}2 z5}yf-7?x$)dfBQJP21DgoQiMS#RWf^ckCUrSaD@-D49;CqY(UC+;@DnC-1nyYU$~F z2PNIKed*eUrROSMS=xm~qqJQxrt7QKlAVg3_f3a#=4-9@W)@9H-}fC?r(jDjn`Ozf zrM_Bg%sD*v(4VOvvtgV5bYqVv-2>_BM!9U6c|#qo&oC=R`5!MX;*^n zGovR2ar2&WVCa@%7xk6xJ(>4;Ag$JV%JWSSMMU7u+K%U#A&Pc^_8F7feIU?3SVwWp z#>Zh!4{ZvpU$lzKyo`6LnL0K(n7vqf3?1mw(1w^m#NRbNfw7kpCeXzgE0ry&+$NB? zNT|Ri(>`$aWi7r0-W_c9&QR-+f_8zwZprORaY_0{!SD_GSL_IAwZI?S_c>sNd1Ev- zOn%f>5V9!o%h&JFSnUptoqvaD;6=wR>U+}Pb`5ps4BK}6Ao@Igxnfzywk3(7|GZ_6 zuU2x^P^)IVh%V1H^PZk~iLQZX>svS-zFIC2)1{49msP zkEDjL;2nWB;*u5>&c-l+!A^uQByhPVeocB6%U42%1-kuR*LkpF&l{#i0ugxSEJtm| zFp4n^BhUrHi^*|;zEl6I;eDmV4crt+)layXIHH&m zh~1W!%l}UQ?I5*K?!C0LLJ!QLZ2wbTyF07OE zk_EYA(5wRg7FUyKuqF5Br^CZKB?<59j;z~&lB(~*_ z%cml@X3QZ*ZUN1NyeMNK*LMtK4!eOm#VuIq@;PkKuem*9d(F$vjn0^ zg;9CFr>R=if>C^%FGUryz-}`z&KG&YcJ)p}S1*W(`Xe}fhLZ&T_=2MTXHWGRsFkBS zHL}NdW9Y*b)w(YbDyLO3p$gK`-~(KDp0qs8N+t$hb5=tk&`HBq!FDLvmZk=WHS6xFP=a|@gT@tPLp3XqpW9^ zOfh1(hlf16Zl9BxlT&f?GI)V~Ddo;dJnOp_d@Z%8rTfz(>B*_I_Wt$$iK+DU zCg4C-E%o1_Ruabh)4{8OAw1d4wBFBg^3%kJg^EizVinxJpKYpcl%bJV(qUyER3JAyoSiXkw7~&jp8l` zf^zZ}s|bG1{+k>LQ{53_OjDPetk>AThc4V_t#qBFu|}v>4(lw(xMG8?FxN+^!yrwT z#B|LPs&$8k6!-;qwzGbV^)LBFNnL~jnuesuP0BPIJf@9x{0oHcjy}crrXumk@aLF} zN2t*geE%^gs}@fMu8B7+9*02`%64&VBOCZ5jy#VK*SzqZ77SOyH4IfG0l1!7;wf-k z;aQ>(6#>1eVLD;t2p^8p>`$>ep2G|Fo4q@n7h47S}ZgtIWS*vn!cRu(1LSvV+jvxgtR-9noO&x7w_-9yF0 SK@dmX^zo1Q{Ww_nlm7ru#^mk* literal 0 HcmV?d00001 diff --git a/Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1.class b/Sources/target/classes/allin/plugins/RoutingKt$configureRouting$1.class new file mode 100644 index 0000000000000000000000000000000000000000..4462df98d80eb59b18e5defee079cda06c077088 GIT binary patch literal 1941 zcma)6Yf~Fl7=F%@X2Y@-h_+mcZI#$^sa+`5szGduU{}(#0;M9K4x7_($mVQjFB$#D zZ}As+nURj2aWehrk8*rZve4AhSY~qe@m!7-w{E?}Hts!xf8iAe_L;LtEs zL$hze#2E_pxAjtSwx0t;(Z+SmSh$8+hO7Oy>S{1tJELl|J!MM^N&589-NeT>hB0En zfWt79YOmjxiA9E-TiMz!RaV!?cPANk9-fUQ+#bX&e8ONfX=nZ{_S~{ZZGaw@eoKRz zN*&p#UG`P7AUF`XQ6#$TkRvu z7%?nk+@NrzeKct-usLJFxNp7qIcwzfsp>6CZJDb;{nQAOh@Lrtj=jN~Cdv#W|LtrH z^RHQgH=DlnI<9m|FXN6wD|pCYrET$Moh+4E4XV@%^5wwe{tgc%-}l9~9vFtpQi)2^ z*cV|sQ`k(%^9|vumW(8AI(@RGmtBFuc9jz0s?VcHP=6X;Q=T70-Tfav~+z>B9G*Vu7l2jufI^jtN~Zk~~8{Dk05mQdFQFBqFkNnPb?$ zQpB)Dqurgw`OcY9?JU}w&gUp>5p3XSANf=cnn8b+CY;=P-7UQT!cW>brt++MzL@k^$q?l=R;?p3s=V z13bd_6d4%6Zs+?QexUCiB3Pl*U+rPQ#a$OA7x%F0;%ltASjRVeU=i-a-9skAw-GiX I%tsjh7xN+e;{X5v literal 0 HcmV?d00001 diff --git a/Sources/target/classes/allin/plugins/RoutingKt.class b/Sources/target/classes/allin/plugins/RoutingKt.class new file mode 100644 index 0000000000000000000000000000000000000000..5809412e5a1408f5ba072379eef0d58219e2ff5b GIT binary patch literal 1140 zcma)6OHUI~7(I6ieT+p)m8S{_RiHek;A>H1Bt(*lwHhF}V0Amal-o}4G;{AXF8Mib zbwykl;?f^w{06GjstJpJkJJ0TPv-lNFJA#X##4q#?)y?X9Y1PFrJcPXGEy~On-myB zuF1RH@wsX^Z);8A5t<;>3)Hb}M4{-tW>{UW$iQitAat|{yCQUWr{hbH8yP5P`^qk_ z95O6cg0SHgAQe0}qs@QD$(*#x(9SOcdhN{k1HHYq!HN_N${e!tgpboG4+n zy9pvLi$x|DU|_A-u;|YZGPX)&)i)Uy&QG)U`KfK?EZds0$egirB&-rES|#h-$0SkN zs&BD4N#^2a>%1cw>>jH(T83e0C#VaC(TY@}8ntU8Jm58-kbEWZxPQn)8T&o3uoo#K z+rm{{sU_jRX}EnwafYm`ln8fxuC>rqa6gDbPwdJ#?{qK4;bnrpIBdegP&_m>JdI%_ z$#=+mNt&iWzL?LPVYK)e!@c*P2(?fmX_HPOO-vi1JRquHL|_(kpuaWr#Hm_ literal 0 HcmV?d00001 diff --git a/Sources/target/classes/logback.xml b/Sources/target/classes/logback.xml new file mode 100644 index 0000000..3e11d78 --- /dev/null +++ b/Sources/target/classes/logback.xml @@ -0,0 +1,12 @@ + + + + %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/Sources/target/test-classes/META-INF/allin-api.kotlin_module b/Sources/target/test-classes/META-INF/allin-api.kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..1e9f2ca4d180a083a06174d407c30581ce729120 GIT binary patch literal 24 YcmZQzU|?ooU|Bb5Ph=;C!8n;et@5ijhZNEOe{1eYGOiynkb>6THvB9#~oo8V##l@vb8d? zFvQXyWt>GTWAkR_&E(CS`TTl&2XKIO!h#G#6_rkVy->BJQE^lYw3z}C{0BLdrBFt9 zrR(NH&|=mhxW_6|=7ivEZq+kL!u62A6d_^ml_nIb|0*64a@9_3?6S+i$hI_+Infxoo#%*y?%Q4hY$*ih`>_w;A+nvKcayuf{DI)@5JW`j_-><3Ya_TqrxS zbTf#I>IQYC6_1=oQEVn})7XRHPyF6sAH!CbxGdS5I3~AWk$T}oV42aj0S7CLnV$iq x;Z6Fh6D(ql<01E^SuWFnQ^8CHvlV3FbBbIAdCWCH8uM6aAfe%DENZwKg>U9JVqO3M literal 0 HcmV?d00001