Небольшое переформатирование
All checks were successful
Build and deploy / Publish image (push) Successful in 9m23s

This commit is contained in:
2025-01-20 22:24:00 +03:00
parent cf9e14c0fc
commit e85cb89e1c
10 changed files with 86 additions and 209 deletions

4
.gitignore vendored
View File

@@ -497,3 +497,7 @@ src/Otchinslator/wwwroot/css/styles.css
src/Otchinslator/appsettings.Development.json src/Otchinslator/appsettings.Development.json
*.pdf *.pdf
src/.idea/.idea.Otchinslator/.idea/
src/.vscode/

35
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Используйте IntelliSense, чтобы узнать, какие атрибуты существуют для отладки C#.
// Используйте наведение для описания существующих атрибутов
// Для получения дополнительных сведений посетите https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// Если вы изменили требуемые версии .NET Framework, обязательно обновите путь к программе.
"program": "${workspaceFolder}/src/Otchinslator/bin/Debug/net8.0/Otchinslator.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Otchinslator",
"stopAtEntry": false,
// Включите запуск веб-браузера при запуске ASP.NET Core. Для получения дополнительных сведений: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/Otchinslator/Otchinslator.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/Otchinslator/Otchinslator.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/Otchinslator/Otchinslator.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@@ -1 +0,0 @@
Otchinslator

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="singleClickDiffPreview" value="1" />
<option name="vcsConfiguration" value="3" />
</component>
</project>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings" defaultProject="true" />
</project>

View File

@@ -1,184 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile profileName="IIS Express">Otchinslator/Otchinslator.csproj</projectFile>
<projectFile profileName="http">Otchinslator/Otchinslator.csproj</projectFile>
<projectFile profileName="httpWatch">Otchinslator/Otchinslator.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="93403a25-30d5-4139-b0ad-43bcefd3062b" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DpaMonitoringSettings">
<option name="autoShow" value="false" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/497a7533411fefdadb19a5f233635ae9f3e173098c7a9bf65a37c4d8cab4c1/CascadingAuthenticationState.razor" root0="FORCE_HIGHLIGHTING" root1="FORCE_HIGHLIGHTING" root2="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Otchinslator/package-lock.json" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="KubernetesApiPersistence"><![CDATA[{}]]></component>
<component name="KubernetesApiProvider"><![CDATA[{
"isMigrated": true
}]]></component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 3
}</component>
<component name="ProjectId" id="2nzEleh3aS8JO5bd3993kXbLU5j" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;.NET Launch Settings Profile.Otchinslator: IIS Express.executor&quot;: &quot;Run&quot;,
&quot;.NET Launch Settings Profile.Otchinslator: http.executor&quot;: &quot;Run&quot;,
&quot;.NET Launch Settings Profile.Otchinslator: httpWatch.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;Shell Script.Tailwind watch.executor&quot;: &quot;Run&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;HotReloadSettingsPage&quot;
}
}</component>
<component name="RunManager" selected="Compound.Build + Watch">
<configuration name="Otchinslator: IIS Express" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/Otchinslator/Otchinslator.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net8.0" />
<option name="LAUNCH_PROFILE_NAME" value="IIS Express" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="Otchinslator: http" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/Otchinslator/Otchinslator.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net8.0" />
<option name="LAUNCH_PROFILE_NAME" value="http" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<option name="RUNTIME_TYPE" value="coreclr" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="Otchinslator: httpWatch" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/Otchinslator/Otchinslator.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net8.0" />
<option name="LAUNCH_PROFILE_NAME" value="httpWatch" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
<configuration name="Otchinslator/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="otchinslator" />
<option name="containerName" value="otchinslator" />
<option name="contextFolderPath" value="C:\Users\Sergey\Projects\Otchinslator" />
<option name="portBindings">
<list>
<DockerPortBindingImpl>
<option name="containerPort" value="8080" />
<option name="hostIp" value="127.0.0.1" />
<option name="hostPort" value="8080" />
</DockerPortBindingImpl>
</list>
</option>
<option name="sourceFilePath" value="Otchinslator/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<configuration default="true" type="docker-deploy" factoryName="docker-compose.yml" temporary="true">
<deployment type="docker-compose.yml">
<settings />
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<configuration default="true" type="docker-deploy" factoryName="dockerfile" temporary="true">
<deployment type="dockerfile">
<settings />
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<configuration name="docker-compose.yml: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="sourceFilePath" value="docker-compose.yml" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<list>
<item itemvalue=".NET Launch Settings Profile.Otchinslator: httpWatch" />
<item itemvalue=".NET Launch Settings Profile.Otchinslator: http" />
<item itemvalue=".NET Launch Settings Profile.Otchinslator: IIS Express" />
<item itemvalue="Compound.Build + Watch" />
<item itemvalue="Docker.docker-compose.yml: Compose Deployment" />
<item itemvalue="Docker.Otchinslator/Dockerfile" />
<item itemvalue="Shell Script.Tailwind watch" />
</list>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="93403a25-30d5-4139-b0ad-43bcefd3062b" name="Changes" comment="" />
<created>1729967658163</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1729967658163</updated>
<workItem from="1729967660697" duration="7265000" />
<workItem from="1729977598581" duration="166000" />
<workItem from="1729978097271" duration="63000" />
<workItem from="1729978186253" duration="220000" />
<workItem from="1729978572054" duration="3648000" />
<workItem from="1729983329752" duration="6647000" />
<workItem from="1730031084252" duration="7048000" />
<workItem from="1730046117594" duration="10758000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
<component name="UnknownFeatures">
<option featureType="dependencySupport" implementationName="executable:docker" />
<option featureType="dependencySupport" implementationName="javascript:npm:tailwindcss" />
<option featureType="dependencySupport" implementationName="dotnet:Microsoft.Identity.Client" />
<option featureType="dependencySupport" implementationName="executable:kubectl" />
<option featureType="dependencySupport" implementationName="dotnet:Microsoft.Identity.Web" />
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>

