asd
This commit is contained in:
1 parent
9ead305544
commit
ea0f426460
11 files changed
+302
-12
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectVersion>2.1</ProjectVersion>
|
<ProjectVersion>2.1</ProjectVersion>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
<DockerLaunchAction></DockerLaunchAction>
|
<DockerLaunchAction></DockerLaunchAction>
|
||||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
||||||
<DockerServiceName>medica-info</DockerServiceName>
|
<DockerServiceName>medica-info</DockerServiceName>
|
||||||
|
<UserSecretsId>7e7ef294-40d8-48c7-933d-e9daf5c5602a</UserSecretsId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="docker-compose.override.yml">
|
<None Include="docker-compose.override.yml">
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div class="top-row px-4">
|
<div class="top-row px-4">6
|
||||||
<a href="/docgpt2" target="_blank">ТЕСТ</a>
|
|
||||||
<a href="/rkl" target="_blank">РКЛ</a>
|
|
||||||
|
|
||||||
<a href="https://medica-nsk.clinic" target="_blank">О нас</a>
|
<a href="https://medica-nsk.clinic" target="_blank">О нас</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
@using System.Threading.Tasks
|
@using System.Threading.Tasks
|
||||||
@inject HttpClient Http
|
@inject HttpClient Http
|
||||||
@rendermode RenderMode.InteractiveServer
|
@rendermode RenderMode.InteractiveServer
|
||||||
|
@using medica_info.DB;
|
||||||
|
|
||||||
<PageTitle>RLK - Запрос данных</PageTitle>
|
<PageTitle>RLK - Запрос данных</PageTitle>
|
||||||
|
|
||||||
@@ -57,8 +58,7 @@
|
|||||||
private string responseMessage = "";
|
private string responseMessage = "";
|
||||||
private string rawResponse = ""; // Переменная для хранения сырого контента
|
private string rawResponse = ""; // Переменная для хранения сырого контента
|
||||||
private DateTime requestDate = DateTime.MinValue;
|
private DateTime requestDate = DateTime.MinValue;
|
||||||
|
private const string FixedToken = "e96028d7a6ed72e22eb170964a165ab8";
|
||||||
private const string FixedToken = "f2d3394efba501f7e78f4f8d3a1b2e42";
|
|
||||||
private const string FixedType = "rkl";
|
private const string FixedType = "rkl";
|
||||||
|
|
||||||
private async Task HandleSubmit()
|
private async Task HandleSubmit()
|
||||||
@@ -76,7 +76,6 @@
|
|||||||
$"docdate={requestModel.DocDate:dd.MM.yyyy}&" +
|
$"docdate={requestModel.DocDate:dd.MM.yyyy}&" +
|
||||||
$"birthdate={requestModel.BirthDate:dd.MM.yyyy}&" +
|
$"birthdate={requestModel.BirthDate:dd.MM.yyyy}&" +
|
||||||
$"token={FixedToken}";
|
$"token={FixedToken}";
|
||||||
|
|
||||||
var result = await Http.GetAsync(url);
|
var result = await Http.GetAsync(url);
|
||||||
|
|
||||||
// Получаем содержимое ответа как строку
|
// Получаем содержимое ответа как строку
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
namespace medica_info.DB
|
|
||||||
|
using medica_info.DB;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
public class AppDbContext : DbContext
|
||||||
{
|
{
|
||||||
public class ApplicationDbContext
|
public DbSet<rkl_respons> rkl_Respons { set; get; }
|
||||||
|
public DbSet<rkl_request> rkl_Requests { set; get; }
|
||||||
|
|
||||||
|
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
base.OnModelCreating(modelBuilder);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,22 @@
|
|||||||
namespace medica_info.DB
|
using DocumentFormat.OpenXml.Drawing;
|
||||||
|
using DocumentFormat.OpenXml.Presentation;
|
||||||
|
using medica_info.DB;
|
||||||
|
namespace medica_info.DB
|
||||||
{
|
{
|
||||||
public class rkl_respons
|
public class rkl_respons
|
||||||
{
|
{
|
||||||
public int Id { set; get; }
|
public int Id { set; get; }
|
||||||
public bool Found { set; get; }
|
public bool Found { set; get; }
|
||||||
public DateTime dateTime { set; get; }
|
public DateTime dateTime { set; get; }
|
||||||
|
public int rkq_request_id { set; get; }
|
||||||
|
public rkl_request rkl_Request { get; set; } = null;
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string ret = "";
|
||||||
|
if (Found == true) ret = "найден в базе, приём запрещён";
|
||||||
|
else ret = "не находмться в базе, приём разрешен";
|
||||||
|
return $"{rkl_Request.Fio}: {ret}. Дата проверки: {dateTime}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace medica_info.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(AppDbContext))]
|
||||||
|
[Migration("20260819084006_InitialCreate")]
|
||||||
|
partial class InitialCreate
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "10.0.11")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_request", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("Bdate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateDocum")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Fio")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("NumDocum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("rkl_Requests");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_respons", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<bool>("Found")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTime>("dateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("rkl_RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("rkq_request_id")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("rkl_RequestId");
|
||||||
|
|
||||||
|
b.ToTable("rkl_Respons");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_respons", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("medica_info.DB.rkl_request", "rkl_Request")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("rkl_RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("rkl_Request");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace medica_info.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class InitialCreate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "rkl_Requests",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Fio = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Bdate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
NumDocum = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DateDocum = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_rkl_Requests", x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "rkl_Respons",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Found = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
dateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
rkq_request_id = table.Column<int>(type: "int", nullable: false),
|
||||||
|
rkl_RequestId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_rkl_Respons", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_rkl_Respons_rkl_Requests_rkl_RequestId",
|
||||||
|
column: x => x.rkl_RequestId,
|
||||||
|
principalTable: "rkl_Requests",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_rkl_Respons_rkl_RequestId",
|
||||||
|
table: "rkl_Respons",
|
||||||
|
column: "rkl_RequestId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "rkl_Respons");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "rkl_Requests");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace medica_info.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(AppDbContext))]
|
||||||
|
partial class AppDbContextModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "10.0.11")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_request", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("Bdate")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DateDocum")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Fio")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("NumDocum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("rkl_Requests");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_respons", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<bool>("Found")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTime>("dateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("rkl_RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("rkq_request_id")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("rkl_RequestId");
|
||||||
|
|
||||||
|
b.ToTable("rkl_Respons");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("medica_info.DB.rkl_respons", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("medica_info.DB.rkl_request", "rkl_Request")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("rkl_RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("rkl_Request");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@ using medica_info.Components;
|
|||||||
using Microsoft.AspNetCore.Hosting.StaticWebAssets;
|
using Microsoft.AspNetCore.Hosting.StaticWebAssets;
|
||||||
using Microsoft.AspNetCore.StaticWebAssets;
|
using Microsoft.AspNetCore.StaticWebAssets;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using medica_info.DB;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
@@ -18,9 +21,17 @@ builder.Services.AddHttpClient("DocGPT", c =>
|
|||||||
// c.BaseAddress = new Uri("http://host.docker.internal:1234/");
|
// c.BaseAddress = new Uri("http://host.docker.internal:1234/");
|
||||||
c.Timeout = TimeSpan.FromMinutes(10); // Устанавливаем лимит 10 минут вместо 100 секунд
|
c.Timeout = TimeSpan.FromMinutes(10); // Устанавливаем лимит 10 минут вместо 100 секунд
|
||||||
});
|
});
|
||||||
|
var connectionString = builder.Configuration.GetConnectionString("msConnection");
|
||||||
|
|
||||||
|
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||||
|
options.UseSqlServer(connectionString));
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (!app.Environment.IsProduction())
|
if (!app.Environment.IsProduction())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,6 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Server=192.168.232.100\\MEDICA_SQL;Database=MedicaMVD;User Id=rkl_user;Password=medica@n5k;TrustServerCertificate=False;"
|
"msConnection": "Server=192.168.232.100\\MEDICA_SQL;Database=Medica_rkl;User Id=rkl_user;Password=medica@n5k;Trusted_Connection=False;MultipleActiveResultSets=false;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,13 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
|
<PackageReference Include="DocumentFormat.OpenXml" Version="3.5.1" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.11" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.11" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.11" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.11">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||||
<PackageReference Include="PdfPig" Version="0.1.15" />
|
<PackageReference Include="PdfPig" Version="0.1.15" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in new issue
Block a user