feat:基于furion搭建

This commit is contained in:
橙子
2023-04-12 22:30:42 +08:00
parent ccd39474c7
commit 5efdffcda8
631 changed files with 468 additions and 27264 deletions

View File

@@ -0,0 +1,7 @@
namespace Yi.Framework.Infrastructure
{
public class Class1
{
}
}

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Sqlsugar\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
global using Furion;
global using Furion.DatabaseAccessor;
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;

View File

@@ -0,0 +1,8 @@
namespace Yi.Furion.Rbac.Application;
public class Mapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
}
}

View File

@@ -0,0 +1,6 @@
namespace Yi.Furion.Rbac.Application;
public interface ISystemService
{
string GetDescription();
}

View File

@@ -0,0 +1,9 @@
namespace Yi.Furion.Rbac.Application;
public class SystemService : ISystemService, ITransient
{
public string GetDescription()
{
return "让 .NET 开发更简单,更通用,更流行。";
}
}

View File

@@ -0,0 +1,22 @@
namespace Yi.Furion.Rbac.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();
}
}

View File

@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Yi.Furion.Rbac.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Remove="applicationsettings.json" />
<None Remove="Yi.Furion.Rbac.Application.xml" />
</ItemGroup>
<ItemGroup>
<Content Include="applicationsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Furion.Rbac.Core\Yi.Furion.Rbac.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="System\Services\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Yi.Furion.Rbac.Application</name>
</assembly>
<members>
<member name="T:Yi.Furion.Rbac.Application.SystemAppService">
<summary>
系统服务接口
</summary>
</member>
<member name="M:Yi.Furion.Rbac.Application.SystemAppService.GetDescription">
<summary>
获取系统描述
</summary>
<returns></returns>
</member>
</members>
</doc>

View File

@@ -0,0 +1,31 @@
{
"$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": "https://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"
]
}
}

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Yi.Furion.Rbac.Core.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="Yi.Furion.Rbac.Core.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.7.41" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.7.41" />
<PackageReference Include="Furion.Pure" Version="4.8.7.45" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.67-preview06" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Yi.Furion.Rbac.Core</name>
</assembly>
<members>
</members>
</doc>

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Furion.Rbac.EntityFramework.Core\Yi.Furion.Rbac.EntityFramework.Core.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
//using Furion.DatabaseAccessor;
//using Microsoft.EntityFrameworkCore;
//namespace Yi.Furion.Rbac.EntityFramework.Core;
//[AppDbContext("Yi.Furion.Rbac", DbProvider.Sqlite)]
//public class DefaultDbContext : AppDbContext<DefaultDbContext>
//{
// public DefaultDbContext(DbContextOptions<DefaultDbContext> options) : base(options)
// {
// }
//}

View File

@@ -0,0 +1,16 @@
using Furion;
using Microsoft.Extensions.DependencyInjection;
namespace Yi.Furion.Rbac.EntityFramework.Core;
public class Startup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
//services.AddDatabaseAccessor(options =>
//{
// options.AddDbPool<DefaultDbContext>();
//}, "Yi.Furion.Rbac.Database.Migrations");
System.Console.WriteLine();
}
}

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Furion.Rbac.Core\Yi.Furion.Rbac.Core.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,16 @@
using Furion.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
namespace Yi.Furion.Rbac.Web.Core;
public class JwtHandler : AppAuthorizeHandler
{
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)
{
// 这里写您的授权判断逻辑,授权通过返回 true否则返回 false
return Task.FromResult(true);
}
}

View File

@@ -0,0 +1,45 @@
using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Yi.Furion.Rbac.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();
});
}
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>Yi.Furion.Rbac.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Remove="Yi.Furion.Rbac.Web.Core.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Furion.Rbac.Application\Yi.Furion.Rbac.Application.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Yi.Furion.Rbac.Web.Core</name>
</assembly>
<members>
</members>
</doc>

View File

@@ -0,0 +1 @@
Serve.Run(RunOptions.Default.WithArgs(args));

View File

@@ -0,0 +1,31 @@
{
"$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"
}
},
"Yi.Furion.Rbac.Web.Entry": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,23 @@
using Furion;
using System.Reflection;
namespace Yi.Furion.Rbac.Web.Entry;
public class SingleFilePublish : ISingleFilePublish
{
public Assembly[] IncludeAssemblies()
{
return Array.Empty<Assembly>();
}
public string[] IncludeAssemblyNames()
{
return new[]
{
"Yi.Furion.Rbac.Application",
"Yi.Furion.Rbac.Core",
"Yi.Furion.Rbac.EntityFramework.Core",
"Yi.Furion.Rbac.Web.Core"
};
}
}

View File

@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Furion.Rbac.Web.Core\Yi.Furion.Rbac.Web.Core.csproj" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties properties_4launchsettings_1json__JsonSchema="" />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,11 @@
{
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*"
}

View File

@@ -0,0 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Furion.Rbac.Application", "Yi.Furion.Rbac.Application\Yi.Furion.Rbac.Application.csproj", "{AB699EE9-43A8-46F2-A855-04A26DE63372}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Furion.Rbac.Sqlsugar.Core", "Yi.Furion.Rbac.EntityFramework.Core\Yi.Furion.Rbac.Sqlsugar.Core.csproj", "{4BD77E5C-138D-4F2D-B709-F9020F306AF3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Furion.Rbac.Web.Core", "Yi.Furion.Rbac.Web.Core\Yi.Furion.Rbac.Web.Core.csproj", "{9D14BB78-DA2A-4040-B9DB-5A515B599181}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Furion.Rbac.Core", "Yi.Furion.Rbac.Core\Yi.Furion.Rbac.Core.csproj", "{4FB30091-15C7-4FD9-AB7D-266814F360F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Furion.Rbac.Web.Entry", "Yi.Furion.Rbac.Web.Entry\Yi.Furion.Rbac.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.Infrastructure", "Yi.Framework.Infrastructure\Yi.Framework.Infrastructure.csproj", "{15F8DEB8-8A78-4DED-B588-4CFB2BCA14C9}"
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
{4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BD77E5C-138D-4F2D-B709-F9020F306AF3}.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
{15F8DEB8-8A78-4DED-B588-4CFB2BCA14C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15F8DEB8-8A78-4DED-B588-4CFB2BCA14C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15F8DEB8-8A78-4DED-B588-4CFB2BCA14C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15F8DEB8-8A78-4DED-B588-4CFB2BCA14C9}.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