add discord bot

change net6.0 net7.0
This commit is contained in:
Дмитрий Шиманский
2023-10-26 11:35:42 +03:00
parent 7c6fafa9e6
commit 9a8a4cad5d
35 changed files with 1132 additions and 37 deletions

18
Database/AppDbContext.cs Normal file
View File

@@ -0,0 +1,18 @@
using DiscordApp.Database.Tables;
using Microsoft.EntityFrameworkCore;
namespace DiscordApp.Database
{
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
public DbSet<Passport> Passport { get; set; }
public DbSet<Autobranches> Autobranches { get; set; }
public DbSet<Autoreactions> Autoreactions { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DiscordApp.Database.Tables
{
[Table("Autobranches", Schema = "public")]
public class Autobranches
{
[Key]
public ulong ChannelId { get; set; }
public string BranchName { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DiscordApp.Database.Tables
{
[Table("Autoreactions", Schema = "public")]
public class Autoreactions
{
[Key]
public ulong ChannelId { get; set; }
public string EmoteId { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using DiscordApp.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DiscordApp.Database.Tables
{
[Table("Passport", Schema = "public")]
public class Passport
{
[Key]
public int Id { get; set; }
public ulong Employee { get; set; }
public string Applicant { get; set; }
public long Date { get; set; }
public Supporter Support { get; set; }
public string Gender { get; set; }
public string RpName { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using DiscordApp.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DiscordApp.Database.Tables
{
[Table("Patents", Schema = "public")]
public class Patents
{
public string Employee { get; set; }
public string Applicant { get; set; }
public int Date { get; set; }
[Key]
public int[] Number { get; set; }
public Supporter Support { get; set; }
public string Gender { get; set; }
public string Name { get; set; }
}
}