[성현모] AccountDB Core로 이동
This commit is contained in:
BIN
Projects/DLL/SystemX.Core.DB.dll
Normal file
BIN
Projects/DLL/SystemX.Core.DB.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace SystemX.Core.DB;
|
||||||
|
|
||||||
|
public partial class AccountDBContext : DbContext
|
||||||
|
{
|
||||||
|
public AccountDBContext(DbContextOptions<AccountDBContext> options)
|
||||||
|
: base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<tRefreshToken> tRefreshTokens { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<tRole> tRoles { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<tUser> tUsers { get; set; }
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.Entity<tRefreshToken>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.cAuid).HasName("PK__tRefresh__FBF08554C9ECDB70");
|
||||||
|
|
||||||
|
entity.ToTable("tRefreshToken");
|
||||||
|
|
||||||
|
entity.Property(e => e.cAuid).HasMaxLength(250);
|
||||||
|
entity.Property(e => e.cRefreshToken).HasMaxLength(1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<tRole>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.cAuid).HasName("PK__tRole__FBF0855413CC5A4E");
|
||||||
|
|
||||||
|
entity.ToTable("tRole");
|
||||||
|
|
||||||
|
entity.Property(e => e.cAuid).HasMaxLength(250);
|
||||||
|
entity.Property(e => e.cRoleName).HasMaxLength(20);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<tUser>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.cUserID).HasName("PK__tUser__A75DC19A4B18524F");
|
||||||
|
|
||||||
|
entity.ToTable("tUser");
|
||||||
|
|
||||||
|
entity.Property(e => e.cUserID).HasMaxLength(50);
|
||||||
|
entity.Property(e => e.cAuid).HasMaxLength(250);
|
||||||
|
entity.Property(e => e.cPasswordHashed).HasMaxLength(250);
|
||||||
|
});
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SystemX.Core.DB;
|
||||||
|
|
||||||
|
public partial class tRefreshToken
|
||||||
|
{
|
||||||
|
public string cAuid { get; set; } = null!;
|
||||||
|
|
||||||
|
public string cRefreshToken { get; set; } = null!;
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SystemX.Core.DB;
|
||||||
|
|
||||||
|
public partial class tRole
|
||||||
|
{
|
||||||
|
public string cAuid { get; set; } = null!;
|
||||||
|
|
||||||
|
public byte cRoleID { get; set; }
|
||||||
|
|
||||||
|
public string cRoleName { get; set; } = null!;
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SystemX.Core.DB;
|
||||||
|
|
||||||
|
public partial class tUser
|
||||||
|
{
|
||||||
|
public string cUserID { get; set; } = null!;
|
||||||
|
|
||||||
|
public string cAuid { get; set; } = null!;
|
||||||
|
|
||||||
|
public string cPasswordHashed { get; set; } = null!;
|
||||||
|
|
||||||
|
public byte cState { get; set; }
|
||||||
|
|
||||||
|
public DateTime cCreateDateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? cLastLoginDateTime { get; set; }
|
||||||
|
}
|
||||||
@ -7,15 +7,19 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.5">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dll $(SolutionDir)..\DLL\" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemX.Core", "SystemX.Cor
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SystemX.DB.AccountDB", "SystemX.DB.AccountDB\SystemX.DB.AccountDB.sqlproj", "{B44C85FA-BD31-419F-8481-477E166A5753}"
|
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SystemX.DB.AccountDB", "SystemX.DB.AccountDB\SystemX.DB.AccountDB.sqlproj", "{B44C85FA-BD31-419F-8481-477E166A5753}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemX.Core.DB", "SystemX.Core.DB\SystemX.Core.DB.csproj", "{78647721-F9BD-4876-89D5-95A2A0F3ADA7}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -23,6 +25,10 @@ Global
|
|||||||
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
{B44C85FA-BD31-419F-8481-477E166A5753}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
|
{78647721-F9BD-4876-89D5-95A2A0F3ADA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{78647721-F9BD-4876-89D5-95A2A0F3ADA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{78647721-F9BD-4876-89D5-95A2A0F3ADA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{78647721-F9BD-4876-89D5-95A2A0F3ADA7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
::AccountDB
|
::AccountDB
|
||||||
cd ../SystemX.Core/SystemX.Core
|
cd ../SystemX.Core/SystemX.Core.DB
|
||||||
|
|
||||||
::WebApi
|
dotnet ef dbcontext scaffold "server=127.0.0.1; user id=SystemX; password=X; database=AccountDB; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer --namespace SystemX.Core.DB --context-dir AccountDB\Context --output-dir AccountDB\Tables -f --use-database-names --no-onconfiguring
|
||||||
dotnet ef dbcontext scaffold "server=127.0.0.1; user id=SystemX; password=X; database=AccountDB; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer --namespace SystemX.Core.DBContext --context-dir DBContext\AccountDB\Context --output-dir DBContext\AccountDB\Tables -f
|
|
||||||
@ -20,7 +20,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\WebApi.Library.DBContext\WebApi.Library.DBContext.csproj" />
|
|
||||||
<ProjectReference Include="..\WebApi.Library\WebApi.Library.csproj" />
|
<ProjectReference Include="..\WebApi.Library\WebApi.Library.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@ -28,6 +27,9 @@
|
|||||||
<Reference Include="SystemX.Core">
|
<Reference Include="SystemX.Core">
|
||||||
<HintPath>..\..\DLL\SystemX.Core.dll</HintPath>
|
<HintPath>..\..\DLL\SystemX.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="SystemX.Core.DB">
|
||||||
|
<HintPath>..\..\DLL\SystemX.Core.DB.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using AuthApi.Services;
|
using AuthApi.Services;
|
||||||
using Azure.Core;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
using AuthApi.Services;
|
using AuthApi.Services;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using SystemX.Core.Services;
|
using SystemX.Core.Services;
|
||||||
using WebApi.Library.Config;
|
using WebApi.Library.Config;
|
||||||
using WebApi.Library.DBContext.DB.DBContext.AccountDB.Context;
|
|
||||||
|
|
||||||
string configDir = @"../../Config";
|
string configDir = @"../../Config";
|
||||||
string configFileName = "WebApi.AuthApi.Config.json";
|
string configFileName = "WebApi.AuthApi.Config.json";
|
||||||
|
|||||||
@ -2,12 +2,9 @@
|
|||||||
using SystemX.Core.Services;
|
using SystemX.Core.Services;
|
||||||
using SystemX.Core;
|
using SystemX.Core;
|
||||||
using WebApi.Library.Config;
|
using WebApi.Library.Config;
|
||||||
using SystemX.Core.Config.Model;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using SystemX.Core.DB;
|
using SystemX.Core.DB;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using WebApi.Library.DBContext.DB.DBContext.AccountDB.Context;
|
|
||||||
using WebApi.Library.DBContext.DB.DBContext.AccountDB.Tables;
|
|
||||||
|
|
||||||
namespace AuthApi.Services
|
namespace AuthApi.Services
|
||||||
{
|
{
|
||||||
@ -45,25 +42,25 @@ namespace AuthApi.Services
|
|||||||
{
|
{
|
||||||
if (context is not null)
|
if (context is not null)
|
||||||
{
|
{
|
||||||
var user = await context.TUsers.AsNoTracking().Where(x => x.CUserId.ToLower() == registerModel.UserID.ToLower()).ToListAsync();
|
var user = await context.tUsers.AsNoTracking().Where(x => x.cUserID.ToLower() == registerModel.UserID.ToLower()).ToListAsync();
|
||||||
if (user?.Count <= 0)
|
if (user?.Count <= 0)
|
||||||
{
|
{
|
||||||
string auid = Guid.NewGuid().ToString();
|
string auid = Guid.NewGuid().ToString();
|
||||||
//user
|
//user
|
||||||
TUser newUser = new TUser
|
tUser newUser = new tUser
|
||||||
{
|
{
|
||||||
CAuid = auid,
|
cAuid = auid,
|
||||||
CUserId = registerModel.UserID,
|
cUserID = registerModel.UserID,
|
||||||
CPasswordHashed = registerModel.Password,
|
cPasswordHashed = registerModel.Password,
|
||||||
CCreateDateTime = DateTime.Now,
|
cCreateDateTime = DateTime.Now,
|
||||||
CLastLoginDateTime = new DateTime()
|
cLastLoginDateTime = new DateTime()
|
||||||
};
|
};
|
||||||
//role
|
//role
|
||||||
TRole newUserRole = new TRole
|
tRole newUserRole = new tRole
|
||||||
{
|
{
|
||||||
CAuid = auid,
|
cAuid = auid,
|
||||||
CRoleId = Convert.ToByte(registerModel.Role),
|
cRoleID = Convert.ToByte(registerModel.Role),
|
||||||
CRoleName = registerModel.Role.ToString()
|
cRoleName = registerModel.Role.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var transaction = await context.CreateTransactionAsync())
|
using (var transaction = await context.CreateTransactionAsync())
|
||||||
@ -119,29 +116,29 @@ namespace AuthApi.Services
|
|||||||
using (var transaction = await context.CreateTransactionAsync(IsolationLevel.ReadUncommitted))
|
using (var transaction = await context.CreateTransactionAsync(IsolationLevel.ReadUncommitted))
|
||||||
{
|
{
|
||||||
//select user
|
//select user
|
||||||
var selectUser = await context.TUsers.AsNoTracking().FirstOrDefaultAsync(x => x.CUserId.ToLower() == loginModel!.UserID!.ToLower());
|
var selectUser = await context.tUsers.AsNoTracking().FirstOrDefaultAsync(x => x.cUserID.ToLower() == loginModel!.UserID!.ToLower());
|
||||||
if (selectUser is not null)
|
if (selectUser is not null)
|
||||||
{
|
{
|
||||||
if (selectUser.CPasswordHashed == loginModel?.Password)
|
if (selectUser.cPasswordHashed == loginModel?.Password)
|
||||||
{
|
{
|
||||||
//select role
|
//select role
|
||||||
var selectRole = await context.TRoles.FindAsync(selectUser.CAuid);
|
var selectRole = await context.tRoles.FindAsync(selectUser.cAuid);
|
||||||
if (selectRole != null)
|
if (selectRole != null)
|
||||||
{
|
{
|
||||||
response.Role = (UserRole)Enum.Parse(typeof(UserRole), selectRole.CRoleId.ToString());
|
response.Role = (UserRole)Enum.Parse(typeof(UserRole), selectRole.cRoleID.ToString());
|
||||||
response.RoleName = selectRole.CRoleName;
|
response.RoleName = selectRole.cRoleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Session.Add(response);
|
Session.Add(response);
|
||||||
if (selectUser.CState == (byte)UserState.Active)
|
if (selectUser.cState == (byte)UserState.Active)
|
||||||
{
|
{
|
||||||
response.EC = ERROR_CODE.EC_OK;
|
response.EC = ERROR_CODE.EC_OK;
|
||||||
}
|
}
|
||||||
else if (selectUser.CState == (byte)UserState.Inactive)
|
else if (selectUser.cState == (byte)UserState.Inactive)
|
||||||
{
|
{
|
||||||
response.EC = ERROR_CODE.EC_USER_LOGIN_INAVTIVE;
|
response.EC = ERROR_CODE.EC_USER_LOGIN_INAVTIVE;
|
||||||
}
|
}
|
||||||
else if (selectUser.CState == (byte)UserState.Block)
|
else if (selectUser.cState == (byte)UserState.Block)
|
||||||
{
|
{
|
||||||
response.EC = ERROR_CODE.EC_USER_LOGIN_BLOCKED;
|
response.EC = ERROR_CODE.EC_USER_LOGIN_BLOCKED;
|
||||||
}
|
}
|
||||||
@ -185,7 +182,7 @@ namespace AuthApi.Services
|
|||||||
{
|
{
|
||||||
if (context is not null)
|
if (context is not null)
|
||||||
{
|
{
|
||||||
var selectUser = await context.TUsers.AsNoTracking().FirstOrDefaultAsync(x => x.CUserId.ToLower() == loginModel!.UserID!.ToLower());
|
var selectUser = await context.tUsers.AsNoTracking().FirstOrDefaultAsync(x => x.cUserID.ToLower() == loginModel!.UserID!.ToLower());
|
||||||
if (selectUser is not null)
|
if (selectUser is not null)
|
||||||
{
|
{
|
||||||
using (var transaction = await context.CreateTransactionAsync())
|
using (var transaction = await context.CreateTransactionAsync())
|
||||||
@ -193,24 +190,24 @@ namespace AuthApi.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//user info
|
//user info
|
||||||
selectUser.CLastLoginDateTime = DateTime.Now;
|
selectUser.cLastLoginDateTime = DateTime.Now;
|
||||||
context.Update(selectUser);
|
context.Update(selectUser);
|
||||||
|
|
||||||
//refresh token
|
//refresh token
|
||||||
var findRefreshToken = await context.TRefreshTokens.AsNoTracking().FirstOrDefaultAsync(x => x.CAuid == selectUser.CAuid);
|
var findRefreshToken = await context.tRefreshTokens.AsNoTracking().FirstOrDefaultAsync(x => x.cAuid == selectUser.cAuid);
|
||||||
//null이면(없으면) add
|
//null이면(없으면) add
|
||||||
if (findRefreshToken == null)
|
if (findRefreshToken == null)
|
||||||
{
|
{
|
||||||
await context.AddAsync(new TRefreshToken
|
await context.AddAsync(new tRefreshToken
|
||||||
{
|
{
|
||||||
CAuid = selectUser.CAuid,
|
cAuid = selectUser.cAuid,
|
||||||
CRefreshToken = $"{RefreshToken}"
|
cRefreshToken= $"{RefreshToken}"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//있으면 update
|
//있으면 update
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
findRefreshToken.CRefreshToken = $"{RefreshToken}";
|
findRefreshToken.cRefreshToken = $"{RefreshToken}";
|
||||||
context.Update(findRefreshToken);
|
context.Update(findRefreshToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,10 +261,10 @@ namespace AuthApi.Services
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AccountDbContext? GetAccountDBContext(DbContextProvider provider, int dbID)
|
private AccountDBContext? GetAccountDBContext(DbContextProvider provider, int dbID)
|
||||||
{
|
{
|
||||||
var connectionString = _configService?.GetConfig()?.DataBase?.Find(x => x.DBID == dbID);
|
var connectionString = _configService?.GetConfig()?.DataBase?.Find(x => x.DBID == dbID);
|
||||||
return provider?.GetDBContext<AccountDbContext>($"{connectionString?.DBName}");
|
return provider?.GetDBContext<AccountDBContext>($"{connectionString?.DBName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,80 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using WebApi.Library.DBContext.DB.DBContext.AccountDB.Tables;
|
|
||||||
|
|
||||||
namespace WebApi.Library.DBContext.DB.DBContext.AccountDB.Context;
|
|
||||||
|
|
||||||
public partial class AccountDbContext : DbContext
|
|
||||||
{
|
|
||||||
public AccountDbContext()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccountDbContext(DbContextOptions<AccountDbContext> options)
|
|
||||||
: base(options)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual DbSet<TRefreshToken> TRefreshTokens { get; set; }
|
|
||||||
|
|
||||||
public virtual DbSet<TRole> TRoles { get; set; }
|
|
||||||
|
|
||||||
public virtual DbSet<TUser> TUsers { get; set; }
|
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
modelBuilder.Entity<TRefreshToken>(entity =>
|
|
||||||
{
|
|
||||||
entity.HasKey(e => e.CAuid).HasName("PK__tRefresh__FBF0855465EB95AB");
|
|
||||||
|
|
||||||
entity.ToTable("tRefreshToken");
|
|
||||||
|
|
||||||
entity.Property(e => e.CAuid)
|
|
||||||
.HasMaxLength(250)
|
|
||||||
.HasColumnName("cAuid");
|
|
||||||
entity.Property(e => e.CRefreshToken)
|
|
||||||
.HasMaxLength(1000)
|
|
||||||
.HasColumnName("cRefreshToken");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<TRole>(entity =>
|
|
||||||
{
|
|
||||||
entity.HasKey(e => e.CAuid).HasName("PK__tRole__FBF085540BB887D7");
|
|
||||||
|
|
||||||
entity.ToTable("tRole");
|
|
||||||
|
|
||||||
entity.Property(e => e.CAuid)
|
|
||||||
.HasMaxLength(250)
|
|
||||||
.HasColumnName("cAuid");
|
|
||||||
entity.Property(e => e.CRoleId).HasColumnName("cRoleID");
|
|
||||||
entity.Property(e => e.CRoleName)
|
|
||||||
.HasMaxLength(20)
|
|
||||||
.HasColumnName("cRoleName");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<TUser>(entity =>
|
|
||||||
{
|
|
||||||
entity.HasKey(e => e.CUserId).HasName("PK__tUser__A75DC19A721265FF");
|
|
||||||
|
|
||||||
entity.ToTable("tUser");
|
|
||||||
|
|
||||||
entity.Property(e => e.CUserId)
|
|
||||||
.HasMaxLength(50)
|
|
||||||
.HasColumnName("cUserID");
|
|
||||||
entity.Property(e => e.CAuid)
|
|
||||||
.HasMaxLength(250)
|
|
||||||
.HasColumnName("cAuid");
|
|
||||||
entity.Property(e => e.CCreateDateTime).HasColumnName("cCreateDateTime");
|
|
||||||
entity.Property(e => e.CLastLoginDateTime).HasColumnName("cLastLoginDateTime");
|
|
||||||
entity.Property(e => e.CPasswordHashed)
|
|
||||||
.HasMaxLength(250)
|
|
||||||
.HasColumnName("cPasswordHashed");
|
|
||||||
entity.Property(e => e.CState).HasColumnName("cState");
|
|
||||||
});
|
|
||||||
|
|
||||||
OnModelCreatingPartial(modelBuilder);
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace WebApi.Library.DBContext.DB.DBContext.AccountDB.Tables;
|
|
||||||
|
|
||||||
public partial class TRefreshToken
|
|
||||||
{
|
|
||||||
public string CAuid { get; set; } = null!;
|
|
||||||
|
|
||||||
public string CRefreshToken { get; set; } = null!;
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace WebApi.Library.DBContext.DB.DBContext.AccountDB.Tables;
|
|
||||||
|
|
||||||
public partial class TRole
|
|
||||||
{
|
|
||||||
public string CAuid { get; set; } = null!;
|
|
||||||
|
|
||||||
public byte CRoleId { get; set; }
|
|
||||||
|
|
||||||
public string CRoleName { get; set; } = null!;
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace WebApi.Library.DBContext.DB.DBContext.AccountDB.Tables;
|
|
||||||
|
|
||||||
public partial class TUser
|
|
||||||
{
|
|
||||||
public string CUserId { get; set; } = null!;
|
|
||||||
|
|
||||||
public string CAuid { get; set; } = null!;
|
|
||||||
|
|
||||||
public string CPasswordHashed { get; set; } = null!;
|
|
||||||
|
|
||||||
public byte CState { get; set; }
|
|
||||||
|
|
||||||
public DateTime CCreateDateTime { get; set; }
|
|
||||||
|
|
||||||
public DateTime? CLastLoginDateTime { get; set; }
|
|
||||||
}
|
|
||||||
@ -14,6 +14,11 @@
|
|||||||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="SystemX.Core">
|
<Reference Include="SystemX.Core">
|
||||||
<HintPath>..\..\DLL\SystemX.Core.dll</HintPath>
|
<HintPath>..\..\DLL\SystemX.Core.dll</HintPath>
|
||||||
|
|||||||
@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthApi", "AuthApi\AuthApi.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.Library", "WebApi.Library\WebApi.Library.csproj", "{1B109CFE-B860-4125-8F2B-06D95DE85E91}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.Library", "WebApi.Library\WebApi.Library.csproj", "{1B109CFE-B860-4125-8F2B-06D95DE85E91}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApi.Library.DBContext", "WebApi.Library.DBContext\WebApi.Library.DBContext.csproj", "{92599205-8D5B-4630-B669-AA390193BC9E}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{C8D5274F-AC00-46C7-1F8D-E88E81087A52}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{C8D5274F-AC00-46C7-1F8D-E88E81087A52}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
..\Config\WebApi.AuthApi.Config.json = ..\Config\WebApi.AuthApi.Config.json
|
..\Config\WebApi.AuthApi.Config.json = ..\Config\WebApi.AuthApi.Config.json
|
||||||
@ -28,10 +26,6 @@ Global
|
|||||||
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1B109CFE-B860-4125-8F2B-06D95DE85E91}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{92599205-8D5B-4630-B669-AA390193BC9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{92599205-8D5B-4630-B669-AA390193BC9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{92599205-8D5B-4630-B669-AA390193BC9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{92599205-8D5B-4630-B669-AA390193BC9E}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user