diff --git a/Application.Tests/Application.Tests.csproj b/Application.Tests/Application.Tests.csproj index 81fe680..477ee7a 100644 --- a/Application.Tests/Application.Tests.csproj +++ b/Application.Tests/Application.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/WebGP.Application/WebGP.Application.csproj b/WebGP.Application/WebGP.Application.csproj index eae187f..f044902 100644 --- a/WebGP.Application/WebGP.Application.csproj +++ b/WebGP.Application/WebGP.Application.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/WebGP.Domain/WebGP.Domain.csproj b/WebGP.Domain/WebGP.Domain.csproj index 6836c68..8a91831 100644 --- a/WebGP.Domain/WebGP.Domain.csproj +++ b/WebGP.Domain/WebGP.Domain.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/WebGP.Infrastructure/DataBase/ApplicationDbContext.cs b/WebGP.Infrastructure/DataBase/ApplicationDbContext.cs index 3f969ec..61df996 100644 --- a/WebGP.Infrastructure/DataBase/ApplicationDbContext.cs +++ b/WebGP.Infrastructure/DataBase/ApplicationDbContext.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using WebGP.Application.Common.Interfaces; +using WebGP.Application.Common.VM; using WebGP.Domain.Entities; namespace WebGP.Infrastructure.DataBase; @@ -312,8 +313,44 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.Name) .HasColumnType("text") .HasColumnName("name"); - }); + }); + /*modelBuilder.Entity(entity => + { + entity.HasNoKey(); + entity.Property(e => e.TimedId) + .HasColumnName("timed_id") + .HasColumnType("int(11)"); + entity.Property(e => e.Uuid) + .HasColumnName("uuid") + .HasMaxLength(36); + entity.Property(e => e.StaticId) + .HasColumnName("id") + .HasColumnType("int(11)"); + entity.Property(e => e.FirstName) + .HasColumnName("first_name") + .HasMaxLength(15); + entity.Property(e => e.LastName) + .HasColumnName("last_name") + .HasMaxLength(15); + entity.Property(e => e.DiscordId) + .HasColumnName("discord_id") + .HasColumnType("bigint(20)"); + entity.Property(e => e.Role) + .HasColumnName("role") + .HasColumnType("mediumtext") + .UseCollation("utf8mb4_unicode_ci"); + entity.Property(e => e.Work) + .HasColumnName("work") + .HasColumnType("mediumtext") + .UseCollation("utf8mb4_unicode_ci"); + entity.Property(e => e.Level) + .HasColumnName("Level") + .HasColumnType("int(11)"); + entity.Property(e => e.SkinUrl) + .HasColumnName("skin_url") + .HasColumnType("text"); + });*/ OnModelCreatingPartial(modelBuilder); } diff --git a/WebGP.Infrastructure/DataBase/Migrations/20230325170551_Initional.cs b/WebGP.Infrastructure/DataBase/Migrations/20230325170551_Initional.cs index a560ff9..518ba7c 100644 --- a/WebGP.Infrastructure/DataBase/Migrations/20230325170551_Initional.cs +++ b/WebGP.Infrastructure/DataBase/Migrations/20230325170551_Initional.cs @@ -196,8 +196,8 @@ protected override void Up(MigrationBuilder migrationBuilder) // creating view migrationBuilder.Sql("CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `role_work_readonly` AS select `work_readonly`.`id` AS `id`,`work_readonly`.`type` AS `type`,`work_readonly`.`icon` AS `icon`,`work_readonly`.`name` AS `name` from `work_readonly` union select `roles`.`id` AS `id`,'ROLE' AS `type`,if(octet_length(`roles`.`name`) = 0,'',concat('<#',`roles`.`color`,'>',`roles`.`name`)) AS `icon`,`roles`.`name` AS `name` from `roles`;"); migrationBuilder.Sql( - "DELIMITER //\r\nCREATE FUNCTION `GetLevel`(`_exp` INT\r\n) RETURNS int(11)\r\nBEGIN\r\n DECLARE _level INT DEFAULT 0;\r\n DECLARE _next INT DEFAULT 0;\r\n WHILE (TRUE) DO\r\n SET _next = _next + _level * 4;\r\n IF (_exp < _next) THEN\r\n RETURN _level - 1;\r\n END IF;\r\n SET _level = _level + 1;\r\n END WHILE;\r\nEND//\r\nDELIMITER ;"); - migrationBuilder.Sql("DELIMITER //\r\nCREATE FUNCTION `GetExp`(`_level` INT\r\n) RETURNS int(11)\r\nBEGIN\r\n DECLARE _next INT DEFAULT 0;\r\n WHILE (TRUE) DO\r\n SET _next = _next + _level * 4;\r\n IF (_level = 0) THEN\r\n RETURN _next;\r\n END IF;\r\n SET _level = _level - 1;\r\n END WHILE;\r\nEND//\r\nDELIMITER ;"); + "CREATE FUNCTION `GetLevel`(`_exp` INT) RETURNS int(11)BEGIN DECLARE _level INT DEFAULT 0; DECLARE _next INT DEFAULT 0; WHILE (TRUE) DO SET _next = _next + _level * 4; IF (_exp < _next) THEN RETURN _level - 1; END IF; SET _level = _level + 1; END WHILE;END"); + migrationBuilder.Sql("CREATE FUNCTION `GetExp`(`_level` INT) RETURNS int(11)BEGIN DECLARE _next INT DEFAULT 0; WHILE (TRUE) DO SET _next = _next + _level * 4; IF (_level = 0) THEN RETURN _next; END IF; SET _level = _level - 1; END WHILE;END"); } /// diff --git a/WebGP.Infrastructure/DataBase/OnlineRepository.cs b/WebGP.Infrastructure/DataBase/OnlineRepository.cs index 4164743..8e43505 100644 --- a/WebGP.Infrastructure/DataBase/OnlineRepository.cs +++ b/WebGP.Infrastructure/DataBase/OnlineRepository.cs @@ -19,7 +19,7 @@ public class OnlineRepository : IOnlineRepository SELECT online.timed_id AS 'TimedId', online.`uuid` AS 'Uuid', - users.id AS 'Id', + users.id AS 'StaticId', users.first_name AS 'FirstName', users.last_name AS 'LastName', discord.discord_id AS 'DiscordId', diff --git a/WebGP.Infrastructure/WebGP.Infrastructure.csproj b/WebGP.Infrastructure/WebGP.Infrastructure.csproj index 42070a4..7fa81ad 100644 --- a/WebGP.Infrastructure/WebGP.Infrastructure.csproj +++ b/WebGP.Infrastructure/WebGP.Infrastructure.csproj @@ -1,14 +1,15 @@ - net7.0 + net8.0 enable enable - + + diff --git a/WebGP/Dockerfile b/WebGP/Dockerfile index 4c11c5d..f1760f3 100644 --- a/WebGP/Dockerfile +++ b/WebGP/Dockerfile @@ -1,11 +1,11 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0-preview AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build WORKDIR /src COPY ["WebGP/WebGP.csproj", "WebGP/"] COPY ["WebGP.Application/WebGP.Application.csproj", "WebGP.Application/"] diff --git a/WebGP/WebGP.csproj b/WebGP/WebGP.csproj index 131b6c2..7dbfa28 100644 --- a/WebGP/WebGP.csproj +++ b/WebGP/WebGP.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable 6e7f14f2-61a9-4611-94ad-935554790f83 @@ -11,18 +11,18 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + +