From d62c38db51bd2c79d16f9e3d1649131bddb5d07a Mon Sep 17 00:00:00 2001
From: Artemy <109195690+stalcker2288969@users.noreply.github.com>
Date: Mon, 16 Jun 2025 22:31:45 +0700
Subject: [PATCH] DbGovor init
---
Govor.API/Govor.API.csproj | 14 +-
Govor.API/Program.cs | 49 ++++---
Govor.API/appsettings.json | 3 +
Govor.Console/Govor.Console.csproj | 11 ++
Govor.Console/Program.cs | 3 +
Govor.Core/Class1.cs | 5 -
Govor.Core/Govor.Core.csproj | 5 +
Govor.Core/Models/ChatGroup.cs | 11 ++
Govor.Core/Models/GroupAdmins.cs | 8 ++
Govor.Core/Models/GroupMembership.cs | 9 ++
Govor.Core/Models/User.cs | 12 ++
Govor.Core/Repositories/IUsersExist.cs | 10 ++
Govor.Core/Repositories/IUsersReader.cs | 14 ++
Govor.Core/Repositories/IUsersRepository.cs | 6 +
Govor.Core/Repositories/IUsersWriter.cs | 11 ++
Govor.Data/Class1.cs | 5 -
.../GroupMembershipConfiguration.cs | 13 ++
.../Configurations/UserConfiguration.cs | 13 ++
Govor.Data/Govor.Data.csproj | 9 ++
Govor.Data/GovorDbContext.cs | 13 ++
.../20250616151700_initial.Designer.cs | 129 ++++++++++++++++++
.../Migrations/20250616151700_initial.cs | 92 +++++++++++++
.../Migrations/GovorDbContextModelSnapshot.cs | 126 +++++++++++++++++
Govor.Data/Repositories/UsersRepository.cs | 72 ++++++++++
Govor.sln | 6 +
25 files changed, 613 insertions(+), 36 deletions(-)
create mode 100644 Govor.Console/Govor.Console.csproj
create mode 100644 Govor.Console/Program.cs
delete mode 100644 Govor.Core/Class1.cs
create mode 100644 Govor.Core/Models/ChatGroup.cs
create mode 100644 Govor.Core/Models/GroupAdmins.cs
create mode 100644 Govor.Core/Models/GroupMembership.cs
create mode 100644 Govor.Core/Models/User.cs
create mode 100644 Govor.Core/Repositories/IUsersExist.cs
create mode 100644 Govor.Core/Repositories/IUsersReader.cs
create mode 100644 Govor.Core/Repositories/IUsersRepository.cs
create mode 100644 Govor.Core/Repositories/IUsersWriter.cs
delete mode 100644 Govor.Data/Class1.cs
create mode 100644 Govor.Data/Configurations/GroupMembershipConfiguration.cs
create mode 100644 Govor.Data/Configurations/UserConfiguration.cs
create mode 100644 Govor.Data/GovorDbContext.cs
create mode 100644 Govor.Data/Migrations/20250616151700_initial.Designer.cs
create mode 100644 Govor.Data/Migrations/20250616151700_initial.cs
create mode 100644 Govor.Data/Migrations/GovorDbContextModelSnapshot.cs
create mode 100644 Govor.Data/Repositories/UsersRepository.cs
diff --git a/Govor.API/Govor.API.csproj b/Govor.API/Govor.API.csproj
index c5521c1..5003fdd 100644
--- a/Govor.API/Govor.API.csproj
+++ b/Govor.API/Govor.API.csproj
@@ -7,7 +7,13 @@
-
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
@@ -15,4 +21,10 @@
+
+
+
+
+
+
diff --git a/Govor.API/Program.cs b/Govor.API/Program.cs
index d5e0ef3..b4ea7f7 100644
--- a/Govor.API/Program.cs
+++ b/Govor.API/Program.cs
@@ -1,9 +1,28 @@
+using Govor.Data;
+using Microsoft.EntityFrameworkCore;
+
var builder = WebApplication.CreateBuilder(args);
-// Add services to the container.
-// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
+builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
+
+// Add services
+
+builder.Services.AddSignalR();
+
+builder.Services.AddControllers();
+
+builder.Services.AddDbContext(
+ options =>
+ {
+ options.UseNpgsql(builder.Configuration.GetConnectionString(nameof(GovorDbContext)));
+ }
+);
+
+builder.Services.AddEndpointsApiExplorer();
builder.Services.AddOpenApi();
+builder.Services.AddAuthorization();
+
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -14,28 +33,8 @@ if (app.Environment.IsDevelopment())
app.UseHttpsRedirection();
-var summaries = new[]
-{
- "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
-};
+app.UseAuthorization();
-app.MapGet("/weatherforecast", () =>
- {
- var forecast = Enumerable.Range(1, 5).Select(index =>
- new WeatherForecast
- (
- DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
- Random.Shared.Next(-20, 55),
- summaries[Random.Shared.Next(summaries.Length)]
- ))
- .ToArray();
- return forecast;
- })
- .WithName("GetWeatherForecast");
+app.MapControllers();
-app.Run();
-
-record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
-{
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
-}
\ No newline at end of file
+app.Run();
\ No newline at end of file
diff --git a/Govor.API/appsettings.json b/Govor.API/appsettings.json
index 10f68b8..8e04af3 100644
--- a/Govor.API/appsettings.json
+++ b/Govor.API/appsettings.json
@@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
+ "ConnectionStrings": {
+ "GovorDbContext": "Host=localhost;Port=5432;Database=DbGovor;Username=postgres;Password=stalcker;"
+ },
"AllowedHosts": "*"
}
diff --git a/Govor.Console/Govor.Console.csproj b/Govor.Console/Govor.Console.csproj
new file mode 100644
index 0000000..69b50f7
--- /dev/null
+++ b/Govor.Console/Govor.Console.csproj
@@ -0,0 +1,11 @@
+
+
+
+ Exe
+ net9.0
+ 13
+ enable
+ enable
+
+
+
diff --git a/Govor.Console/Program.cs b/Govor.Console/Program.cs
new file mode 100644
index 0000000..e5dff12
--- /dev/null
+++ b/Govor.Console/Program.cs
@@ -0,0 +1,3 @@
+// See https://aka.ms/new-console-template for more information
+
+Console.WriteLine("Hello, World!");
\ No newline at end of file
diff --git a/Govor.Core/Class1.cs b/Govor.Core/Class1.cs
deleted file mode 100644
index d98439d..0000000
--- a/Govor.Core/Class1.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-namespace Govor.Core;
-
-public class Class1
-{
-}
\ No newline at end of file
diff --git a/Govor.Core/Govor.Core.csproj b/Govor.Core/Govor.Core.csproj
index 17b910f..f7b0c18 100644
--- a/Govor.Core/Govor.Core.csproj
+++ b/Govor.Core/Govor.Core.csproj
@@ -6,4 +6,9 @@
enable
+
+
+
+
+
diff --git a/Govor.Core/Models/ChatGroup.cs b/Govor.Core/Models/ChatGroup.cs
new file mode 100644
index 0000000..1912474
--- /dev/null
+++ b/Govor.Core/Models/ChatGroup.cs
@@ -0,0 +1,11 @@
+namespace Govor.Core.Models;
+
+public class ChatGroup
+{
+ public Guid Id { get; set; }
+ public string Name { get; set; }
+ public List InviteCode { get; set; }
+ public bool IsChannel { get; set; }
+ public bool IsPrivate { get; set; }
+ public List Admins { get; set; } = new();
+}
\ No newline at end of file
diff --git a/Govor.Core/Models/GroupAdmins.cs b/Govor.Core/Models/GroupAdmins.cs
new file mode 100644
index 0000000..be21bfc
--- /dev/null
+++ b/Govor.Core/Models/GroupAdmins.cs
@@ -0,0 +1,8 @@
+namespace Govor.Core.Models;
+
+public class GroupAdmins
+{
+ public Guid Id { get; set; }
+ public Guid GroupId { get; set; }
+ public Guid UserId { get; set; }
+}
\ No newline at end of file
diff --git a/Govor.Core/Models/GroupMembership.cs b/Govor.Core/Models/GroupMembership.cs
new file mode 100644
index 0000000..d33f40d
--- /dev/null
+++ b/Govor.Core/Models/GroupMembership.cs
@@ -0,0 +1,9 @@
+namespace Govor.Core.Models;
+
+public class GroupMembership
+{
+ public Guid Id { get; set; }
+ public Guid GroupId { get; set; }
+ public Guid UserId { get; set; }
+ public bool IsBanned { get; set; }
+}
\ No newline at end of file
diff --git a/Govor.Core/Models/User.cs b/Govor.Core/Models/User.cs
new file mode 100644
index 0000000..5e548ae
--- /dev/null
+++ b/Govor.Core/Models/User.cs
@@ -0,0 +1,12 @@
+namespace Govor.Core.Models;
+
+public class User
+{
+ public Guid Id {get; set;}
+ public string Username {get; set;}
+ public string Description {get; set;}
+ public string HashPassword {get; set;}
+ public Guid IconId {get; set;}
+ public DateTime CreatedOn {get; set;}
+ public DateTime WasOnline {get; set;}
+}
\ No newline at end of file
diff --git a/Govor.Core/Repositories/IUsersExist.cs b/Govor.Core/Repositories/IUsersExist.cs
new file mode 100644
index 0000000..ad8ee12
--- /dev/null
+++ b/Govor.Core/Repositories/IUsersExist.cs
@@ -0,0 +1,10 @@
+using Govor.Core.Models;
+
+namespace Govor.Core.Repositories;
+
+public interface IUsersExist
+{
+ public Task Exists(User user);
+ public Task ExistsById(Guid id);
+ public Task ExistsUsername(string username);
+}
\ No newline at end of file
diff --git a/Govor.Core/Repositories/IUsersReader.cs b/Govor.Core/Repositories/IUsersReader.cs
new file mode 100644
index 0000000..6811e95
--- /dev/null
+++ b/Govor.Core/Repositories/IUsersReader.cs
@@ -0,0 +1,14 @@
+using Govor.Core.Models;
+
+namespace Govor.Core.Repositories;
+
+public interface IUsersReader
+{
+ public Task> GetAll();
+ public Task FindById(Guid id);
+ public Task> FindByRangeId(IEnumerable ids);
+ public Task FindByUsername(string username);
+ public Task> FindByRangeUsername(IEnumerable usernames);
+
+ public Task> FindUsersByCreatedDate(DateOnly createdDate);
+}
\ No newline at end of file
diff --git a/Govor.Core/Repositories/IUsersRepository.cs b/Govor.Core/Repositories/IUsersRepository.cs
new file mode 100644
index 0000000..15f0d41
--- /dev/null
+++ b/Govor.Core/Repositories/IUsersRepository.cs
@@ -0,0 +1,6 @@
+namespace Govor.Core.Repositories;
+
+public interface IUsersRepository : IUsersReader, IUsersWriter, IUsersExist
+{
+
+}
\ No newline at end of file
diff --git a/Govor.Core/Repositories/IUsersWriter.cs b/Govor.Core/Repositories/IUsersWriter.cs
new file mode 100644
index 0000000..a9fb07f
--- /dev/null
+++ b/Govor.Core/Repositories/IUsersWriter.cs
@@ -0,0 +1,11 @@
+using Govor.Core.Models;
+
+namespace Govor.Core.Repositories;
+
+public interface IUsersWriter
+{
+ public Task Add(User user);
+ public Task Update(User user);
+ public Task Remove(User user);
+ public Task Remove(Guid userId);
+}
\ No newline at end of file
diff --git a/Govor.Data/Class1.cs b/Govor.Data/Class1.cs
deleted file mode 100644
index b9205d3..0000000
--- a/Govor.Data/Class1.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-namespace Govor.Data;
-
-public class Class1
-{
-}
\ No newline at end of file
diff --git a/Govor.Data/Configurations/GroupMembershipConfiguration.cs b/Govor.Data/Configurations/GroupMembershipConfiguration.cs
new file mode 100644
index 0000000..812aa8b
--- /dev/null
+++ b/Govor.Data/Configurations/GroupMembershipConfiguration.cs
@@ -0,0 +1,13 @@
+using Govor.Core.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Govor.Data.Configurations;
+
+public class GroupMembershipConfiguration : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasKey(m => new { m.GroupId, m.UserId });
+ }
+}
\ No newline at end of file
diff --git a/Govor.Data/Configurations/UserConfiguration.cs b/Govor.Data/Configurations/UserConfiguration.cs
new file mode 100644
index 0000000..2f91c4d
--- /dev/null
+++ b/Govor.Data/Configurations/UserConfiguration.cs
@@ -0,0 +1,13 @@
+using Govor.Core.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Govor.Data.Configurations;
+
+public class UserConfiguration : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasKey(x => x.Id);
+ }
+}
\ No newline at end of file
diff --git a/Govor.Data/Govor.Data.csproj b/Govor.Data/Govor.Data.csproj
index 17b910f..29dc018 100644
--- a/Govor.Data/Govor.Data.csproj
+++ b/Govor.Data/Govor.Data.csproj
@@ -6,4 +6,13 @@
enable
+
+
+
+
+
+
+
+
+
diff --git a/Govor.Data/GovorDbContext.cs b/Govor.Data/GovorDbContext.cs
new file mode 100644
index 0000000..384b861
--- /dev/null
+++ b/Govor.Data/GovorDbContext.cs
@@ -0,0 +1,13 @@
+using System.Text.RegularExpressions;
+using Govor.Core.Models;
+using Microsoft.EntityFrameworkCore;
+
+namespace Govor.Data;
+
+public class GovorDbContext(DbContextOptions options) : DbContext(options)
+{
+ public virtual DbSet Users { get; set; }
+ public virtual DbSet ChatGroups { get; set; }
+ public virtual DbSet GroupMemberships { get; set; }
+ public virtual DbSet GroupAdmins { get; set; }
+}
\ No newline at end of file
diff --git a/Govor.Data/Migrations/20250616151700_initial.Designer.cs b/Govor.Data/Migrations/20250616151700_initial.Designer.cs
new file mode 100644
index 0000000..3080a12
--- /dev/null
+++ b/Govor.Data/Migrations/20250616151700_initial.Designer.cs
@@ -0,0 +1,129 @@
+//
+using System;
+using System.Collections.Generic;
+using Govor.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Govor.Data.Migrations
+{
+ [DbContext(typeof(GovorDbContext))]
+ [Migration("20250616151700_initial")]
+ partial class initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Govor.Core.Models.ChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.PrimitiveCollection>("Admins")
+ .IsRequired()
+ .HasColumnType("uuid[]");
+
+ b.PrimitiveCollection>("InviteCode")
+ .IsRequired()
+ .HasColumnType("text[]");
+
+ b.Property("IsChannel")
+ .HasColumnType("boolean");
+
+ b.Property("IsPrivate")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("ChatGroups");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.GroupAdmins", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("GroupId")
+ .HasColumnType("uuid");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.ToTable("GroupAdmins");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.GroupMembership", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("GroupId")
+ .HasColumnType("uuid");
+
+ b.Property("IsBanned")
+ .HasColumnType("boolean");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.ToTable("GroupMemberships");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HashPassword")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IconId")
+ .HasColumnType("uuid");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("WasOnline")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Govor.Data/Migrations/20250616151700_initial.cs b/Govor.Data/Migrations/20250616151700_initial.cs
new file mode 100644
index 0000000..8957a2c
--- /dev/null
+++ b/Govor.Data/Migrations/20250616151700_initial.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Govor.Data.Migrations
+{
+ ///
+ public partial class initial : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "ChatGroups",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Name = table.Column(type: "text", nullable: false),
+ InviteCode = table.Column>(type: "text[]", nullable: false),
+ IsChannel = table.Column(type: "boolean", nullable: false),
+ IsPrivate = table.Column(type: "boolean", nullable: false),
+ Admins = table.Column>(type: "uuid[]", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ChatGroups", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "GroupAdmins",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ GroupId = table.Column(type: "uuid", nullable: false),
+ UserId = table.Column(type: "uuid", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_GroupAdmins", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "GroupMemberships",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ GroupId = table.Column(type: "uuid", nullable: false),
+ UserId = table.Column(type: "uuid", nullable: false),
+ IsBanned = table.Column(type: "boolean", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_GroupMemberships", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Users",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ Username = table.Column(type: "text", nullable: false),
+ Description = table.Column(type: "text", nullable: false),
+ HashPassword = table.Column(type: "text", nullable: false),
+ IconId = table.Column(type: "uuid", nullable: false),
+ CreatedOn = table.Column(type: "timestamp with time zone", nullable: false),
+ WasOnline = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Users", x => x.Id);
+ });
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "ChatGroups");
+
+ migrationBuilder.DropTable(
+ name: "GroupAdmins");
+
+ migrationBuilder.DropTable(
+ name: "GroupMemberships");
+
+ migrationBuilder.DropTable(
+ name: "Users");
+ }
+ }
+}
diff --git a/Govor.Data/Migrations/GovorDbContextModelSnapshot.cs b/Govor.Data/Migrations/GovorDbContextModelSnapshot.cs
new file mode 100644
index 0000000..ddb88b9
--- /dev/null
+++ b/Govor.Data/Migrations/GovorDbContextModelSnapshot.cs
@@ -0,0 +1,126 @@
+//
+using System;
+using System.Collections.Generic;
+using Govor.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Govor.Data.Migrations
+{
+ [DbContext(typeof(GovorDbContext))]
+ partial class GovorDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.6")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Govor.Core.Models.ChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.PrimitiveCollection>("Admins")
+ .IsRequired()
+ .HasColumnType("uuid[]");
+
+ b.PrimitiveCollection>("InviteCode")
+ .IsRequired()
+ .HasColumnType("text[]");
+
+ b.Property("IsChannel")
+ .HasColumnType("boolean");
+
+ b.Property("IsPrivate")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("ChatGroups");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.GroupAdmins", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("GroupId")
+ .HasColumnType("uuid");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.ToTable("GroupAdmins");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.GroupMembership", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("GroupId")
+ .HasColumnType("uuid");
+
+ b.Property("IsBanned")
+ .HasColumnType("boolean");
+
+ b.Property("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.ToTable("GroupMemberships");
+ });
+
+ modelBuilder.Entity("Govor.Core.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedOn")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("HashPassword")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IconId")
+ .HasColumnType("uuid");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("WasOnline")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Govor.Data/Repositories/UsersRepository.cs b/Govor.Data/Repositories/UsersRepository.cs
new file mode 100644
index 0000000..3a43c4f
--- /dev/null
+++ b/Govor.Data/Repositories/UsersRepository.cs
@@ -0,0 +1,72 @@
+using Govor.Core.Models;
+using Govor.Core.Repositories;
+
+namespace Govor.Data.Repositories;
+
+public class UsersRepository : IUsersRepository
+{
+ public Task> GetAll()
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task FindById(Guid id)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task> FindByRangeId(IEnumerable ids)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task FindByUsername(string username)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task> FindByRangeUsername(IEnumerable usernames)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task> FindUsersByCreatedDate(DateOnly createdDate)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task Add(User user)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task Update(User user)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task Remove(User user)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task Remove(Guid userId)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task Exists(User user)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task ExistsById(Guid id)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task ExistsUsername(string username)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/Govor.sln b/Govor.sln
index c9b7d9a..5d24e59 100644
--- a/Govor.sln
+++ b/Govor.sln
@@ -8,6 +8,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Govor.Core", "Govor.Core\Go
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Govor.Data", "Govor.Data\Govor.Data.csproj", "{E4EDB179-7EB5-468D-9C1F-0CBE2E5E459E}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Govor.Console", "Govor.Console\Govor.Console.csproj", "{F4535DC3-BDFB-4EB2-B259-F92B6BBB535B}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -30,6 +32,10 @@ Global
{E4EDB179-7EB5-468D-9C1F-0CBE2E5E459E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4EDB179-7EB5-468D-9C1F-0CBE2E5E459E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4EDB179-7EB5-468D-9C1F-0CBE2E5E459E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F4535DC3-BDFB-4EB2-B259-F92B6BBB535B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F4535DC3-BDFB-4EB2-B259-F92B6BBB535B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F4535DC3-BDFB-4EB2-B259-F92B6BBB535B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F4535DC3-BDFB-4EB2-B259-F92B6BBB535B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection