New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <NoWarn>1701;1702;1591</NoWarn> |
| | | <DocumentationFile>DocumentServiceAPI.Application.xml</DocumentationFile> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | </PropertyGroup> |
| | | |
| | | |
| | | |
| | | <ItemGroup> |
| | | <None Remove="applicationsettings.json" /> |
| | | <None Remove="DocumentServiceAPI.Application.xml" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Content Include="applicationsettings.json"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </Content> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Core\DocumentServiceAPI.Core.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="System\Services\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
New file |
| | |
| | | <?xml version="1.0"?> |
| | | <doc> |
| | | <assembly> |
| | | <name>DocumentServiceAPI.Application</name> |
| | | </assembly> |
| | | <members> |
| | | <member name="T:DocumentServiceAPI.Application.SystemAppService"> |
| | | <summary> |
| | | ç³»ç»æå¡æ¥å£ |
| | | </summary> |
| | | </member> |
| | | <member name="M:DocumentServiceAPI.Application.SystemAppService.GetDescription"> |
| | | <summary> |
| | | è·åç³»ç»æè¿° |
| | | </summary> |
| | | <returns></returns> |
| | | </member> |
| | | </members> |
| | | </doc> |
New file |
| | |
| | | global using Furion; |
| | | global using Furion.DataEncryption; |
| | | global using Furion.DataValidation; |
| | | global using Furion.DependencyInjection; |
| | | global using Furion.DynamicApiController; |
| | | global using Furion.Extensions; |
| | | global using Furion.FriendlyException; |
| | | global using Furion.Logging; |
| | | global using Mapster; |
| | | global using Microsoft.AspNetCore.Authorization; |
| | | global using Microsoft.AspNetCore.Http; |
| | | global using Microsoft.AspNetCore.Mvc; |
| | | global using Microsoft.CodeAnalysis; |
| | | global using System.ComponentModel.DataAnnotations; |
| | | global using SqlSugar; |
New file |
| | |
| | | namespace DocumentServiceAPI.Application; |
| | | |
| | | public class Mapper : IRegister |
| | | { |
| | | public void Register(TypeAdapterConfig config) |
| | | { |
| | | } |
| | | } |
New file |
| | |
| | | namespace DocumentServiceAPI.Application; |
| | | |
| | | public interface ISystemService |
| | | { |
| | | string GetDescription(); |
| | | } |
New file |
| | |
| | | namespace DocumentServiceAPI.Application; |
| | | |
| | | public class SystemService : ISystemService, ITransient |
| | | { |
| | | public string GetDescription() |
| | | { |
| | | return "让 .NET å¼åæ´ç®åï¼æ´éç¨ï¼æ´æµè¡ã"; |
| | | } |
| | | } |
New file |
| | |
| | | namespace DocumentServiceAPI.Application; |
| | | |
| | | /// <summary> |
| | | /// ç³»ç»æå¡æ¥å£ |
| | | /// </summary> |
| | | public class SystemAppService : IDynamicApiController |
| | | { |
| | | private readonly ISystemService _systemService; |
| | | public SystemAppService(ISystemService systemService) |
| | | { |
| | | _systemService = systemService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åç³»ç»æè¿° |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetDescription() |
| | | { |
| | | return _systemService.GetDescription(); |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", |
| | | "SpecificationDocumentSettings": { |
| | | "DocumentTitle": "Furion | è§è忥å£", |
| | | "GroupOpenApiInfos": [ |
| | | { |
| | | "Group": "Default", |
| | | "Title": "è§è忥壿¼ç¤º", |
| | | "Description": "让 .NET å¼åæ´ç®åï¼æ´éç¨ï¼æ´æµè¡ã", |
| | | "Version": "1.0.0", |
| | | "TermsOfService": "http://furion.baiqian.ltd", |
| | | "Contact": { |
| | | "Name": "ç¾å°å§", |
| | | "Url": "https://gitee.com/monksoul", |
| | | "Email": "monksoul@outlook.com" |
| | | }, |
| | | "License": { |
| | | "Name": "Apache-2.0", |
| | | "Url": "https://gitee.com/dotnetchina/Furion/blob/rc1/LICENSE" |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | "CorsAccessorSettings": { |
| | | "WithExposedHeaders": [ |
| | | "access-token", |
| | | "x-access-token", |
| | | "environment" |
| | | ] |
| | | } |
| | | } |
New file |
| | |
| | | using Furion; |
| | | using SqlSugar; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace DocumentServiceAPI.Core; |
| | | |
| | | /// <summary> |
| | | /// æ°æ®åºä¸ä¸æå¯¹è±¡ |
| | | /// </summary> |
| | | public static class DbContext |
| | | { |
| | | /// <summary> |
| | | /// SqlSugar æ°æ®åºå®ä¾ |
| | | /// </summary> |
| | | public static readonly SqlSugarScope Instance = new( |
| | | // 读å appsettings.json ä¸ç ConnectionConfigs é
ç½®èç¹ |
| | | App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs") |
| | | , db => |
| | | { |
| | | // è¿éé
ç½®å
¨å±äºä»¶ï¼æ¯å¦æ¦æªæ§è¡ SQL |
| | | }); |
| | | } |
New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <NoWarn>1701;1702;1591</NoWarn> |
| | | <DocumentationFile>DocumentServiceAPI.Core.xml</DocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | |
| | | |
| | | <ItemGroup> |
| | | <None Remove="DocumentServiceAPI.Core.xml" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <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" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
New file |
| | |
| | | <?xml version="1.0"?> |
| | | <doc> |
| | | <assembly> |
| | | <name>DocumentServiceAPI.Core</name> |
| | | </assembly> |
| | | <members> |
| | | <member name="T:DocumentServiceAPI.Core.DbContext"> |
| | | <summary> |
| | | æ°æ®åºä¸ä¸æå¯¹è±¡ |
| | | </summary> |
| | | </member> |
| | | <member name="F:DocumentServiceAPI.Core.DbContext.Instance"> |
| | | <summary> |
| | | SqlSugar æ°æ®åºå®ä¾ |
| | | </summary> |
| | | </member> |
| | | </members> |
| | | </doc> |
New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <NoWarn>1701;1702;1591</NoWarn> |
| | | <DocumentationFile>DocumentServiceAPI.Web.Core.xml</DocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | | |
| | | |
| | | <ItemGroup> |
| | | <None Remove="DocumentServiceAPI.Web.Core.xml" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Application\DocumentServiceAPI.Application.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
New file |
| | |
| | | <?xml version="1.0"?> |
| | | <doc> |
| | | <assembly> |
| | | <name>DocumentServiceAPI.Web.Core</name> |
| | | </assembly> |
| | | <members> |
| | | </members> |
| | | </doc> |
New file |
| | |
| | | using Furion.Authorization; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace DocumentServiceAPI.Web.Core; |
| | | |
| | | public class JwtHandler : AppAuthorizeHandler |
| | | { |
| | | public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext) |
| | | { |
| | | // è¿éåæ¨çææå¤æé»è¾ï¼ææéè¿è¿å trueï¼å¦åè¿å false |
| | | |
| | | return Task.FromResult(true); |
| | | } |
| | | } |
New file |
| | |
| | | using Furion; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | |
| | | namespace DocumentServiceAPI.Web.Core; |
| | | |
| | | public class Startup : AppStartup |
| | | { |
| | | public void ConfigureServices(IServiceCollection services) |
| | | { |
| | | services.AddConsoleFormatter(); |
| | | services.AddJwt<JwtHandler>(); |
| | | |
| | | services.AddCorsAccessor(); |
| | | |
| | | services.AddControllers() |
| | | .AddInjectWithUnifyResult(); |
| | | } |
| | | |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
| | | { |
| | | if (env.IsDevelopment()) |
| | | { |
| | | app.UseDeveloperExceptionPage(); |
| | | } |
| | | |
| | | app.UseHttpsRedirection(); |
| | | |
| | | app.UseRouting(); |
| | | |
| | | app.UseCorsAccessor(); |
| | | |
| | | app.UseAuthentication(); |
| | | app.UseAuthorization(); |
| | | |
| | | app.UseInject(string.Empty); |
| | | |
| | | app.UseEndpoints(endpoints => |
| | | { |
| | | endpoints.MapControllers(); |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk.Web"> |
| | | |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> |
| | | <PublishReadyToRunComposite>true</PublishReadyToRunComposite> |
| | | </PropertyGroup> |
| | | |
| | | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\DocumentServiceAPI.Web.Core\DocumentServiceAPI.Web.Core.csproj" /> |
| | | </ItemGroup> |
| | | <ProjectExtensions> |
| | | <VisualStudio> |
| | | <UserProperties properties_4launchsettings_1json__JsonSchema="" /> |
| | | </VisualStudio> |
| | | </ProjectExtensions> |
| | | |
| | | </Project> |
New file |
| | |
| | | Serve.Run(RunOptions.Default.WithArgs(args)); |
New file |
| | |
| | | { |
| | | "$schema": "http://json.schemastore.org/launchsettings.json", |
| | | "iisSettings": { |
| | | "windowsAuthentication": false, |
| | | "anonymousAuthentication": true, |
| | | "iisExpress": { |
| | | "applicationUrl": "http://localhost:53785", |
| | | "sslPort": 44342 |
| | | } |
| | | }, |
| | | "profiles": { |
| | | "IIS Express": { |
| | | "commandName": "IISExpress", |
| | | "launchBrowser": true, |
| | | "launchUrl": "", |
| | | "environmentVariables": { |
| | | "ASPNETCORE_ENVIRONMENT": "Development" |
| | | } |
| | | }, |
| | | "DocumentServiceAPI.Web.Entry": { |
| | | "commandName": "Project", |
| | | "dotnetRunMessages": true, |
| | | "launchBrowser": true, |
| | | "launchUrl": "", |
| | | "applicationUrl": "https://localhost:5001;http://localhost:5000", |
| | | "environmentVariables": { |
| | | "ASPNETCORE_ENVIRONMENT": "Development" |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using Furion; |
| | | using System.Reflection; |
| | | |
| | | namespace DocumentServiceAPI.Web.Entry; |
| | | |
| | | public class SingleFilePublish : ISingleFilePublish |
| | | { |
| | | public Assembly[] IncludeAssemblies() |
| | | { |
| | | return Array.Empty<Assembly>(); |
| | | } |
| | | |
| | | public string[] IncludeAssemblyNames() |
| | | { |
| | | return new[] |
| | | { |
| | | "DocumentServiceAPI.Application", |
| | | "DocumentServiceAPI.Core", |
| | | "DocumentServiceAPI.Web.Core" |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning", |
| | | "Microsoft.EntityFrameworkCore": "Information" |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning", |
| | | "Microsoft.EntityFrameworkCore": "Information" |
| | | } |
| | | }, |
| | | "AllowedHosts": "*", |
| | | "ConnectionConfigs": [ |
| | | { |
| | | "ConnectionString": "Data Source=./Furion.db", |
| | | "DbType": "Sqlite", |
| | | "IsAutoCloseConnection": true |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | |  |
| | | Microsoft Visual Studio Solution File, Format Version 12.00 |
| | | # Visual Studio Version 17 |
| | | VisualStudioVersion = 17.3.32519.111 |
| | | MinimumVisualStudioVersion = 10.0.40219.1 |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Application", "DocumentServiceAPI.Application\DocumentServiceAPI.Application.csproj", "{AB699EE9-43A8-46F2-A855-04A26DE63372}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Web.Core", "DocumentServiceAPI.Web.Core\DocumentServiceAPI.Web.Core.csproj", "{9D14BB78-DA2A-4040-B9DB-5A515B599181}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Core", "DocumentServiceAPI.Core\DocumentServiceAPI.Core.csproj", "{4FB30091-15C7-4FD9-AB7D-266814F360F5}" |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentServiceAPI.Web.Entry", "DocumentServiceAPI.Web.Entry\DocumentServiceAPI.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | | Debug|Any CPU = Debug|Any CPU |
| | | Release|Any CPU = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
| | | {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {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 |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | | EndGlobalSection |
| | | GlobalSection(ExtensibilityGlobals) = postSolution |
| | | SolutionGuid = {B2073C2C-0FD3-452B-8047-8134D68E12CE} |
| | | EndGlobalSection |
| | | EndGlobal |