View File

@@ -1,24 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Include="..\.dockerignore"> <Content Include="..\.dockerignore">
<Link>.dockerignore</Link> <Link>.dockerignore</Link>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<UpToDateCheckBuilt Include="wwwroot/css/site.css" <UpToDateCheckBuilt Include="wwwroot/css/site.css"
Set="Css" /> Set="Css" />
<UpToDateCheckBuilt Include="tailwind.config.js" <UpToDateCheckBuilt Include="tailwind.config.js"
Set="Css" /> Set="Css" />
</ItemGroup> </ItemGroup>
<!-- <Target Name="Tailwind" BeforeTargets="Build"> <!-- <Target Name="Tailwind" BeforeTargets="Build">
<Exec Command="npm run css:build"/> <Exec Command="npm run css:build"/>
</Target> --> </Target> -->
<ItemGroup> <ItemGroup>
<PackageReference Include="BlazorPageScript" <PackageReference Include="BlazorPageScript"
Version="1.0.0" /> Version="1.0.0" />
@@ -26,6 +31,7 @@
Version="3.2.0" /> Version="3.2.0" />
<PackageReference Include="Gotenberg.Sharp.API.Client" <PackageReference Include="Gotenberg.Sharp.API.Client"
Version="2.4.0" /> Version="2.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
<PackageReference Include="Microsoft.Identity.Web" <PackageReference Include="Microsoft.Identity.Web"
Version="3.2.2" /> Version="3.2.2" />
<PackageReference Include="Microsoft.Identity.Web.UI" <PackageReference Include="Microsoft.Identity.Web.UI"
@@ -37,9 +43,6 @@
<_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css" /> <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css.map" /> <_ContentIncludedByDefault Remove="wwwroot\bootstrap\bootstrap.min.css.map" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="PDFCache\" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Templates\**"> <Content Include="Templates\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

View File

@@ -7,7 +7,6 @@ namespace Otchinslator;
[ApiController] [ApiController]
[Authorize] [Authorize]
[AllowAnonymous]
public class StatementController(IStatementGenerator statementGenerator, IConfiguration configuration) : Controller public class StatementController(IStatementGenerator statementGenerator, IConfiguration configuration) : Controller
{ {
[HttpPost("/generateStatement")] [HttpPost("/generateStatement")]
@@ -33,7 +32,6 @@ public class StatementController(IStatementGenerator statementGenerator, IConfig
return BadRequest("Некорректный курс для магистратуры"); return BadRequest("Некорректный курс для магистратуры");
} }
var userEmail = User.Identity.Name; var userEmail = User.Identity.Name;
var userFIO = User.Claims.FirstOrDefault(x => x.Type == "name")?.Value; var userFIO = User.Claims.FirstOrDefault(x => x.Type == "name")?.Value;