[성현모] VPKI_DataDB DB프로젝트 추가, DB스크립트 추가

This commit is contained in:
SHM
2025-08-05 10:14:25 +09:00
parent 721fa6e29b
commit ca0fa3d2a4
24 changed files with 835 additions and 0 deletions

View File

@ -0,0 +1,69 @@
{
"Server": {
"Address": "https://*",
"Port": 8080,
"IIS": false
},
"API": [
{
"ApiName": "vpkira",
"Address": "https://vpkira.hmckmc.co.kr/"
}
],
"Auth": {
"issuer": "vpki.api",
"audience": "vpki",
"accessTokenSecret": "t6zdogyrT0U1bYw3gJvMm3JHmj2Iyawr7O2WKE2truX+MK0l/XNGmpU2ofagdUWBN4DxAUv7c8xSYVv/8abL6A==",
"accessTokenExpires": 60, //minutes
"refreshTokenSecret": "1vVuoGqIqkStFI3QUXHMr0/yO1feLPnhqcfFGjZyk478+4WY7dhrUjCfVeWjmmSZYgb+rtP0X6ec+3iL35Yezw==",
"refreshTokenExpires": 1440 //minuts, 60*24 (1day)
},
"DataBase": [
{
"IP": "127.0.0.1",
"Port": 1433,
"DBName": "VPKI_AccountDB",
"DBID": 1,
"DBContext": "VpkiAccountDbContext",
"UserID": "VPKI",
"Password": "Kefico!@34"
},
{
"IP": "127.0.0.1",
"Port": 1433,
"DBName": "VPKI_AccountDB_DEV",
"DBID": 2,
"DBContext": "VpkiAccountDbContext",
"UserID": "VPKI",
"Password": "Kefico!@34"
},
{
"IP": "127.0.0.1",
"Port": 1433,
"DBName": "VPKI_DataDB",
"DBID": 1,
"DBContext": "VpkiDataDbContext",
"UserID": "VPKI",
"Password": "Kefico!@34"
},
{
"IP": "127.0.0.1",
"Port": 1433,
"DBName": "VPKI_DataDB_DEV",
"DBID": 2,
"DBContext": "VpkiDataDbContext",
"UserID": "VPKI",
"Password": "Kefico!@34"
}
],
"Openssl": {
"Path": "C:/Program Files/OpenSSL-Win64/bin/openssl.exe",
"SubCAPath": "../SubCA/",
"SubCA": {
"prov_v1": "SubCA_P02OEM.pem",
"prov_cert": "SubCA_P20OEM.pem",
"vehicle_cert": "SubCA_P20VHC.pem"
},
"RootCA": "hkmcrootca.pem"
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>SystemX.DB.VPKI_DataDB</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{5d374f06-d9fa-4159-bc84-1f3ca506f50e}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>SystemX.DB.VPKI_DataDB</RootNamespace>
<AssemblyName>SystemX.DB.VPKI_DataDB</AssemblyName>
<ModelCollation>1042,CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
<GenerateCreateScript>True</GenerateCreateScript>
<DefaultCollation>Korean_Wansung_CI_AS</DefaultCollation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
<Folder Include="dbo" />
<Folder Include="dbo\Functions" />
<Folder Include="dbo\Scripts" />
<Folder Include="dbo\StoredProcedures" />
<Folder Include="dbo\Tables" />
</ItemGroup>
<ItemGroup>
<Build Include="dbo\Tables\tCertificate.sql" />
<Build Include="dbo\Tables\tOcsp.sql" />
<Build Include="dbo\Tables\tTbscsr.sql" />
<Build Include="dbo\Tables\tVerifyResult.sql" />
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>xcopy /y $(ProjectDir)$(OutputPath)$(TargetName)_Create.sql $(SolutionDir)..\..\DBPatch\sqlScripts\
xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dacpac $(SolutionDir)..\..\DBPatch\sqlScripts\dacpac\</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,15 @@
CREATE TABLE [dbo].[tCertificate]
(
[cCuid] BIGINT NOT NULL PRIMARY KEY,
[cCsrsignature] NVARCHAR(1024) NOT NULL,
[cTierCode]NVARCHAR(20) NOT NULL,
[cUnitCode]NVARCHAR(20) NOT NULL,
[cVehicleCode]NVARCHAR(20) NOT NULL,
[cLocalCode]NVARCHAR(20) NOT NULL,
[cBrandCode]NVARCHAR(20) NOT NULL,
[cCsr] NVARCHAR(2048) NOT NULL,
[cCert] NVARCHAR(2048) NOT NULL,
[cMessage] NVARCHAR(250) NOT NULL,
[cIssueCount] INT NOT NULL,
[cDateTime] DATETIME2 NOT NULL
)

View File

@ -0,0 +1,8 @@
CREATE TABLE [dbo].[tOcsp]
(
[cCuid] BIGINT NOT NULL PRIMARY KEY,
[cStatus] NVARCHAR(20) NOT NULL,
[cVerify] NVARCHAR(20) NOT NULL,
[cOcsp] NVARCHAR(MAX) NULL,
[cDateTime] DATETIME2 NOT NULL
)

View File

@ -0,0 +1,19 @@
CREATE TABLE [dbo].[tTbscsr]
(
[cCuid] BIGINT NOT NULL PRIMARY KEY IDENTITY(1,1),
[cIftid] NVARCHAR(100) NOT NULL,
[cMacaddr] NVARCHAR(100) NOT NULL,
[cWmi] NVARCHAR(20) NOT NULL,
[cIdType] NVARCHAR(10)NOT NULL,
[cSupplierId] NVARCHAR(10) NOT NULL,
[cDc] NVARCHAR(20) NOT NULL,
[cTierCode]NVARCHAR(20) NOT NULL,
[cUnitCode]NVARCHAR(20) NOT NULL,
[cPublickey]NVARCHAR(1024) NOT NULL,
[cCertType]NVARCHAR(20) NOT NULL,
[cOriginTbscsr] NVARCHAR(4000) NOT NULL,
[cHashedTbscsr] NVARCHAR(1024) NOT NULL,
[cPcid] NVARCHAR(50) NOT NULL,
[cDn]NVARCHAR(250) NOT NULL,
[cDateTime] DATETIME2 NOT NULL
)

View File

@ -0,0 +1,5 @@
CREATE TABLE [dbo].[tVerifyResult]
(
[cCuid] BIGINT NOT NULL PRIMARY KEY,
[cResult] NCHAR(20) NOT NULL
)

View File

@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace SystemX.Core.DB;
public partial class VPKI_DataDBContext : DbContext
{
public VPKI_DataDBContext(DbContextOptions<VPKI_DataDBContext> options)
: base(options)
{
}
public virtual DbSet<tCertificate> tCertificates { get; set; }
public virtual DbSet<tOcsp> tOcsps { get; set; }
public virtual DbSet<tTbscsr> tTbscsrs { get; set; }
public virtual DbSet<tVerifyResult> tVerifyResults { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<tCertificate>(entity =>
{
entity.HasKey(e => e.cCuid).HasName("PK__tCertifi__2AA00D94D7A91CE3");
entity.ToTable("tCertificate");
entity.Property(e => e.cCuid).ValueGeneratedNever();
entity.Property(e => e.cBrandCode).HasMaxLength(20);
entity.Property(e => e.cCert).HasMaxLength(2048);
entity.Property(e => e.cCsr).HasMaxLength(2048);
entity.Property(e => e.cCsrsignature).HasMaxLength(1024);
entity.Property(e => e.cLocalCode).HasMaxLength(20);
entity.Property(e => e.cMessage).HasMaxLength(250);
entity.Property(e => e.cTierCode).HasMaxLength(20);
entity.Property(e => e.cUnitCode).HasMaxLength(20);
entity.Property(e => e.cVehicleCode).HasMaxLength(20);
});
modelBuilder.Entity<tOcsp>(entity =>
{
entity.HasKey(e => e.cCuid).HasName("PK__tOcsp__2AA00D94489D8AA6");
entity.ToTable("tOcsp");
entity.Property(e => e.cCuid).ValueGeneratedNever();
entity.Property(e => e.cStatus).HasMaxLength(20);
entity.Property(e => e.cVerify).HasMaxLength(20);
});
modelBuilder.Entity<tTbscsr>(entity =>
{
entity.HasKey(e => e.cCuid).HasName("PK__tTbscsr__2AA00D9463096B25");
entity.ToTable("tTbscsr");
entity.Property(e => e.cCertType).HasMaxLength(20);
entity.Property(e => e.cDc).HasMaxLength(20);
entity.Property(e => e.cDn).HasMaxLength(250);
entity.Property(e => e.cHashedTbscsr).HasMaxLength(1024);
entity.Property(e => e.cIdType).HasMaxLength(10);
entity.Property(e => e.cIftid).HasMaxLength(100);
entity.Property(e => e.cMacaddr).HasMaxLength(100);
entity.Property(e => e.cOriginTbscsr).HasMaxLength(4000);
entity.Property(e => e.cPcid).HasMaxLength(50);
entity.Property(e => e.cPublickey).HasMaxLength(1024);
entity.Property(e => e.cSupplierId).HasMaxLength(10);
entity.Property(e => e.cTierCode).HasMaxLength(20);
entity.Property(e => e.cUnitCode).HasMaxLength(20);
entity.Property(e => e.cWmi).HasMaxLength(20);
});
modelBuilder.Entity<tVerifyResult>(entity =>
{
entity.HasKey(e => e.cCuid).HasName("PK__tVerifyR__2AA00D94B21AB01E");
entity.ToTable("tVerifyResult");
entity.Property(e => e.cCuid).ValueGeneratedNever();
entity.Property(e => e.cResult)
.HasMaxLength(20)
.IsFixedLength();
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace SystemX.Core.DB;
public partial class tCertificate
{
public long cCuid { get; set; }
public string cCsrsignature { get; set; } = null!;
public string cTierCode { get; set; } = null!;
public string cUnitCode { get; set; } = null!;
public string cVehicleCode { get; set; } = null!;
public string cLocalCode { get; set; } = null!;
public string cBrandCode { get; set; } = null!;
public string cCsr { get; set; } = null!;
public string cCert { get; set; } = null!;
public string cMessage { get; set; } = null!;
public int cIssueCount { get; set; }
public DateTime cDateTime { get; set; }
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace SystemX.Core.DB;
public partial class tOcsp
{
public long cCuid { get; set; }
public string cStatus { get; set; } = null!;
public string cVerify { get; set; } = null!;
public string? cOcsp { get; set; }
public DateTime cDateTime { get; set; }
}

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace SystemX.Core.DB;
public partial class tTbscsr
{
public long cCuid { get; set; }
public string cIftid { get; set; } = null!;
public string cMacaddr { get; set; } = null!;
public string cWmi { get; set; } = null!;
public string cIdType { get; set; } = null!;
public string cSupplierId { get; set; } = null!;
public string cDc { get; set; } = null!;
public string cTierCode { get; set; } = null!;
public string cUnitCode { get; set; } = null!;
public string cPublickey { get; set; } = null!;
public string cCertType { get; set; } = null!;
public string cOriginTbscsr { get; set; } = null!;
public string cHashedTbscsr { get; set; } = null!;
public string cPcid { get; set; } = null!;
public string cDn { get; set; } = null!;
public DateTime cDateTime { get; set; }
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace SystemX.Core.DB;
public partial class tVerifyResult
{
public long cCuid { get; set; }
public string cResult { get; set; } = null!;
}

View File

@ -13,6 +13,8 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SystemX.DB.AccountDB", "DB\
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SystemX.DB.UniqueKeyDB", "DB\SystemX.DB.UniqueKeyDB\SystemX.DB.UniqueKeyDB.sqlproj", "{C67F3F97-1D52-4C75-A04F-16ED41822CCD}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SystemX.DB.VPKI_DataDB", "DB\SystemX.DB.VPKI_DataDB\SystemX.DB.VPKI_DataDB.sqlproj", "{5D374F06-D9FA-4159-BC84-1F3CA506F50E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -39,6 +41,12 @@ Global
{C67F3F97-1D52-4C75-A04F-16ED41822CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C67F3F97-1D52-4C75-A04F-16ED41822CCD}.Release|Any CPU.Build.0 = Release|Any CPU
{C67F3F97-1D52-4C75-A04F-16ED41822CCD}.Release|Any CPU.Deploy.0 = Release|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Release|Any CPU.Build.0 = Release|Any CPU
{5D374F06-D9FA-4159-BC84-1F3CA506F50E}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -46,6 +54,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{B44C85FA-BD31-419F-8481-477E166A5753} = {C8D5274F-AC00-46C7-1F8D-E88E81087A52}
{C67F3F97-1D52-4C75-A04F-16ED41822CCD} = {C8D5274F-AC00-46C7-1F8D-E88E81087A52}
{5D374F06-D9FA-4159-BC84-1F3CA506F50E} = {C8D5274F-AC00-46C7-1F8D-E88E81087A52}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A26A3BD0-2161-41FA-949A-DEA966E8F798}