From 238c72468b6d5df3e86ea119f9ad9245f3d23e86 Mon Sep 17 00:00:00 2001
From: qwj <qwjzorro@163.com>
Date: 星期三, 26 七月 2023 15:30:22 +0800
Subject: [PATCH] 添加SqlSugar访问
---
DocumentServiceAPI.Application/GlobalUsings.cs | 2 +-
DocumentServiceAPI.Web.Entry/appsettings.json | 7 ++++++-
DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj | 6 +++++-
DocumentServiceAPI.Web.Core/Startup.cs | 7 +++++--
DocumentServiceAPI.Application/System/Services/SystemService.cs | 5 ++++-
DocumentServiceAPI.sln | 12 ++++++++++++
DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj | 5 +----
7 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj b/DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj
index 5a91029..0926e3a 100644
--- a/DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj
+++ b/DocumentServiceAPI.Application/DocumentServiceAPI.Application.csproj
@@ -22,11 +22,8 @@
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\Document.Model\Document.Model.csproj" />
<ProjectReference Include="..\DocumentServiceAPI.Core\DocumentServiceAPI.Core.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="System\Services\" />
</ItemGroup>
</Project>
diff --git a/DocumentServiceAPI.Application/GlobalUsings.cs b/DocumentServiceAPI.Application/GlobalUsings.cs
index 1f0aacd..81a78ec 100644
--- a/DocumentServiceAPI.Application/GlobalUsings.cs
+++ b/DocumentServiceAPI.Application/GlobalUsings.cs
@@ -12,4 +12,4 @@
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.CodeAnalysis;
global using System.ComponentModel.DataAnnotations;
-global using SqlSugar;
\ No newline at end of file
+global using SqlSugar;
diff --git a/DocumentServiceAPI.Application/System/Services/SystemService.cs b/DocumentServiceAPI.Application/System/Services/SystemService.cs
index f4a583e..f9aa255 100644
--- a/DocumentServiceAPI.Application/System/Services/SystemService.cs
+++ b/DocumentServiceAPI.Application/System/Services/SystemService.cs
@@ -1,4 +1,7 @@
-锘縩amespace DocumentServiceAPI.Application;
+锘縰sing Document.Model;
+using DocumentServiceAPI.Core;
+
+namespace DocumentServiceAPI.Application;
public class SystemService : ISystemService, ITransient
{
diff --git a/DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj b/DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj
index 331fb2a..77608e2 100644
--- a/DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj
+++ b/DocumentServiceAPI.Core/DocumentServiceAPI.Core.csproj
@@ -17,7 +17,11 @@
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.38" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.38" />
<PackageReference Include="Furion.Pure" Version="4.8.8.38" />
- <PackageReference Include="SqlSugarCore" Version="5.1.4.89" />
+ <PackageReference Include="SqlSugarCore" Version="5.1.4.93" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Document.Unility\Document.Unility.csproj" />
</ItemGroup>
</Project>
diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs
index 012346f..fa37eb2 100644
--- a/DocumentServiceAPI.Web.Core/Startup.cs
+++ b/DocumentServiceAPI.Web.Core/Startup.cs
@@ -1,4 +1,5 @@
-锘縰sing Furion;
+锘縰sing DocumentServiceAPI.Core;
+using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
@@ -12,6 +13,8 @@
{
services.AddConsoleFormatter();
services.AddJwt<JwtHandler>();
+ //娣诲姞Sqlsugar
+ services.AddSqlsugarSetup(App.Configuration);
services.AddCorsAccessor();
@@ -31,7 +34,7 @@
app.UseRouting();
app.UseCorsAccessor();
-
+
app.UseAuthentication();
app.UseAuthorization();
diff --git a/DocumentServiceAPI.Web.Entry/appsettings.json b/DocumentServiceAPI.Web.Entry/appsettings.json
index 8b4498e..1c7faa8 100644
--- a/DocumentServiceAPI.Web.Entry/appsettings.json
+++ b/DocumentServiceAPI.Web.Entry/appsettings.json
@@ -14,5 +14,10 @@
"DbType": "Sqlite",
"IsAutoCloseConnection": true
}
- ]
+ ],
+ "ConnectionStrings": {
+ //鏁版嵁搴撹繛鎺ュ瓧绗︿覆
+ "sqldb": "Data Source=.;Initial Catalog=CY_DocumentSystemOnline;User ID=sa;Password=123456",
+ "redis": ""
+ }
}
\ No newline at end of file
diff --git a/DocumentServiceAPI.sln b/DocumentServiceAPI.sln
index 187b1a8..88fcf06 100644
--- a/DocumentServiceAPI.sln
+++ b/DocumentServiceAPI.sln
@@ -11,6 +11,10 @@
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Web.Entry", "DocumentServiceAPI.Web.Entry\DocumentServiceAPI.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Document.Model", "Document.Model\Document.Model.csproj", "{B0733D23-0D7B-4AAC-9FCD-670B5991B7A1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Document.Unility", "Document.Unility\Document.Unility.csproj", "{8BB7AE36-ADEC-47CD-99C0-0B78A77686A9}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +37,14 @@
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B0733D23-0D7B-4AAC-9FCD-670B5991B7A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0733D23-0D7B-4AAC-9FCD-670B5991B7A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0733D23-0D7B-4AAC-9FCD-670B5991B7A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0733D23-0D7B-4AAC-9FCD-670B5991B7A1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8BB7AE36-ADEC-47CD-99C0-0B78A77686A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8BB7AE36-ADEC-47CD-99C0-0B78A77686A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8BB7AE36-ADEC-47CD-99C0-0B78A77686A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8BB7AE36-ADEC-47CD-99C0-0B78A77686A9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--
Gitblit v1.9.1