@ -0,0 +1,32 @@
|
||||
# Include any files or directories that you don't want to be copied to your |
||||
# container here (e.g., local build artifacts, temporary files, etc.). |
||||
# |
||||
# For more help, visit the .dockerignore file reference guide at |
||||
# https://docs.docker.com/go/build-context-dockerignore/ |
||||
|
||||
**/.DS_Store |
||||
**/.classpath |
||||
**/.dockerignore |
||||
**/.env |
||||
**/.git |
||||
**/.gitignore |
||||
**/.project |
||||
**/.settings |
||||
**/.toolstarget |
||||
**/.vs |
||||
**/.vscode |
||||
**/*.*proj.user |
||||
**/*.dbmdl |
||||
**/*.jfm |
||||
**/bin |
||||
**/charts |
||||
**/docker-compose* |
||||
**/compose* |
||||
**/Dockerfile* |
||||
**/node_modules |
||||
**/npm-debug.log |
||||
**/obj |
||||
**/secrets.dev.yaml |
||||
**/values.dev.yaml |
||||
LICENSE |
||||
README.md |
@ -0,0 +1,4 @@
|
||||
[*.cs] |
||||
|
||||
# CS8603: 可能返回 null 引用。 |
||||
dotnet_diagnostic.CS8603.severity = none |
@ -0,0 +1,212 @@
|
||||
## Ignore Visual Studio temporary files, build results, and |
||||
## files generated by popular Visual Studio add-ons. |
||||
|
||||
# User-specific files |
||||
*.suo |
||||
*.user |
||||
*.userosscache |
||||
*.sln.docstates |
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio) |
||||
*.userprefs |
||||
|
||||
# Build results |
||||
[Dd]ebug/ |
||||
[Dd]ebugPublic/ |
||||
[Rr]elease/ |
||||
[Rr]eleases/ |
||||
build/ |
||||
bld/ |
||||
[Bb]in/ |
||||
[Oo]bj/ |
||||
|
||||
# Visual Studio 2015 cache/options directory |
||||
.vs/ |
||||
|
||||
# MSTest test Results |
||||
[Tt]est[Rr]esult*/ |
||||
[Bb]uild[Ll]og.* |
||||
|
||||
# NUNIT |
||||
*.VisualState.xml |
||||
TestResult.xml |
||||
|
||||
# Build Results of an ATL Project |
||||
[Dd]ebugPS/ |
||||
[Rr]eleasePS/ |
||||
dlldata.c |
||||
|
||||
# DNX |
||||
project.lock.json |
||||
artifacts/ |
||||
|
||||
*_i.c |
||||
*_p.c |
||||
*_i.h |
||||
*.ilk |
||||
*.meta |
||||
*.obj |
||||
*.pch |
||||
*.pdb |
||||
*.pgc |
||||
*.pgd |
||||
*.rsp |
||||
*.sbr |
||||
*.tlb |
||||
*.tli |
||||
*.tlh |
||||
*.tmp |
||||
*.tmp_proj |
||||
*.log |
||||
*.vspscc |
||||
*.vssscc |
||||
.builds |
||||
*.pidb |
||||
*.svclog |
||||
*.scc |
||||
|
||||
# Chutzpah Test files |
||||
_Chutzpah* |
||||
|
||||
# Visual C++ cache files |
||||
ipch/ |
||||
*.aps |
||||
*.ncb |
||||
*.opensdf |
||||
*.sdf |
||||
*.cachefile |
||||
|
||||
# Visual Studio profiler |
||||
*.psess |
||||
*.vsp |
||||
*.vspx |
||||
|
||||
# TFS 2012 Local Workspace |
||||
$tf/ |
||||
|
||||
# Guidance Automation Toolkit |
||||
*.gpState |
||||
|
||||
# ReSharper is a .NET coding add-in |
||||
_ReSharper*/ |
||||
*.[Rr]e[Ss]harper |
||||
*.DotSettings.user |
||||
|
||||
# JustCode is a .NET coding add-in |
||||
.JustCode |
||||
|
||||
# TeamCity is a build add-in |
||||
_TeamCity* |
||||
|
||||
# DotCover is a Code Coverage Tool |
||||
*.dotCover |
||||
|
||||
# NCrunch |
||||
_NCrunch_* |
||||
.*crunch*.local.xml |
||||
|
||||
# MightyMoose |
||||
*.mm.* |
||||
AutoTest.Net/ |
||||
|
||||
# Web workbench (sass) |
||||
.sass-cache/ |
||||
|
||||
# Installshield output folder |
||||
[Ee]xpress/ |
||||
|
||||
# DocProject is a documentation generator add-in |
||||
DocProject/buildhelp/ |
||||
DocProject/Help/*.HxT |
||||
DocProject/Help/*.HxC |
||||
DocProject/Help/*.hhc |
||||
DocProject/Help/*.hhk |
||||
DocProject/Help/*.hhp |
||||
DocProject/Help/Html2 |
||||
DocProject/Help/html |
||||
|
||||
# Click-Once directory |
||||
publish/ |
||||
|
||||
# Publish Web Output |
||||
*.[Pp]ublish.xml |
||||
*.azurePubxml |
||||
## TODO: Comment the next line if you want to checkin your |
||||
## web deploy settings but do note that will include unencrypted |
||||
## passwords |
||||
#*.pubxml |
||||
|
||||
*.publishproj |
||||
|
||||
# NuGet Packages |
||||
*.nupkg |
||||
# The packages folder can be ignored because of Package Restore |
||||
**/packages/* |
||||
# except build/, which is used as an MSBuild target. |
||||
!**/packages/build/ |
||||
# Uncomment if necessary however generally it will be regenerated when needed |
||||
#!**/packages/repositories.config |
||||
|
||||
# Windows Azure Build Output |
||||
csx/ |
||||
*.build.csdef |
||||
|
||||
# Windows Store app package directory |
||||
AppPackages/ |
||||
|
||||
# Visual Studio cache files |
||||
# files ending in .cache can be ignored |
||||
*.[Cc]ache |
||||
# but keep track of directories ending in .cache |
||||
!*.[Cc]ache/ |
||||
|
||||
# Others |
||||
ClientBin/ |
||||
[Ss]tyle[Cc]op.* |
||||
~$* |
||||
*~ |
||||
*.dbmdl |
||||
*.dbproj.schemaview |
||||
*.pfx |
||||
*.publishsettings |
||||
node_modules/ |
||||
orleans.codegen.cs |
||||
|
||||
# RIA/Silverlight projects |
||||
Generated_Code/ |
||||
|
||||
# Backup & report files from converting an old project file |
||||
# to a newer Visual Studio version. Backup files are not needed, |
||||
# because we have git ;-) |
||||
_UpgradeReport_Files/ |
||||
Backup*/ |
||||
UpgradeLog*.XML |
||||
UpgradeLog*.htm |
||||
|
||||
# SQL Server files |
||||
*.mdf |
||||
*.ldf |
||||
|
||||
# Business Intelligence projects |
||||
*.rdl.data |
||||
*.bim.layout |
||||
*.bim_*.settings |
||||
|
||||
# Microsoft Fakes |
||||
FakesAssemblies/ |
||||
|
||||
# Node.js Tools for Visual Studio |
||||
.ntvs_analysis.dat |
||||
|
||||
# Visual Studio 6 build log |
||||
*.plg |
||||
|
||||
# Visual Studio 6 workspace options file |
||||
*.opt |
||||
|
||||
# LightSwitch generated files |
||||
GeneratedArtifacts/ |
||||
_Pvt_Extensions/ |
||||
ModelManifest.xml |
||||
Src/Asp.NetCore2/SqlSeverTest/.idea/ |
||||
.idea |
@ -0,0 +1,17 @@
|
||||
using ReZero.DependencyInjection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace DependencyInjectionTest.Controllers |
||||
{ |
||||
public class Class1:IClass1, IScopeContract |
||||
{ |
||||
public string? a { get; set; } = "a"; |
||||
} |
||||
public class Class2 : IScopeContract |
||||
{ |
||||
public string? a2 { get; set; } = "a2"; |
||||
} |
||||
public interface IClass1 |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc; |
||||
using ReZero.DependencyInjection; |
||||
|
||||
namespace DependencyInjectionTest.Controllers |
||||
{ |
||||
[ApiController] |
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase |
||||
{ |
||||
Class2 class2; |
||||
public WeatherForecastController(Class2 class2) |
||||
{ |
||||
this.class2 = class2; |
||||
} |
||||
|
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")] |
||||
public object Get() |
||||
{ |
||||
var class1=DependencyResolver.GetHttpContextService<Class1>(); |
||||
var class2 = DependencyResolver.GetHttpContextService<Class1>(); |
||||
return class1.GetHashCode()+"_"+class2.GetHashCode() ; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<Nullable>enable</Nullable> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<ProjectReference Include="..\ReZero\ReZero.csproj" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,36 @@
|
||||
using DependencyInjectionTest.Controllers; |
||||
using ReZero; |
||||
using ReZero.DependencyInjection; |
||||
using System.Runtime.CompilerServices; |
||||
var builder = WebApplication.CreateBuilder(args); |
||||
|
||||
// Add services to the container. |
||||
|
||||
builder.Services.AddControllers(); |
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle |
||||
builder.Services.AddEndpointsApiExplorer(); |
||||
builder.Services.AddSwaggerGen(); |
||||
// builder.Services.AddScoped(typeof(IClass1),typeof(Class1)); |
||||
//Register: Register the super API service |
||||
builder.Services.AddHttpContextAccessor(); |
||||
//×¢²á£º×¢²á³¬¼¶API·þÎñ |
||||
builder.Services.AddReZeroServices(new ReZeroOptions() |
||||
{ |
||||
DependencyInjectionOptions = new DependencyInjectionOptions(typeof(Program).Assembly) |
||||
}); |
||||
var app = builder.Build(); |
||||
|
||||
// Configure the HTTP request pipeline. |
||||
if (app.Environment.IsDevelopment()) |
||||
{ |
||||
app.UseSwagger(); |
||||
app.UseSwaggerUI(); |
||||
} |
||||
|
||||
app.UseHttpsRedirection(); |
||||
|
||||
app.UseAuthorization(); |
||||
|
||||
app.MapControllers(); |
||||
|
||||
app.Run(); |
@ -0,0 +1,31 @@
|
||||
{ |
||||
"$schema": "https://json.schemastore.org/launchsettings.json", |
||||
"iisSettings": { |
||||
"windowsAuthentication": false, |
||||
"anonymousAuthentication": true, |
||||
"iisExpress": { |
||||
"applicationUrl": "http://localhost:15186", |
||||
"sslPort": 44328 |
||||
} |
||||
}, |
||||
"profiles": { |
||||
"DependencyInjectionTest": { |
||||
"commandName": "Project", |
||||
"dotnetRunMessages": true, |
||||
"launchBrowser": true, |
||||
"launchUrl": "swagger", |
||||
"applicationUrl": "https://localhost:7035;http://localhost:5034", |
||||
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
||||
}, |
||||
"IIS Express": { |
||||
"commandName": "IISExpress", |
||||
"launchBrowser": true, |
||||
"launchUrl": "swagger", |
||||
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@
|
||||
namespace DependencyInjectionTest |
||||
{ |
||||
public class WeatherForecast |
||||
{ |
||||
public DateTime Date { get; set; } |
||||
|
||||
public int TemperatureC { get; set; } |
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); |
||||
|
||||
public string? Summary { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Information", |
||||
"Microsoft.AspNetCore": "Warning" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,9 @@
|
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Information", |
||||
"Microsoft.AspNetCore": "Warning" |
||||
} |
||||
}, |
||||
"AllowedHosts": "*" |
||||
} |
@ -0,0 +1,64 @@
|
||||
# syntax=docker/dockerfile:1 |
||||
|
||||
# Comments are provided throughout this file to help you get started. |
||||
# If you need more help, visit the Dockerfile reference guide at |
||||
# https://docs.docker.com/go/dockerfile-reference/ |
||||
|
||||
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 |
||||
|
||||
################################################################################ |
||||
|
||||
# Learn about building .NET container images: |
||||
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md |
||||
|
||||
# Create a stage for building the application. |
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build |
||||
|
||||
COPY . /source |
||||
|
||||
WORKDIR /source/SuperAPI |
||||
|
||||
# This is the architecture you’re building for, which is passed in by the builder. |
||||
# Placing it here allows the previous steps to be cached across architectures. |
||||
ARG TARGETARCH |
||||
|
||||
# Build the application. |
||||
# Leverage a cache mount to /root/.nuget/packages so that subsequent builds don't have to re-download packages. |
||||
# If TARGETARCH is "amd64", replace it with "x64" - "x64" is .NET's canonical name for this and "amd64" doesn't |
||||
# work in .NET 6.0. |
||||
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \ |
||||
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app |
||||
|
||||
# If you need to enable globalization and time zones: |
||||
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md |
||||
################################################################################ |
||||
# Create a new stage for running the application that contains the minimal |
||||
# runtime dependencies for the application. This often uses a different base |
||||
# image from the build stage where the necessary files are copied from the build |
||||
# stage. |
||||
# |
||||
# The example below uses an aspnet alpine image as the foundation for running the app. |
||||
# It will also use whatever happens to be the most recent version of that tag when you |
||||
# build your Dockerfile. If reproducability is important, consider using a more specific |
||||
# version (e.g., aspnet:7.0.10-alpine-3.18), |
||||
# or SHA (e.g., mcr.microsoft.com/dotnet/aspnet@sha256:f3d99f54d504a21d38e4cc2f13ff47d67235efeeb85c109d3d1ff1808b38d034). |
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS final |
||||
WORKDIR /app |
||||
|
||||
# Copy everything needed to run the app from the "build" stage. |
||||
COPY --from=build /app . |
||||
|
||||
# Create a non-privileged user that the app will run under. |
||||
# See https://docs.docker.com/go/dockerfile-user-best-practices/ |
||||
ARG UID=10001 |
||||
RUN adduser \ |
||||
--disabled-password \ |
||||
--gecos "" \ |
||||
--home "/nonexistent" \ |
||||
--shell "/sbin/nologin" \ |
||||
--no-create-home \ |
||||
--uid "${UID}" \ |
||||
appuser |
||||
USER appuser |
||||
|
||||
ENTRYPOINT ["dotnet", "SuperAPITest.dll"] |
@ -0,0 +1,21 @@
|
||||
MIT License |
||||
|
||||
Copyright (c) 2022 jacktang |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,12 @@
|
||||
{ |
||||
"version": 1, |
||||
"isRoot": true, |
||||
"tools": { |
||||
"dotnet-ef": { |
||||
"version": "8.0.4", |
||||
"commands": [ |
||||
"dotnet-ef" |
||||
] |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc; |
||||
|
||||
namespace NugetTest.Controllers |
||||
{ |
||||
[ApiController] |
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase |
||||
{ |
||||
private static readonly string[] Summaries = new[] |
||||
{ |
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" |
||||
}; |
||||
|
||||
private readonly ILogger<WeatherForecastController> _logger; |
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger) |
||||
{ |
||||
_logger = logger; |
||||
} |
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")] |
||||
public IEnumerable<WeatherForecast> Get() |
||||
{ |
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast |
||||
{ |
||||
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), |
||||
TemperatureC = Random.Shared.Next(-20, 55), |
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] |
||||
}) |
||||
.ToArray(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,283 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net8.0</TargetFramework> |
||||
<Nullable>enable</Nullable> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<InvariantGlobalization>false</InvariantGlobalization> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<Compile Remove="wwwroot\**" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\code_builder.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\animate.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\bootstrap.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\master.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\materialdesignicons.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_entity_manager.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_index.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_interface.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_interface_detail.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_interface_manager.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\page_table_list.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\css\style.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\database_manager.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\data_document.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\dynamic_interface.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\entity_manager.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\fonts\materialdesignicons.eot" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\fonts\materialdesignicons.svg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\fonts\materialdesignicons.ttf" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\fonts\materialdesignicons.woff" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\fonts\materialdesignicons.woff2" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\captcha.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\1.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\10.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\11.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\13.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\14.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\15.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\16.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\17.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\2.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\3.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\4.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\5.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\6.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\7.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\8.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\gallery\9.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\img-slide-1.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\img-slide-2.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\img-slide-3.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\img-slide-4.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\img-slide-5.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\login-bg-2.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\login-bg-3.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\login-bg-4.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\login-bg.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\logo-ico.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\logo-sidebar.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\logo.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\images\users\avatar.jpg" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\index.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\interface_categroy.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\interface_manager.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\internal_interface.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\bootstrap-colorpicker.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\bootstrap-colorpicker.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\css\bootstrap-colorpicker.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\css\bootstrap-colorpicker.css.map" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\css\bootstrap-colorpicker.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\css\bootstrap-colorpicker.min.css.map" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\img\bootstrap-colorpicker\alpha-horizontal.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\img\bootstrap-colorpicker\alpha.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\img\bootstrap-colorpicker\hue-horizontal.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\img\bootstrap-colorpicker\hue.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-colorpicker\img\bootstrap-colorpicker\saturation.png" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker3.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker3.css.map" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker3.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\bootstrap-datepicker3.min.css.map" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ar.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.az.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.bg.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.bs.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ca.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.cs.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.cy.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.da.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.de.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.el.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.en-AU.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.en-GB.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.eo.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.es.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.et.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.eu.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.fa.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.fi.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.fo.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.fr-CH.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.fr.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.gl.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.he.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.hr.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.hu.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.hy.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.id.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.is.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.it-CH.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.it.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ja.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ka.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.kh.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.kk.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ko.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.kr.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.lt.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.lv.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.me.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.mk.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.mn.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ms.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.nb.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.nl-BE.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.nl.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.no.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.pl.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.pt-BR.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.pt.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ro.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.rs-latin.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.rs.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.ru.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sk.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sl.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sq.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sr-latin.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sr.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sv.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.sw.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.th.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.tr.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.uk.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.vi.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.zh-CN.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datepicker\locales\bootstrap-datepicker.zh-TW.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\bootstrap-datetimepicker.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\bootstrap-datetimepicker.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\bootstrap-datetimepicker.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\bootstrap-datetimepicker.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\af.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ar-ma.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ar-sa.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ar-tn.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ar.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\az.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\be.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\bg.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\bn.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\bo.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\br.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\bs.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ca.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\cs.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\cv.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\cy.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\da.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\de-at.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\de.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\el.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\en-au.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\en-ca.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\en-gb.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\eo.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\es.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\et.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\eu.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fa.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fi.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fo.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fr-ca.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fr.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\fy.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\gl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\he.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\hi.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\hr.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\hu.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\hy-am.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\id.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\is.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\it.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ja.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\jv.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ka.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\km.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ko.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\lb.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\lt.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\lv.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\me.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\mk.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ml.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\mr.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ms-my.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ms.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\my.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\nb.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ne.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\nl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\nn.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\pl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\pt-br.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\pt.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ro.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ru.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\si.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sk.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sq.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sr-cyrl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sr.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\sv.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\ta.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\th.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\tl-ph.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\tr.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\tzl.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\tzm-latn.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\tzm.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\uk.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\uz.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\vi.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\zh-cn.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\locale\zh-tw.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-datetimepicker\moment.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\Chart.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\chosen.jquery.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\index.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\ion-rangeslider\ion.rangeSlider.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\ion-rangeslider\ion.rangeSlider.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jconfirm\jquery-confirm.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jconfirm\jquery-confirm.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jquery-tags-input\jquery.tagsinput.min.css" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jquery-tags-input\jquery.tagsinput.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jquery.bootstrap.wizard.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\jquery.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\lightyear.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\main.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\perfect-scrollbar.min.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\tools.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\vue.js" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\template\master_page.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\template\page_control.html" /> |
||||
<Compile Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\tryapi.html" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Content Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\favicon.ico" /> |
||||
<Content Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap-notify.min.js" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Resource Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\axios.min.js" /> |
||||
<Resource Remove="C:\Users\Administrator\.nuget\packages\rezeroapi\1.0.0.9\contentFiles\any\any\wwwroot\rezeroapi\default_ui\js\bootstrap.min.js" /> |
||||
</ItemGroup> |
||||
|
||||
|
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" /> |
||||
<PackageReference Include="Rezero.Api" Version="1.8.11" /> |
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> |
||||
</ItemGroup> |
||||
|
||||
|
||||
</Project> |
@ -0,0 +1,6 @@
|
||||
@NugetTest_HostAddress = http://localhost:5094 |
||||
|
||||
GET {{NugetTest_HostAddress}}/weatherforecast/ |
||||
Accept: application/json |
||||
|
||||
### |
@ -0,0 +1,65 @@
|
||||
using ReZero; |
||||
using ReZero.SuperAPI; |
||||
using System.Diagnostics; |
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
var builder = WebApplication.CreateBuilder(args); |
||||
|
||||
// Add services to the container. |
||||
|
||||
builder.Services.AddControllers(); |
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle |
||||
builder.Services.AddEndpointsApiExplorer(); |
||||
builder.Services.AddSwaggerGen(); |
||||
|
||||
|
||||
//Register: Register the super API service |
||||
//注册:注册超级API服务 |
||||
builder.Services.AddReZeroServices(api => |
||||
{ |
||||
//启用超级API |
||||
//有重载可换json文件 |
||||
var apiObj = SuperAPIOptions.GetOptions(); |
||||
|
||||
apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(Assembly.GetExecutingAssembly()); |
||||
//启用超级API |
||||
api.EnableSuperApi(apiObj); |
||||
|
||||
}); |
||||
|
||||
var app = builder.Build(); |
||||
|
||||
// Configure the HTTP request pipeline. |
||||
if (app.Environment.IsDevelopment()) |
||||
{ |
||||
app.UseSwagger(); |
||||
app.UseSwaggerUI(); |
||||
} |
||||
|
||||
|
||||
app.UseHttpsRedirection(); |
||||
|
||||
app.UseAuthorization(); |
||||
|
||||
app.MapControllers(); |
||||
|
||||
#if !DEBUG |
||||
try |
||||
{ |
||||
// 假设您的应用程序在本地5000端口上运行 |
||||
string url = "http://localhost:5000/rezero/dynamic_interface.html?InterfaceCategoryId=200100"; |
||||
Process.Start(new ProcessStartInfo |
||||
{ |
||||
FileName = url, |
||||
UseShellExecute = true |
||||
}); |
||||
} |
||||
catch (global::System.Exception) |
||||
{ |
||||
//docker中不能打开浏览器,出错不处理 |
||||
} |
||||
#endif |
||||
// 启动默认的网页浏览器并打开指定的URL |
||||
|
||||
app.Run(); |
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- |
||||
https://go.microsoft.com/fwlink/?LinkID=208121. |
||||
--> |
||||
<Project> |
||||
<PropertyGroup> |
||||
<DeleteExistingFiles>true</DeleteExistingFiles> |
||||
<ExcludeApp_Data>false</ExcludeApp_Data> |
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform> |
||||
<PublishProvider>FileSystem</PublishProvider> |
||||
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl> |
||||
<WebPublishMethod>FileSystem</WebPublishMethod> |
||||
<_TargetId>Folder</_TargetId> |
||||
<SiteUrlToLaunchAfterPublish /> |
||||
<TargetFramework>net8.0</TargetFramework> |
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier> |
||||
<ProjectGuid>ba1ad8c9-8aec-4e0e-9f68-fc0d1403731c</ProjectGuid> |
||||
<SelfContained>true</SelfContained> |
||||
<PublishSingleFile>false</PublishSingleFile> |
||||
<PublishTrimmed>false</PublishTrimmed> |
||||
</PropertyGroup> |
||||
</Project> |
@ -0,0 +1,41 @@
|
||||
{ |
||||
"$schema": "https://json.schemastore.org/launchsettings.json", |
||||
"iisSettings": { |
||||
"windowsAuthentication": false, |
||||
"anonymousAuthentication": true, |
||||
"iisExpress": { |
||||
"applicationUrl": "http://localhost:30936", |
||||
"sslPort": 44372 |
||||
} |
||||
}, |
||||
"profiles": { |
||||
"http": { |
||||
"commandName": "Project", |
||||
"dotnetRunMessages": true, |
||||
"launchBrowser": true, |
||||
"launchUrl": "rezero/dynamic_interface.html?InterfaceCategoryId=200100", |
||||
"applicationUrl": "http://localhost:5267", |
||||
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
||||
}, |
||||
"https": { |
||||
"commandName": "Project", |
||||
"dotnetRunMessages": true, |
||||
"launchBrowser": true, |
||||
"launchUrl": "rezero/dynamic_interface.html?InterfaceCategoryId=200100", |
||||
"applicationUrl": "https://localhost:7101;http://localhost:5267", |
||||
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
||||
}, |
||||
"IIS Express": { |
||||
"commandName": "IISExpress", |
||||
"launchBrowser": true, |
||||
"launchUrl": "rezero", |
||||
"environmentVariables": { |
||||
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@
|
||||
namespace NugetTest |
||||
{ |
||||
public class WeatherForecast |
||||
{ |
||||
public DateOnly Date { get; set; } |
||||
|
||||
public int TemperatureC { get; set; } |
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); |
||||
|
||||
public string? Summary { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Information", |
||||
"Microsoft.AspNetCore": "Warning" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,47 @@
|
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Information", |
||||
"Microsoft.AspNetCore": "Warning" |
||||
} |
||||
}, |
||||
|
||||
"AllowedHosts": "*", |
||||
|
||||
"ReZero": { |
||||
"BasicDatabase": { |
||||
/* MySql,SqlServer,Sqlite,Oracle,PostgreSQL,Dm (达梦),Kdbndp(人大金仓默认模式) */ |
||||
"DbType": "Sqlite", |
||||
"ConnectionString": "datasource=rezero.db" |
||||
}, |
||||
"Ui": { |
||||
/*纯ReZero开发可以设为false,true用于兼容Swagger用户*/ |
||||
"ShowNativeApiDocument": false |
||||
}, |
||||
"Jwt": { |
||||
"Enable": false, //设置true会启用自带的jwt授权 |
||||
"Secret": "C0mPl3xS3cr3tK3yF0rJWT@DEVELOPMENT", |
||||
"UserTableName": "UserTable", //用户表的表名 (实体管理可以创建表,操作步骤:1.创建实体 2.同步生成表 ) |
||||
"UserNameFieldName": "username", //用户名字段 |
||||
"PasswordFieldName": "password", //密码字段 |
||||
"Expires": 1000, //分钟 |
||||
"Claim": [ // 数据库操作会用到Claim中的值作为条件 |
||||
{ |
||||
"Key": "Id", //Claim Key |
||||
"FieldName": "Id", //用户表中的字段 |
||||
"Type": "long" //C#类型 |
||||
} |
||||
], |
||||
//禁用系统接口, 设置为true将禁用所有系统接口(建表、建接口等) |
||||
"DisableSystemInterface": false |
||||
}, |
||||
"Cors": { |
||||
"Enable": true, //设置为true启动自带的跨域 |
||||
"PolicyName": "cors", |
||||
"Headers": [ "*" ], |
||||
"Methods": [ "*" ], |
||||
//可以跨域的地址 |
||||
"Origins": [ "http://localhost:52798", "http://localhost:5000" ] //可以配多个地址 |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,24 @@
|
||||
### Building and running your application |
||||
|
||||
When you're ready, start your application by running: |
||||
`docker compose up --build`. |
||||
|
||||
Your application will be available at http://localhost:8080. |
||||
|
||||
### Deploying your application to the cloud |
||||
|
||||
First, build your image, e.g.: `docker build -t myapp .`. |
||||
If your cloud uses a different CPU architecture than your development |
||||
machine (e.g., you are on a Mac M1 and your cloud provider is amd64), |
||||
you'll want to build the image for that platform, e.g.: |
||||
`docker build --platform=linux/amd64 -t myapp .`. |
||||
|
||||
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. |
||||
|
||||
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) |
||||
docs for more detail on building and pushing. |
||||
|
||||
### References |
||||
* [Docker's .NET guide](https://docs.docker.com/language/dotnet/) |
||||
* The [dotnet-docker](https://github.com/dotnet/dotnet-docker/tree/main/samples) |
||||
repository has many relevant samples and docs. |
@ -0,0 +1,174 @@
|
||||
# Rezero API 功能 |
||||
Rezero是一款.NET中间件,无需写代码也能实现CRUD,无破坏性,可以集成到任何.NET API项目,非.NET用户可以用发布好的exe文件 |
||||
|
||||
1、界面功能:创建接口 、建库、建表 、生成接口、设置授权、接口文档、调试接口等等都不需要写代码<br> |
||||
2、可以创建自已的用户表,而不是固定的表实现授权<br> |
||||
3、支持非.NET用户使用,比如你是前端 GO JAVA PHP也可以使用打包好的EXE |
||||
4、.NET6+的API项目都可以一行代码集成到自已项目中,对以前的逻辑没有破坏性<br> |
||||
5、.NET用户也可以用来构建API程序,支持模块化、授权、IOC(支持属性注入)、自动生成接口、ORM、工作单元、多租户等等<br> |
||||
|
||||
## 1.1 官方文档 |
||||
https://www.donet5.com/Doc/32/2580 |
||||
|
||||
## 1.2 加群交流 |
||||
qq群号:472534707 |
||||
|
||||
## 1.3 功能截图 |
||||
### 创建接口 |
||||
|
||||
 |
||||
|
||||
### 查看创建后的接口 |
||||
|
||||
 |
||||
|
||||
### 在线调试接口 |
||||
|
||||
 |
||||
|
||||
# 二、数据库支持 |
||||
Sqlite 、 MySql 、 SqlServer 、 PgSQL 、Oracle 、人大金仓(默认模式)、 达梦 |
||||
|
||||
|
||||
# 三、非.NET用户教程 |
||||
通过下载EXE运行 |
||||
https://gitee.com/DotNetNext/ReZero/releases |
||||
|
||||
|
||||
# 四、.NET用户教程 |
||||
|
||||
## 4.1 Nuget安装 |
||||
```cs |
||||
Rezero.Api |
||||
``` |
||||
## 4.2 一行代码配置 |
||||
新建一个.NET6+ WEB API |
||||
只需要注入一行代码就能使用 Rezero API |
||||
|
||||
```cs |
||||
/***对现有代码没有任何影响***/ |
||||
|
||||
//注册:注册超级API服务 |
||||
builder.Services.AddReZeroServices(api => |
||||
{ |
||||
//启用超级API |
||||
api.EnableSuperApi();//默认载体为sqlite ,有重载可以配置数据库 |
||||
|
||||
}); |
||||
//写在builder.Build前面就行只需要一行 |
||||
var app = builder.Build(); |
||||
|
||||
``` |
||||
## 4.3使用ReZero |
||||
启动项目直接访问地址就行了 |
||||
http://localhost:5267/rezero |
||||
 |
||||
|
||||
## 4.4 授权 |
||||
打开appsettings.json配置jwt参数 |
||||
 |
||||
界面完成登录 |
||||
 |
||||
|
||||
|
||||
## 4.5 集成到自已系统 |
||||
只要在url加上model=small 就会隐藏头部菜单和左边的菜单<br> |
||||
如果跨域或者端口需要url加token这样可以让内部接口也支持jwt授权 |
||||
 |
||||
|
||||
效果图如下 |
||||
 |
||||
|
||||
## 4.6统一返回结果 |
||||
如果不喜欢默认返回格式我们可以自定义返回格式 |
||||
|
||||
```cs |
||||
//注册ReZero.Api |
||||
builder.Services.AddReZeroServices(api => |
||||
{ |
||||
|
||||
//有重载可换json文件 (断点看一下apiObj.DatabaseOptions.ConnectionConfig有没有字符串进来) |
||||
var apiObj = SuperAPIOptions.GetOptions("rezero.json"); |
||||
|
||||
.....省略........ |
||||
|
||||
//只看这一行 (不要new InterfaceOptions会把上面配置清空,尽量用apiObj.InterfaceOptions.xxx) |
||||
apiObj.InterfaceOptions.MergeDataToStandardDtoFunc=dto => |
||||
{ |
||||
|
||||
if (dto is ErrorResponse error) |
||||
{ |
||||
return new { isSuccess = false, data = error.message }; |
||||
} |
||||
else if (dto is bool b) |
||||
{ |
||||
return new { isSuccess = b, data = b }; |
||||
} |
||||
//更多逻辑自已处理这儿只是一个示例 |
||||
return new { isSuccess = true, data = dto }; |
||||
}; |
||||
|
||||
|
||||
//启用超级API |
||||
api.EnableSuperApi(apiObj); |
||||
|
||||
}); |
||||
|
||||
``` |
||||
## 4.7 AOP实现日志记录 或者 授权(不用自带的JWT) |
||||
|
||||
```cs |
||||
//注册ReZero.Api |
||||
builder.Services.AddReZeroServices(api => |
||||
{ |
||||
//有重载可换json文件 |
||||
var apiObj = SuperAPIOptions.GetOptions(); |
||||
//IOC业务等所有需要的所有集程集 |
||||
apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(assemblyList); |
||||
apiObj.InterfaceOptions.SuperApiAop = new MyAop();//这一行配置AOP |
||||
//启用超级API |
||||
api.EnableSuperApi(apiObj); |
||||
|
||||
}); |
||||
|
||||
//自定义一个AOP类 |
||||
public class MyAop : DefaultSuperApiAop |
||||
{ |
||||
public override Task OnExecutingAsync(InterfaceContext context) |
||||
{ |
||||
//也可以用AOP实现JWT授权,不用使自带的JWT授权,适用于已存在JWT的情况 |
||||
//JWT验证 |
||||
//context.AttachClaimToHttpContext("Claim", 1); |
||||
return base.OnExecutingAsync(context); |
||||
} |
||||
} |
||||
``` |
||||
|
||||
|
||||
|
||||
# 五、功能预览 |
||||
## 预览1:查询配置显示列 |
||||
 |
||||
## 预览2:查询配置联表 |
||||
 |
||||
## 预览3:SQL直接生成接口 |
||||
 |
||||
## 预览4:配置完显的接口列表 |
||||
 |
||||
## 预览5: 创建实体 |
||||
 |
||||
## 预览6: 更新表结构对比 |
||||
 |
||||
|
||||
# 六、打赏作者 |
||||
|
||||
首先感谢大家 , 项目启动前就有人赞助开发了 |
||||
|
||||
工作量很大 ,功能复杂 ,对标的是收费软件,相信未来将会成长的很好 |
||||
|
||||
坚持用开源做出高品质的免费软件 |
||||
|
||||
 |
||||
|
||||
# 七、详细文档 |
||||
https://www.donet5.com/Doc/32/2580 |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 337 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,57 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00 |
||||
# Visual Studio Version 17 |
||||
VisualStudioVersion = 17.7.34031.279 |
||||
MinimumVisualStudioVersion = 10.0.40219.1 |
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{03B677B5-D24C-4A9C-B79B-E17F41CA1208}" |
||||
EndProject |
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReZero", "ReZero\ReZero.csproj", "{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}" |
||||
EndProject |
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperAPITest", "SuperAPI\SuperAPITest.csproj", "{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}" |
||||
EndProject |
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NugetTest", "NugetTest\NugetTest.csproj", "{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}" |
||||
EndProject |
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TextTemplateTest", "TextTemplateTest\TextTemplateTest.csproj", "{EA58EB55-47DD-44FD-A12A-0231F97F06C5}" |
||||
EndProject |
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DemoTest", "DemoTest", "{1032E893-22CF-4883-8857-049526541333}" |
||||
EndProject |
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjectionTest", "DependencyInjectionTest\DependencyInjectionTest.csproj", "{E7355DEA-E652-4C6A-960C-CECF4B4EB673}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
Debug|Any CPU = Debug|Any CPU |
||||
Release|Any CPU = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{55D7478B-38DD-47A9-B1AA-4E7EAAF7DDC2}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{A04287D1-F1AF-4102-924A-A9EB3B9B7A66}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{BA1AD8C9-8AEC-4E0E-9F68-FC0D1403731C}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{EA58EB55-47DD-44FD-A12A-0231F97F06C5}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{E7355DEA-E652-4C6A-960C-CECF4B4EB673}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(SolutionProperties) = preSolution |
||||
HideSolutionNode = FALSE |
||||
EndGlobalSection |
||||
GlobalSection(NestedProjects) = preSolution |
||||
{EA58EB55-47DD-44FD-A12A-0231F97F06C5} = {1032E893-22CF-4883-8857-049526541333} |
||||
{E7355DEA-E652-4C6A-960C-CECF4B4EB673} = {1032E893-22CF-4883-8857-049526541333} |
||||
EndGlobalSection |
||||
GlobalSection(ExtensibilityGlobals) = postSolution |
||||
SolutionGuid = {C3ACCBAF-6C08-4037-A398-1D5A9188B7E9} |
||||
EndGlobalSection |
||||
EndGlobal |
@ -0,0 +1,12 @@
|
||||
using Microsoft.Extensions.DependencyInjection; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero |
||||
{ |
||||
internal class ServiceLocator |
||||
{ |
||||
public static IServiceCollection? Services { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,80 @@
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer; |
||||
using Microsoft.AspNetCore.Builder.Extensions; |
||||
using Microsoft.AspNetCore.Hosting; |
||||
using Microsoft.CodeAnalysis.CSharp.Syntax; |
||||
using Microsoft.Extensions.DependencyInjection; |
||||
using Microsoft.IdentityModel.Tokens; |
||||
using ReZero.DependencyInjection; |
||||
using ReZero.SuperAPI; |
||||
using System; |
||||
using System.Linq; |
||||
using System.Text; |
||||
namespace ReZero |
||||
{ |
||||
|
||||
public static partial class ReZeroServiceCollectionExtensions |
||||
{ |
||||
|
||||
/// <summary> |
||||
/// Adds ReZero services to the specified <see cref="IServiceCollection"/>. |
||||
/// </summary> |
||||
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> |
||||
/// <param name="options">The <see cref="ReZeroOptions"/> to configure the services.</param> |
||||
/// <returns>The modified <see cref="IServiceCollection"/>.</returns> |
||||
public static IServiceCollection AddReZeroServices(this IServiceCollection services, ReZeroOptions options) |
||||
{ |
||||
ServiceLocator.Services = services; |
||||
services.AddHttpContextAccessor(); |
||||
SuperAPIModule.Init(services, options); |
||||
AddDependencyInjection(options, options.SuperApiOptions); |
||||
DependencyInjectionModule.Init(services, options); |
||||
JwtInit(services, options); |
||||
return services; |
||||
} |
||||
|
||||
private static void JwtInit(IServiceCollection services, ReZeroOptions options) |
||||
{ |
||||
var key = options.SuperApiOptions.InterfaceOptions?.Jwt?.Secret + ""; |
||||
if (string.IsNullOrEmpty(key)|| options.SuperApiOptions.InterfaceOptions?.Jwt?.Enable!=true) |
||||
{ |
||||
return; |
||||
} |
||||
var keyBytes = Encoding.ASCII.GetBytes(key); |
||||
services.AddAuthentication(options => |
||||
{ |
||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; |
||||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; |
||||
}) |
||||
.AddJwtBearer(options => |
||||
{ |
||||
options.TokenValidationParameters = new TokenValidationParameters |
||||
{ |
||||
ValidateIssuer = false, |
||||
ValidateAudience = false, |
||||
ValidateLifetime = true, |
||||
ValidateIssuerSigningKey = true, |
||||
IssuerSigningKey = new SymmetricSecurityKey(keyBytes) |
||||
}; |
||||
}); |
||||
} |
||||
|
||||
public static IServiceCollection AddReZeroServices(this IServiceCollection services, Action<SuperAPIOptions> superAPIOptions) |
||||
{ |
||||
var options = new ReZeroOptions(); |
||||
ServiceLocator.Services = services; |
||||
superAPIOptions(options.SuperApiOptions); |
||||
return services.AddReZeroServices(options); |
||||
} |
||||
internal static void AddDependencyInjection(ReZeroOptions options, SuperAPIOptions superAPIOptions) |
||||
{ |
||||
if (options.DependencyInjectionOptions?.Assemblies?.Any()!=true) |
||||
{ |
||||
if (options.DependencyInjectionOptions == null) |
||||
{ |
||||
options.DependencyInjectionOptions = new DependencyInjection.DependencyInjectionOptions(); |
||||
} |
||||
options.DependencyInjectionOptions!.Assemblies = superAPIOptions?.DependencyInjectionOptions?.Assemblies; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
using ReZero.DependencyInjection; |
||||
using ReZero.SuperAPI; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
namespace ReZero |
||||
{ |
||||
/// <summary> |
||||
/// Represents the options for the ReZero class. |
||||
/// </summary> |
||||
public class ReZeroOptions |
||||
{ |
||||
/// <summary> |
||||
/// Gets or sets the options for the SuperAPI. |
||||
/// </summary> |
||||
public SuperAPIOptions SuperApiOptions { get; set; } = new SuperAPIOptions(); |
||||
|
||||
/// <summary> |
||||
/// Gets or sets the options for the DependencyInjection. |
||||
/// </summary> |
||||
public ReZero.DependencyInjection.DependencyInjectionOptions DependencyInjectionOptions { get; set; } = new ReZero.DependencyInjection.DependencyInjectionOptions(); |
||||
} |
||||
} |
@ -0,0 +1,51 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
namespace ReZero |
||||
{ |
||||
public static class AssemblyExtensions |
||||
{ |
||||
public static Assembly[] GetAllDependentAssemblies(this Assembly rootAssembly, Func<string, bool> whereFunc) |
||||
{ |
||||
var result= AssemblyLoader.GetAllDependentAssemblies(rootAssembly, whereFunc); |
||||
return result; |
||||
} |
||||
} |
||||
public class AssemblyLoader |
||||
{ |
||||
public static Assembly[] GetAllDependentAssemblies(Assembly rootAssembly,Func<string,bool> whereFunc) |
||||
{ |
||||
var visited = new HashSet<Assembly>(); |
||||
var assemblies = new List<Assembly>(); |
||||
CollectDependentAssemblies(rootAssembly, assemblies, visited, whereFunc); |
||||
return assemblies.ToArray(); |
||||
} |
||||
|
||||
private static void CollectDependentAssemblies(Assembly assembly, List<Assembly> assemblies, HashSet<Assembly> visited, Func<string, bool> whereFunc) |
||||
{ |
||||
if (visited.Contains(assembly)) return; |
||||
|
||||
visited.Add(assembly); |
||||
assemblies.Add(assembly); |
||||
|
||||
foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies()) |
||||
{ |
||||
try |
||||
{ |
||||
if (!whereFunc(referencedAssemblyName.FullName)) |
||||
{ |
||||
continue; |
||||
} |
||||
Assembly referencedAssembly = Assembly.Load(referencedAssemblyName); |
||||
CollectDependentAssemblies(referencedAssembly, assemblies, visited,whereFunc); |
||||
} |
||||
catch (Exception) |
||||
{ |
||||
// Ignore assemblies that cannot be loaded |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero |
||||
{ |
||||
public static class TypeExtensions |
||||
{ |
||||
public static Type GetNonNullableType(this Type type) |
||||
{ |
||||
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) |
||||
{ |
||||
return type.GetGenericArguments()[0]; |
||||
} |
||||
|
||||
// 如果类型不是 Nullable<>,则直接返回原类型 |
||||
return type; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,87 @@
|
||||
using Microsoft.AspNetCore.Builder; |
||||
using Newtonsoft.Json.Linq; |
||||
using Newtonsoft.Json; |
||||
using SqlSugar; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
using System.Text; |
||||
using System.Diagnostics; |
||||
namespace ReZero.Configuration |
||||
{ |
||||
public class ApiConfiguration |
||||
{ |
||||
/// <summary> |
||||
/// 获取当前DLL文件的完整路径。 |
||||
/// </summary> |
||||
/// <returns>DLL文件的完整路径。</returns> |
||||
public static string GetCurrentDllFullPath() |
||||
{ |
||||
var assembly = Assembly.GetExecutingAssembly(); |
||||
return assembly.Location; |
||||
} |
||||
|
||||
// 获取当前执行程序(EXE)的完整路径 |
||||
public static string GetCurrentExeFullPath() |
||||
{ |
||||
return Process.GetCurrentProcess().MainModule.FileName; |
||||
} |
||||
|
||||
// 获取当前执行程序(EXE)的目录 |
||||
public static string GetCurrentExeDirectory() |
||||
{ |
||||
return Path.GetDirectoryName(GetCurrentExeFullPath()); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// 从JSON文件中读取并反序列化指定键的值到泛型类型T。 |
||||
/// </summary> |
||||
/// <typeparam name="T">要反序列化的目标类型。</typeparam> |
||||
/// <param name="key">JSON对象中的键。</param> |
||||
/// <param name="fileName">JSON文件的名称,默认为"appsettings.json"。如果文件位于DLL相同目录,则只需文件名;否则,需要提供完整路径。</param> |
||||
/// <returns>反序列化后的对象。</returns> |
||||
public static T GetJsonValue<T>(string key, string fileName = "appsettings.json") |
||||
{ |
||||
|
||||
string fullPath = Path.Combine(GetCurrentExeDirectory(), fileName); |
||||
if (!File.Exists(fullPath)) |
||||
{ |
||||
// 获取DLL的目录路径 |
||||
string dllPath = Path.GetDirectoryName(GetCurrentDllFullPath()); |
||||
fullPath =Path.Combine(dllPath, fileName); |
||||
} |
||||
|
||||
// 读取JSON文件内容 |
||||
string jsonContent = File.ReadAllText(fullPath, Encoding.UTF8); |
||||
|
||||
try |
||||
{ |
||||
// 解析JSON内容为JObject |
||||
JObject jsonObject = JObject.Parse(jsonContent); |
||||
|
||||
// 根据提供的键获取对应的JToken |
||||
JToken? token = jsonObject.SelectToken(key!); |
||||
|
||||
if (token != null) |
||||
{ |
||||
// 将JToken反序列化为泛型类型T |
||||
return token.ToObject<T>(); |
||||
} |
||||
else |
||||
{ |
||||
throw new ArgumentException($"GetJsonValue<{typeof(T).Name}>() error。The specified key '{key}' was not found in the JSON file."); |
||||
} |
||||
} |
||||
catch (JsonReaderException ex) |
||||
{ |
||||
throw new InvalidOperationException($"GetJsonValue<{typeof(T).Name}>() error。Error parsing JSON file at path: {fullPath}", ex); |
||||
} |
||||
catch (FileNotFoundException ex) |
||||
{ |
||||
throw new FileNotFoundException($"GetJsonValue<{typeof(T).Name}>() error。The JSON file was not found at path: {fullPath}", ex); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Configuration |
||||
{ |
||||
|
||||
public class ReZeroCors |
||||
{ |
||||
public bool Enable { get; set; } |
||||
public string? PolicyName { get; set; } |
||||
public string[]? Origins { get; set; } |
||||
public string[]? Headers { get; set; } |
||||
public string[]? Methods { get; set; } |
||||
public bool AllowCredentials { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Data; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Configuration |
||||
{ |
||||
public class ReZeroJson |
||||
{ |
||||
public ReZeroUiBasicdatabase? BasicDatabase { get; set; } |
||||
public ReZeroJwt? Jwt { get; set; } |
||||
public ReZeroUi? Ui { get; set; } |
||||
public ReZeroCors? Cors { get; set; } |
||||
} |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Configuration |
||||
{ |
||||
public class ReZeroJwt |
||||
{ |
||||
public bool? Enable { get; set; } |
||||
public string? Secret { get; set; } |
||||
public string? UserTableName { get; set; } |
||||
public string? UserNameFieldName { get; set; } |
||||
public string? PasswordFieldName { get; set; } |
||||
public long? Expires { get; set; } |
||||
public List<ClaimItem>? Claim { get; set; } |
||||
public bool? DisableSystemInterface { get; set; } |
||||
} |
||||
|
||||
public class ClaimItem |
||||
{ |
||||
public string? Key { get; set; } |
||||
public string? FieldName { get; set; } |
||||
public string? Type { get; set; } |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Configuration |
||||
{ |
||||
public class ReZeroUi |
||||
{ |
||||
public bool ShowNativeApiDocument { get; set; } |
||||
public string? DefaultIndexSource { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Configuration |
||||
{ |
||||
public class ReZeroUiBasicdatabase |
||||
{ |
||||
public SqlSugar.DbType DbType { get; set; } |
||||
public string? ConnectionString { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
using Newtonsoft.Json.Linq; |
||||
using ReZero.SuperAPI; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public class ActivatorHelper |
||||
{ |
||||
/// <summary> |
||||
/// Create an instance of the specified class type. |
||||
/// </summary> |
||||
/// <param name="classType">The type of the class to create an instance of.</param> |
||||
/// <param name="nonPublic">Specifies whether to include non-public constructors.</param> |
||||
/// <returns>The created instance of the class.</returns> |
||||
internal static object CreateInstance(Type classType, bool nonPublic, Microsoft.Extensions.DependencyInjection.ServiceProvider serviceProvider) |
||||
{ |
||||
if (classType.GetCustomAttribute<ApiAttribute>()!=null) |
||||
{ |
||||
var p = serviceProvider; |
||||
var result= p!.GetService(classType); |
||||
var diProperties = classType.GetProperties().Where(it => it.GetCustomAttribute<DIAttribute>() != null); |
||||
foreach (var item in diProperties) |
||||
{ |
||||
item.SetValue(result, p!.GetService(item.PropertyType)); |
||||
} |
||||
return result; |
||||
} |
||||
else |
||||
{ |
||||
// If the class has no parameters in the constructor, directly instantiate the object |
||||
return Activator.CreateInstance(classType, nonPublic); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
// 自定义的DI属性 |
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] |
||||
public class DIAttribute : Attribute |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,78 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using Microsoft.Extensions.DependencyInjection; |
||||
using ReZero.SuperAPI; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Reflection; |
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public class DependencyInjectionModule |
||||
{ |
||||
public static void Init(IServiceCollection services, ReZeroOptions options) |
||||
{ |
||||
if (options.DependencyInjectionOptions?.Assemblies?.Any()!=true) |
||||
{ |
||||
return; |
||||
} |
||||
var types = options.DependencyInjectionOptions.Assemblies.SelectMany(it=>it.GetTypes()).Where(type => !type.IsAbstract && !type.IsInterface); |
||||
foreach (var type in types) |
||||
{ |
||||
var interfaces = type.GetInterfaces(); |
||||
var interfacesNoRezero = type.GetInterfaces().Where(it => !(it.FullName?.StartsWith("ReZero.")==true)); |
||||
if (type.GetCustomAttribute<ApiAttribute>() != null) |
||||
{ |
||||
InitApiType(services, type); |
||||
} |
||||
else |
||||
{ |
||||
InitDefaultType(services, type, interfaces, interfacesNoRezero); |
||||
} |
||||
} |
||||
InitApiType(services, typeof(InternalInitApi)); |
||||
} |
||||
|
||||
private static void InitDefaultType(IServiceCollection services, Type type, Type[] interfaces, IEnumerable<Type> interfacesNoRezero) |
||||
{ |
||||
if (type == null) |
||||
{ |
||||
return; |
||||
} |
||||
if (type?.GetGenericArguments()?.Length > 0) |
||||
{ |
||||
return; |
||||
} |
||||
foreach (var @interface in interfaces) |
||||
{ |
||||
if (@interface == typeof(ITransientContract)) |
||||
{ |
||||
services.AddTransient(type!, type!); |
||||
foreach (var item in interfacesNoRezero) |
||||
{ |
||||
services.AddTransient(item, type!); |
||||
} |
||||
} |
||||
else if (@interface == typeof(IScopeContract)) |
||||
{ |
||||
services.AddScoped(type!, type!); |
||||
foreach (var item in interfacesNoRezero) |
||||
{ |
||||
services.AddScoped(item, type!); |
||||
} |
||||
} |
||||
else if (@interface == typeof(ISingletonContract)) |
||||
{ |
||||
services.AddSingleton(type!, type!); |
||||
foreach (var item in interfacesNoRezero) |
||||
{ |
||||
services.AddSingleton(item, type!); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
private static void InitApiType(IServiceCollection services, Type type) |
||||
{ |
||||
services.AddTransient(type, type); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
using System.Linq; |
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public class DependencyInjectionOptions |
||||
{ |
||||
public Assembly[]? Assemblies { get; set; } |
||||
public bool InitDependencyInjection => Assemblies?.Any() == true; |
||||
public DependencyInjectionOptions(params Assembly[] assemblies) |
||||
{ |
||||
if (this.InitDependencyInjection == false) |
||||
{ |
||||
this.Assemblies = assemblies; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,121 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using Microsoft.Extensions.Configuration; |
||||
using Microsoft.Extensions.DependencyInjection; |
||||
using Microsoft.Extensions.Logging; |
||||
using ReZero.SuperAPI; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IdentityModel.Tokens.Jwt; |
||||
using System.Linq; |
||||
using System.Security.Claims; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public class DependencyResolver |
||||
{ |
||||
public static ServiceProvider Provider { get => ServiceLocator.Services!.BuildServiceProvider(); } |
||||
public static IHttpContextAccessor? httpContextAccessor = null; |
||||
public static ILogger<SuperAPIMiddleware>? logger = null; |
||||
public static T GetService<T>() where T : class
|
||||
{ |
||||
return Provider!.GetService<T>(); |
||||
} |
||||
|
||||
public static ILogger<SuperAPIMiddleware> GetLogger() |
||||
{ |
||||
if (logger == null) |
||||
{ |
||||
logger = ReZero.DependencyInjection.DependencyResolver.GetService<ILogger<SuperAPIMiddleware>>(); |
||||
} |
||||
return logger; |
||||
} |
||||
public static ClaimsPrincipal GetClaims() |
||||
{ |
||||
if (httpContextAccessor == null) |
||||
{ |
||||
if (Provider!.GetService<IHttpContextAccessor>()?.HttpContext == null) |
||||
{ |
||||
throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); |
||||
} |
||||
httpContextAccessor = Provider!.GetService<IHttpContextAccessor>(); |
||||
} |
||||
HttpContext httpContext = httpContextAccessor!.HttpContext; |
||||
var authHeader = httpContext.Request.Headers["Authorization"].FirstOrDefault(); |
||||
|
||||
if (authHeader != null && authHeader.StartsWith("Bearer ")) |
||||
{ |
||||
var token = authHeader.Substring("Bearer ".Length).Trim(); |
||||
var handler = new JwtSecurityTokenHandler(); |
||||
|
||||
try |
||||
{ |
||||
var jwtToken = handler.ReadJwtToken(token); |
||||
var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(jwtToken.Claims)); |
||||
return claimsPrincipal; |
||||
} |
||||
catch (Exception) |
||||
{ |
||||
// Handle token parsing error |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
public static T GetHttpContextService<T>() where T : class
|
||||
{ |
||||
if (httpContextAccessor == null) |
||||
{ |
||||
if (Provider!.GetService<IHttpContextAccessor>()?.HttpContext == null) |
||||
{ |
||||
throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); |
||||
} |
||||
httpContextAccessor = Provider!.GetService<IHttpContextAccessor>(); |
||||
} |
||||
return httpContextAccessor!.HttpContext!.RequestServices!.GetService<T>(); |
||||
} |
||||
public static T GetHttpContextRequiredService<T>() where T : class
|
||||
{ |
||||
if (httpContextAccessor == null) |
||||
{ |
||||
if (Provider!.GetService<IHttpContextAccessor>()?.HttpContext == null) |
||||
{ |
||||
throw new Exception("Requires builder.Services.AddHttpContextAccessor()"); |
||||
} |
||||
httpContextAccessor = Provider!.GetService<IHttpContextAccessor>(); |
||||
} |
||||
return httpContextAccessor!.HttpContext!.RequestServices!.GetRequiredService<T>(); |
||||
} |
||||
public static T GetRequiredService<T>() where T : class
|
||||
{ |
||||
return Provider?.GetRequiredService<T>(); |
||||
} |
||||
public static T GetNewService<T>() where T : class
|
||||
{ |
||||
using var scope = Provider?.CreateScope(); |
||||
return scope?.ServiceProvider?.GetService<T>(); |
||||
} |
||||
public static T GetNewRequiredService<T>() where T : class
|
||||
{ |
||||
using var scope = Provider?.CreateScope(); |
||||
return scope?.ServiceProvider?.GetRequiredService<T>(); |
||||
} |
||||
public static string GetLoggedInUser() |
||||
{ |
||||
var claimsPrincipal = GetClaims(); |
||||
if (claimsPrincipal == null) |
||||
{ |
||||
return null; |
||||
} |
||||
|
||||
var usernameClaim = claimsPrincipal.Claims.FirstOrDefault(c => c.Type == "unique_name"); |
||||
if (usernameClaim == null) |
||||
{ |
||||
return null; |
||||
} |
||||
|
||||
return usernameClaim.Value; ; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public interface IDependencyInjection |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public interface IScopeContract: IDependencyInjection |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
|
||||
public interface ISingletonContract: IDependencyInjection |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
public interface ITransientContract: IDependencyInjection |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.DependencyInjection |
||||
{ |
||||
[AttributeUsage(AttributeTargets.Property)] |
||||
public class PropertyInjectionAttribute : Attribute |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,220 @@
|
||||
using System.Data; |
||||
using System.IO; |
||||
using System; |
||||
using ClosedXML.Excel; |
||||
using System.Linq; |
||||
using ReZero.SuperAPI; |
||||
|
||||
namespace ReZero.Excel |
||||
{ |
||||
public class DataTableToExcel |
||||
{ |
||||
/// <summary> |
||||
/// 导出Excel |
||||
/// </summary> |
||||
/// <param name="dts"></param> |
||||
/// <param name="name"></param> |
||||
/// <param name="widths"></param> |
||||
/// <returns></returns> |
||||
public static byte[] ExportExcel(ExcelData[] dts, string name, int[]? widths = null,string? navName=null) |
||||
{ |
||||
XLWorkbook wb = new XLWorkbook(); |
||||
|
||||
// 添加导航工作表 |
||||
var navigationSheet = wb.Worksheets.Add(TextHandler.GetCommonText("导航","Navigation")); |
||||
navigationSheet.Cell(1, 1).Value = TextHandler.GetCommonText(navName ?? "Sheet名称","Sheet Name"); |
||||
navigationSheet.Cell(1, 2).Value = TextHandler.GetCommonText("备注","Description"); // 可以添加其他信息,例如描述 |
||||
|
||||
int index = 0; |
||||
int navRowIndex = 2; // 导航工作表的行索引 |
||||
foreach (var data in dts) |
||||
{ |
||||
var dt = data.DataTable!; |
||||
index++; |
||||
for (int i = 1; i < 15; i++) |
||||
{ |
||||
// 删除Ignore列 |
||||
if (dt.Columns.Contains("Column" + i)) |
||||
{ |
||||
dt.Columns.Remove("Column" + i); |
||||
} |
||||
} |
||||
var newdt = new DataTable(); |
||||
foreach (DataColumn item in dt.Columns) |
||||
{ |
||||
newdt.Columns.Add(item.ColumnName); |
||||
} |
||||
foreach (DataRow item in dt.Rows) |
||||
{ |
||||
DataRow dr = newdt.NewRow(); |
||||
foreach (DataColumn c in dt.Columns) |
||||
{ |
||||
var value = item[c.ColumnName] + ""; |
||||
dr[c.ColumnName] = value; |
||||
} |
||||
newdt.Rows.Add(dr); |
||||
} |
||||
string sheetName; |
||||
try |
||||
{ |
||||
sheetName = dt.TableName; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
catch |
||||
{ |
||||
if (dt.TableName.Length < 28) |
||||
{ |
||||
sheetName = "_" + dt.TableName; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
else |
||||
{ |
||||
sheetName = dt.TableName.Substring(0, 25) + DateTime.Now.ToString("...") + index; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
} |
||||
|
||||
var worksheet = wb.Worksheets.Last(); |
||||
foreach (var item in worksheet.Tables) |
||||
{ |
||||
item.Theme = XLTableTheme.None; |
||||
} |
||||
// 处理列 |
||||
for (int i = 0; i < dt.Columns.Count; i++) |
||||
{ |
||||
worksheet.Cell(1, i + 1).Value = dt.Columns[i].ColumnName; |
||||
} |
||||
// 处理列宽 |
||||
var colsWidth = dt.Columns.Cast<DataColumn>().Select(it => 20).ToArray(); |
||||
if (widths != null) |
||||
{ |
||||
colsWidth = widths; |
||||
} |
||||
for (int j = 1; j <= colsWidth.Length; j++) |
||||
{ |
||||
worksheet.Columns(j, j).Width = colsWidth[j - 1]; |
||||
} |
||||
|
||||
// 在导航工作表中添加链接 |
||||
var navCell = navigationSheet.Cell(navRowIndex, 1); |
||||
navCell.Value = sheetName; |
||||
navCell.SetHyperlink(new XLHyperlink($"'{sheetName}'!A1")); |
||||
navCell.Style.Font.FontColor = XLColor.Blue; |
||||
navCell.Style.Font.Underline = XLFontUnderlineValues.Single; |
||||
navigationSheet.Cell(navRowIndex, 2).Value = data.TableDescrpition; |
||||
navRowIndex++; |
||||
} |
||||
|
||||
var minWidth = 50; |
||||
if (navigationSheet.Column(1).Width < minWidth) |
||||
{ |
||||
navigationSheet.Column(1).Width = minWidth; |
||||
} |
||||
if (navigationSheet.Column(2).Width < minWidth) |
||||
{ |
||||
navigationSheet.Column(2).Width = minWidth; |
||||
} |
||||
|
||||
// 缓存到内存流,然后返回 |
||||
byte[] bytes = null!; |
||||
using (MemoryStream stream = new MemoryStream()) |
||||
{ |
||||
wb.SaveAs(stream); |
||||
bytes = stream.ToArray(); |
||||
} |
||||
return bytes; |
||||
} |
||||
|
||||
|
||||
/// <summary> |
||||
/// 导出Excel |
||||
/// </summary> |
||||
/// <param name="dts"></param> |
||||
/// <param name="name"></param> |
||||
/// <param name="widths"></param> |
||||
/// <returns></returns> |
||||
public static byte[] ExportExcel(DataSet dts, string name, int[]? widths = null, string? navName = null) |
||||
{ |
||||
XLWorkbook wb = new XLWorkbook(); |
||||
|
||||
int index = 0; |
||||
foreach (DataTable data in dts.Tables) |
||||
{ |
||||
var dt = data!; |
||||
index++; |
||||
for (int i = 1; i < 15; i++) |
||||
{ |
||||
// 删除Ignore列 |
||||
if (dt.Columns.Contains("Column" + i)) |
||||
{ |
||||
dt.Columns.Remove("Column" + i); |
||||
} |
||||
} |
||||
var newdt = new DataTable(); |
||||
foreach (DataColumn item in dt.Columns) |
||||
{ |
||||
newdt.Columns.Add(item.ColumnName); |
||||
} |
||||
foreach (DataRow item in dt.Rows) |
||||
{ |
||||
DataRow dr = newdt.NewRow(); |
||||
foreach (DataColumn c in dt.Columns) |
||||
{ |
||||
var value = item[c.ColumnName] + ""; |
||||
dr[c.ColumnName] = value; |
||||
} |
||||
newdt.Rows.Add(dr); |
||||
} |
||||
string sheetName; |
||||
try |
||||
{ |
||||
sheetName = dt.TableName; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
catch |
||||
{ |
||||
if (dt.TableName.Length < 28) |
||||
{ |
||||
sheetName = "_" + dt.TableName; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
else |
||||
{ |
||||
sheetName = dt.TableName.Substring(0, 25) + DateTime.Now.ToString("...") + index; |
||||
wb.Worksheets.Add(newdt, sheetName); |
||||
} |
||||
} |
||||
|
||||
var worksheet = wb.Worksheets.Last(); |
||||
foreach (var item in worksheet.Tables) |
||||
{ |
||||
item.Theme = XLTableTheme.None; |
||||
} |
||||
// 处理列 |
||||
for (int i = 0; i < dt.Columns.Count; i++) |
||||
{ |
||||
worksheet.Cell(1, i + 1).Value = dt.Columns[i].ColumnName; |
||||
} |
||||
// 处理列宽 |
||||
var colsWidth = dt.Columns.Cast<DataColumn>().Select(it => 20).ToArray(); |
||||
if (widths != null) |
||||
{ |
||||
colsWidth = widths; |
||||
} |
||||
for (int j = 1; j <= colsWidth.Length; j++) |
||||
{ |
||||
worksheet.Columns(j, j).Width = colsWidth[j - 1]; |
||||
} |
||||
|
||||
} |
||||
// 缓存到内存流,然后返回 |
||||
byte[] bytes = null!; |
||||
using (MemoryStream stream = new MemoryStream()) |
||||
{ |
||||
wb.SaveAs(stream); |
||||
bytes = stream.ToArray(); |
||||
} |
||||
return bytes; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,24 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Data; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.Excel |
||||
{ |
||||
|
||||
/// <summary> |
||||
/// Represents the Excel data. |
||||
/// </summary> |
||||
public class ExcelData |
||||
{ |
||||
/// <summary> |
||||
/// Gets or sets the description of the table. |
||||
/// </summary> |
||||
public string? TableDescrpition { get; set; } |
||||
|
||||
/// <summary> |
||||
/// Gets or sets the DataTable. |
||||
/// </summary> |
||||
public DataTable? DataTable { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>netstandard2.1</TargetFramework> |
||||
<Nullable>enable</Nullable> |
||||
<AssemblyVersion>1.8.12</AssemblyVersion> |
||||
<Version></Version> |
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<Compile Remove="AssemblyModuleSetup\新文件夹\**" /> |
||||
<Compile Remove="SuperAPI\DatabseModels\Public\**" /> |
||||
<Compile Remove="SuperAPI\DatabseModels\Table\**" /> |
||||
<Compile Remove="SuperAPI\Entities\DTO\**" /> |
||||
<Compile Remove="VueTemplate\**" /> |
||||
<EmbeddedResource Remove="AssemblyModuleSetup\新文件夹\**" /> |
||||
<EmbeddedResource Remove="SuperAPI\DatabseModels\Public\**" /> |
||||
<EmbeddedResource Remove="SuperAPI\DatabseModels\Table\**" /> |
||||
<EmbeddedResource Remove="SuperAPI\Entities\DTO\**" /> |
||||
<EmbeddedResource Remove="VueTemplate\**" /> |
||||
<None Remove="AssemblyModuleSetup\新文件夹\**" /> |
||||
<None Remove="SuperAPI\DatabseModels\Public\**" /> |
||||
<None Remove="SuperAPI\DatabseModels\Table\**" /> |
||||
<None Remove="SuperAPI\Entities\DTO\**" /> |
||||
<None Remove="VueTemplate\**" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="ClosedXML" Version="0.102.2" /> |
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.30" /> |
||||
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.1" /> |
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" /> |
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> |
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.10.0" /> |
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" /> |
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" /> |
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.154" /> |
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.0.2" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?> |
||||
<package > |
||||
<metadata> |
||||
<id>Rezero</id> |
||||
<version>1.8.12</version> |
||||
<authors>sunkaixuan</authors> |
||||
<owners>果糖大数据科技</owners> |
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> |
||||
<projectUrl>https://github.com/sunkaixuan/Rezero</projectUrl> |
||||
<iconUrl>https://secure.gravatar.com/avatar/a82c03402497b2e58fd65038a3699b30</iconUrl> |
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
||||
<description>rezero 核心库 (不包含UI) 无需代码只要界面点点就能生成接口、SQL生成接口、代码生成接口、低代码、热插拔、 文档地址: https://www.donet5.com/Doc/32/2580 </description> |
||||
<copyright>Copyright 2016</copyright> |
||||
<tags>低代码 Zero 超级API API 导出文档</tags> |
||||
<dependencies> |
||||
<dependency id="ClosedXML" version="0.102.2" /> |
||||
<dependency id="SqlSugarCore" version="5.1.4.154" /> |
||||
<dependency id="System.Linq.Dynamic.Core" version="1.6.0.2" /> |
||||
<dependency id="Microsoft.CodeAnalysis.CSharp.Scripting" version="4.10.0" /> |
||||
</dependencies> |
||||
</metadata> |
||||
<files> |
||||
<file src="G:\Git\ReZero\ReZero\bin\Debug\netstandard2.1\ReZero.dll" target="lib\netstandard2.1" /> |
||||
</files> |
||||
</package> |
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?> |
||||
<package > |
||||
<metadata> |
||||
<id>Rezero.Api</id> |
||||
<version>1.8.12</version> |
||||
<authors>sunkaixuan</authors> |
||||
<owners>果糖大数据科技</owners> |
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> |
||||
<projectUrl>https://github.com/sunkaixuan/Rezero</projectUrl> |
||||
<iconUrl>https://secure.gravatar.com/avatar/a82c03402497b2e58fd65038a3699b30</iconUrl> |
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
||||
<description> rezero api (包含UI) 无需代码只要界面点点就能生成接口、SQL生成接口、代码生成接口、低代码、热插拔、 文档地址: https://www.donet5.com/Doc/32/2580 </description> |
||||
<copyright>Copyright 2016</copyright> |
||||
<tags>低代码 Zero 超级API API 导出文档</tags> |
||||
<dependencies> |
||||
<dependency id="Rezero" version="1.8.12" /> |
||||
<dependency id="Microsoft.AspNetCore.Authentication.JwtBearer" version="2.1.30" /> |
||||
<dependency id="Microsoft.AspNetCore.Cors" version="2.1.1" /> |
||||
</dependencies> |
||||
<contentFiles> |
||||
<files include="any/any/wwwroot/rezero/**" buildAction="None" copyToOutput="true" flatten="false" /> |
||||
</contentFiles> |
||||
</metadata> |
||||
<files> |
||||
<file src="G:\Git\ReZero\SuperAPI\wwwroot\ReZero\**\*.*" target="contentFiles\any\any\wwwroot\rezero" /> |
||||
</files> |
||||
</package> |
@ -0,0 +1,156 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using Microsoft.CodeAnalysis.CSharp.Syntax; |
||||
using Microsoft.Extensions.Logging; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Security.Policy; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class DynamicApiManager : IDynamicApi |
||||
{ |
||||
/// <summary> |
||||
/// Determines if the given URL is a valid API endpoint. |
||||
/// </summary> |
||||
/// <param name="url">The URL to check.</param> |
||||
/// <returns>True if the URL is a valid API endpoint, false otherwise.</returns> |
||||
public bool IsApi(string url) |
||||
{ |
||||
var db = App.Db; |
||||
var isAnyUrl = CacheManager<ZeroInterfaceList>.Instance.GetList() |
||||
.Any(it => |
||||
it!.Url!.ToLower() == url.ToLower()|| |
||||
(it.OriginalUrl!=null&&url.ToLower().StartsWith(it.OriginalUrl.ToLower())) |
||||
); |
||||
return isAnyUrl; |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Writes the response for the given HTTP context. |
||||
/// </summary> |
||||
/// <param name="context">The HTTP context.</param> |
||||
public async Task WriteAsync(HttpContext context) |
||||
{ |
||||
var helper = new DynamicApiHelper(); |
||||
var requestMethodString = context.Request.Method; |
||||
HttpRequestMethod requestMethod; |
||||
if (helper.IsHttpMethod(requestMethodString, out requestMethod)) |
||||
{ |
||||
await WriteAsyncSuccess(context, helper, requestMethod); |
||||
} |
||||
else |
||||
{ |
||||
await WriteError(context); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Writes the response for a successful API request. |
||||
/// </summary> |
||||
/// <param name="context">The HTTP context.</param> |
||||
/// <param name="helper">The dynamic API helper.</param> |
||||
/// <param name="requestMethod">The HTTP request method.</param> |
||||
private static async Task WriteAsyncSuccess(HttpContext context, DynamicApiHelper helper, HttpRequestMethod requestMethod) |
||||
{ |
||||
var handler = helper.GetHandler(requestMethod, context); |
||||
var db = App.Db; |
||||
var path = context.Request.Path.ToString()?.ToLower(); |
||||
var interInfo = CacheManager<ZeroInterfaceList> |
||||
.Instance.GetList() |
||||
.Where(it => |
||||
it.Url!.ToLower() == path |
||||
|| |
||||
(it.OriginalUrl != null && path!.ToLower().StartsWith(it.OriginalUrl.ToLower())) |
||||
)?.First(); |
||||
interInfo = db.Utilities.TranslateCopy(interInfo); |
||||
var dynamicInterfaceContext = new InterfaceContext() { InterfaceType = InterfaceType.DynamicApi, HttpContext = context, InterfaceInfo = interInfo }; |
||||
if (interInfo == null) |
||||
{ |
||||
var message = TextHandler.GetCommonText($"未找到内置接口 {path} ,请在表ZeroInterfaceList中查询", $"No built-in interface {path} is found. Query in the table ZeroInterfaceList"); |
||||
context.Response.StatusCode = 500; |
||||
await context.Response.WriteAsync(message); |
||||
} |
||||
else |
||||
{ |
||||
try |
||||
{ |
||||
DataService dataService = new DataService(); |
||||
interInfo!.DataModel!.ApiId = interInfo.Id; |
||||
interInfo!.DataModel!.ResultType = interInfo.DataModel?.ResultType; |
||||
interInfo!.DataModel!.Sql = interInfo.DataModel?.Sql; |
||||
interInfo!.DataModel!.DataBaseId = interInfo.DataModel?.DataBaseId ?? 0; |
||||
dataService.BindHttpParameters.Bind(interInfo.DataModel, context, path, !string.IsNullOrEmpty(interInfo.OriginalUrl), interInfo); |
||||
dynamicInterfaceContext.DataModel = interInfo.DataModel; |
||||
var service = DependencyInjection.DependencyResolver.Provider; |
||||
dynamicInterfaceContext.ServiceProvider = service; |
||||
interInfo.DataModel!.ServiceProvider = service; |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutingAsync(dynamicInterfaceContext); |
||||
await InstanceManager.AuthorizationAsync(context, dynamicInterfaceContext); |
||||
var data = await dataService.ExecuteAction(interInfo.DataModel!); |
||||
data = GetUserInfo(path, interInfo, data); |
||||
SetDataToAop(dynamicInterfaceContext, data); |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutedAsync(dynamicInterfaceContext); |
||||
var resultModel = interInfo.CustomResultModel ?? new ResultModel(); |
||||
resultModel.OutPutData = interInfo.DataModel?.OutPutData; |
||||
data = new ResultService().GetResult(data!, resultModel); |
||||
if (IsNoSystemPublicApi(interInfo, context)) |
||||
data = SuperAPIModule._apiOptions?.InterfaceOptions?.MergeDataToStandardDtoFunc?.Invoke(data) ?? data; |
||||
var json = JsonHelper.SerializeObject(data, SuperAPIModule._apiOptions!.InterfaceOptions?.JsonSerializerSettings); |
||||
context.Response.ContentType = PubConst.DataSource_ApplicationJson; |
||||
await context.Response.WriteAsync(json); |
||||
} |
||||
catch (Exception ex) |
||||
{ |
||||
ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(ex.Message); |
||||
object data = new ErrorResponse { message = ex.Message }; |
||||
if (IsNoSystemPublicApi(interInfo, context)) |
||||
data = SuperAPIModule._apiOptions?.InterfaceOptions?.MergeDataToStandardDtoFunc?.Invoke(data) ?? data; |
||||
context.Response.ContentType = PubConst.DataSource_ApplicationJson; |
||||
await context.Response.WriteAsync(JsonHelper.SerializeObject(data, SuperAPIModule._apiOptions!.InterfaceOptions?.JsonSerializerSettings)); |
||||
dynamicInterfaceContext.Exception = ex; |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnErrorAsync(dynamicInterfaceContext); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private static bool IsNoSystemPublicApi(ZeroInterfaceList interInfo, HttpContext context) |
||||
{ |
||||
var query = context.Request.Query; |
||||
var supportCustomDto = query.ContainsKey("supportCustomDto") && query["supportCustomDto"].ToString().ToLower() == "true"; |
||||
return ((interInfo.Url?.ToLower()?.StartsWith("/public/") != true) && interInfo.Id != InterfaceListInitializerProvider.GetTokenId) || supportCustomDto; |
||||
} |
||||
|
||||
private static void SetDataToAop(InterfaceContext dynamicInterfaceContext, object? data) |
||||
{ |
||||
if (dynamicInterfaceContext.DataModel != null) |
||||
dynamicInterfaceContext.DataModel.Data = data; |
||||
} |
||||
|
||||
private static object? GetUserInfo(string? path, ZeroInterfaceList interInfo, object? data) |
||||
{ |
||||
if (path == PubConst.Jwt_GetJwtInfo) |
||||
{ |
||||
data = interInfo?.DataModel?.ClaimList; |
||||
if (interInfo?.DataModel?.ClaimList?.Any()!=true) |
||||
{ |
||||
throw new Exception(TextHandler.GetCommonText("你没有启用JWT授权或者没有配置Claim", "You did not enable JWT authorization or did not configure Claim")); |
||||
} |
||||
} |
||||
return data; |
||||
} |
||||
|
||||
|
||||
/// <summary> |
||||
/// Writes the response for an invalid API request. |
||||
/// </summary> |
||||
/// <param name="context">The HTTP context.</param> |
||||
private static async Task WriteError(HttpContext context) |
||||
{ |
||||
context.Response.StatusCode = 400; // Bad Request |
||||
await context.Response.WriteAsync("Invalid request method"); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,7 @@
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class ErrorResponse |
||||
{ |
||||
public string? message { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class HandleResult |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public enum HttpRequestMethod |
||||
{ |
||||
GET, |
||||
POST, |
||||
PUT, |
||||
DELETE, |
||||
PATCH, |
||||
All |
||||
} |
||||
} |
@ -0,0 +1,50 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
/// <summary> |
||||
/// Helper class for handling API requests and determining appropriate request method handlers. |
||||
/// </summary> |
||||
internal class DynamicApiHelper |
||||
{ |
||||
/// <summary> |
||||
/// Determines if the provided string represents a valid HTTP request method. |
||||
/// </summary> |
||||
/// <param name="requestMethodString">The string representing the HTTP request method.</param> |
||||
/// <param name="requestMethod">The parsed HttpRequestMethod enum value.</param> |
||||
/// <returns>True if the string represents a valid HTTP request method; otherwise, false.</returns> |
||||
public bool IsHttpMethod(string requestMethodString, out HttpRequestMethod requestMethod) |
||||
{ |
||||
// Try to parse the request method string into HttpRequestMethod enum. |
||||
return Enum.TryParse(requestMethodString, ignoreCase: true, out requestMethod); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Gets the appropriate request method handler based on the provided HTTP request method. |
||||
/// </summary> |
||||
/// <param name="method">The parsed HttpRequestMethod enum representing the HTTP request method.</param> |
||||
/// <param name="context">The HttpContext associated with the request.</param> |
||||
/// <returns>An instance of the appropriate request method handler.</returns> |
||||
public IRequestMethodHandler GetHandler(HttpRequestMethod method, HttpContext context) |
||||
{ |
||||
// Determine the request method and return the corresponding handler. |
||||
switch (method) |
||||
{ |
||||
case HttpRequestMethod.GET: |
||||
return new GetRequestHandler(context); |
||||
case HttpRequestMethod.POST: |
||||
return new PostRequestHandler(context); |
||||
case HttpRequestMethod.PUT: |
||||
return new PutRequestHandler(context); |
||||
case HttpRequestMethod.DELETE: |
||||
return new DeleteRequestHandler(context); |
||||
case HttpRequestMethod.PATCH: |
||||
return new PatchRequestHandler(context); |
||||
default: |
||||
// Throw an exception if the request method is not supported. |
||||
throw new NotSupportedException("Unsupported HTTP request method"); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public interface IDynamicApi:ISuperApi |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public interface IRequestMethodHandler |
||||
{ |
||||
HandleResult HandleRequest(); |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class DeleteRequestHandler : IRequestMethodHandler |
||||
{ |
||||
private HttpContext context; |
||||
|
||||
public DeleteRequestHandler(HttpContext context) |
||||
{ |
||||
this.context = context; |
||||
} |
||||
|
||||
public HandleResult HandleRequest() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class GetRequestHandler : IRequestMethodHandler |
||||
{ |
||||
private HttpContext context; |
||||
|
||||
public GetRequestHandler(HttpContext context) |
||||
{ |
||||
this.context = context; |
||||
} |
||||
|
||||
public HandleResult HandleRequest() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class PatchRequestHandler : IRequestMethodHandler |
||||
{ |
||||
private HttpContext context; |
||||
|
||||
public PatchRequestHandler(HttpContext context) |
||||
{ |
||||
this.context = context; |
||||
} |
||||
|
||||
public HandleResult HandleRequest() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class PostRequestHandler : IRequestMethodHandler |
||||
{ |
||||
private HttpContext context; |
||||
|
||||
public PostRequestHandler(HttpContext context) |
||||
{ |
||||
this.context = context; |
||||
} |
||||
|
||||
|
||||
public HandleResult HandleRequest() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,22 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class PutRequestHandler : IRequestMethodHandler |
||||
{ |
||||
private HttpContext context; |
||||
|
||||
public PutRequestHandler(HttpContext context) |
||||
{ |
||||
this.context = context; |
||||
} |
||||
|
||||
public HandleResult HandleRequest() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public interface IInternalApi : ISuperApi |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,95 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using Microsoft.Extensions.Logging; |
||||
using SqlSugar; |
||||
using System; |
||||
using System.Linq; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
/// <summary> |
||||
/// Implementation of the ReZero API interface (IReZeroApi) to handle API-related operations. |
||||
/// </summary> |
||||
public class InternalApi : IInternalApi |
||||
{ |
||||
/// <summary> |
||||
/// Checks if the provided URL corresponds to a ReZero API endpoint. |
||||
/// </summary> |
||||
/// <param name="url">The URL to be checked.</param> |
||||
/// <returns>True if the URL is a ReZero API endpoint, otherwise false.</returns> |
||||
public bool IsApi(string url) |
||||
{ |
||||
return url.ToString().ToLower().TrimStart('/')?.StartsWith(NamingConventionsConst.ApiReZeroRoute.ToLower()) == true; |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Writes the API response asynchronously to the specified HttpContext. |
||||
/// </summary> |
||||
/// <param name="context">The HttpContext representing the current request and response context.</param> |
||||
/// <returns>A Task representing the asynchronous operation.</returns> |
||||
public async Task WriteAsync(HttpContext context) |
||||
{ |
||||
var db = App.Db; |
||||
|
||||
var path = context.Request.Path.ToString()?.ToLower(); |
||||
var interfaceInfos = db.Queryable<ZeroInterfaceList>().ToList(); |
||||
var interInfo = interfaceInfos.Where(it => it.Url!.ToLower() == path).FirstOrDefault(); |
||||
|
||||
if (interInfo == null) |
||||
{ |
||||
var message = TextHandler.GetCommonText($"未找到内置接口 {path} ,请在表ZeroInterfaceList中查询", $"No built-in interface {path} is found. Query in the table ZeroInterfaceList"); |
||||
context.Response.StatusCode = 500; |
||||
await context.Response.WriteAsync(message); |
||||
} |
||||
else |
||||
{ |
||||
var systemInterfaceContext = new InterfaceContext() { InterfaceType = InterfaceType.SystemApi, HttpContext = context, InterfaceInfo = interInfo }; |
||||
try |
||||
{ |
||||
DataService dataService = new DataService(); |
||||
interInfo!.DataModel!.ApiId = interInfo.Id; |
||||
dataService.BindHttpParameters.Bind(interInfo.DataModel, context, path, !string.IsNullOrEmpty(interInfo.OriginalUrl), interInfo); |
||||
var service = DependencyInjection.DependencyResolver.Provider; |
||||
systemInterfaceContext.ServiceProvider = service; |
||||
interInfo!.DataModel!.ServiceProvider = service; |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutingAsync(systemInterfaceContext); |
||||
await InstanceManager.AuthorizationAsync(context, systemInterfaceContext); |
||||
var data = await dataService.ExecuteAction(interInfo.DataModel ?? new DataModel() { }); |
||||
SetDataToAop(systemInterfaceContext, data); |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnExecutedAsync(systemInterfaceContext); |
||||
var resultModel = interInfo.CustomResultModel ?? new ResultModel(); |
||||
resultModel.OutPutData = interInfo.DataModel?.OutPutData; |
||||
data = new ResultService().GetResult(data, resultModel); |
||||
await Write(context, interInfo, data); |
||||
} |
||||
catch (Exception ex) |
||||
{ |
||||
ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(ex.Message); |
||||
context.Response.ContentType = PubConst.DataSource_ApplicationJson; |
||||
await context.Response.WriteAsync(db.Utilities.SerializeObject(new { message = ex.Message })); |
||||
systemInterfaceContext.Exception = ex; |
||||
await SuperAPIModule._apiOptions!.InterfaceOptions!.SuperApiAop!.OnErrorAsync(systemInterfaceContext); ; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private static void SetDataToAop(InterfaceContext systemInterfaceContext, object data) |
||||
{ |
||||
if (systemInterfaceContext.DataModel != null) |
||||
systemInterfaceContext.DataModel.Data = data; |
||||
} |
||||
|
||||
private static async Task Write(HttpContext context, ZeroInterfaceList interInfo, object data) |
||||
{ |
||||
if (interInfo.CustomResultModel?.ResultType == ResultType.File) |
||||
{ |
||||
await InstanceManager.WriteFileAsync(context, interInfo, data); |
||||
} |
||||
else |
||||
{ |
||||
context.Response.ContentType = PubConst.DataSource_ApplicationJson; |
||||
await context.Response.WriteAsync(JsonHelper.SerializeObject(data)); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,145 @@
|
||||
using Microsoft.AspNetCore.Authentication; |
||||
using Microsoft.AspNetCore.Authentication.JwtBearer; |
||||
using Microsoft.AspNetCore.Http; |
||||
using SqlSugar; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Net.Http.Headers; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
internal class InstanceManager |
||||
{ |
||||
|
||||
public static async Task WriteFileAsync(HttpContext context, ZeroInterfaceList interInfo, object data) |
||||
{ |
||||
var fileBytes = (byte[])data; |
||||
context.Response.ContentType = "application/octet-stream"; // Or the appropriate MIME type for your file |
||||
context.Response.ContentLength = fileBytes.Length; |
||||
var fileName = string.Format(interInfo!.CustomResultModel!.GroupName, DateTime.Now.ToString("yyyyMMddHHmmss")); |
||||
var contentDisposition = new ContentDispositionHeaderValue("attachment"); |
||||
contentDisposition.FileName = fileName; |
||||
context.Response.Headers.Add("Content-Disposition", contentDisposition.ToString()); |
||||
// Write the file bytes to the response body |
||||
await context.Response.Body.WriteAsync(fileBytes, 0, fileBytes.Length); |
||||
} |
||||
public static async Task<bool> AuthorizationAsync(HttpContext context, InterfaceContext dynamicInterfaceContext) |
||||
{ |
||||
if (SuperAPIModule._apiOptions!.InterfaceOptions!.NoAuthorizationFunc != null) |
||||
{ |
||||
if (SuperAPIModule._apiOptions!.InterfaceOptions!.NoAuthorizationFunc(dynamicInterfaceContext) == true) |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
if (SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.Enable != true) |
||||
{ |
||||
return true; |
||||
} |
||||
if (context.Request.Path.ToString()?.ToLower() == PubConst.Jwt_TokenUrl) |
||||
{ |
||||
return true; |
||||
} |
||||
if (SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt?.DisableSystemInterface == true) |
||||
{ |
||||
if (dynamicInterfaceContext.InterfaceType == InterfaceType.SystemApi) |
||||
{ |
||||
context.Response.StatusCode = 401; |
||||
throw new Exception(TextHandler.GetCommonText("系统接口被禁用无法访问,修改JWT参数DisableSystemInterface", "If the system interface is disabled and cannot be accessed, modify the JWT parameter DisableSystemInterface")); |
||||
} |
||||
} |
||||
var url = context.Request.Path.ToString().ToLower(); |
||||
if (url.StartsWith("/public/")) |
||||
{ |
||||
return true; |
||||
} |
||||
var jsonClaims = SuperAPIModule._apiOptions?.InterfaceOptions?.Jwt.Claim ?? new List<Configuration.ClaimItem>(); ; |
||||
var authHeader = context.Request.Headers["Authorization"].FirstOrDefault(); |
||||
if (authHeader != null && authHeader.StartsWith("Bearer ")) |
||||
{ |
||||
var token = authHeader.Split(' ')[1]; |
||||
try |
||||
{ |
||||
// 进行JWT令牌验证,例如使用Microsoft.AspNetCore.Authentication.JwtBearer包提供的验证器 |
||||
var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); |
||||
if (authResult.Succeeded) |
||||
{ |
||||
var claims = authResult.Principal.Claims.ToList(); |
||||
foreach (var claim in claims) |
||||
{ |
||||
object value = claim.Value; |
||||
var type=jsonClaims.FirstOrDefault(it => claim.Type?.ToLower() == it.FieldName?.ToLower())?.Type; |
||||
if (!string.IsNullOrEmpty(type)) |
||||
{ |
||||
value = UtilMethods.ConvertDataByTypeName(type,value+""); |
||||
} |
||||
dynamicInterfaceContext.AttachClaimToHttpContext(claim.Type, value); |
||||
} |
||||
if (claims.Any()) |
||||
{ |
||||
var userName = claims[0].Value; |
||||
var list=CacheManager<ZeroPermissionInfo>.Instance.GetList(); |
||||
if (list.Any()&& dynamicInterfaceContext?.InterfaceType==InterfaceType.DynamicApi) |
||||
{ |
||||
var mappings=CacheManager<ZeroPermissionMapping>.Instance.GetList(); |
||||
if (!mappings |
||||
.Where(it => it.UserName!.ToLower() == userName?.ToLower()) |
||||
.Where(it=> it.InterfaceId== dynamicInterfaceContext?.InterfaceInfo?.Id) |
||||
.Any()) |
||||
{ |
||||
throw new Exception(TextHandler.GetCommonText("当前用户在【接口授权】中没有配置可以访问的接口权限 或者 清空所有【接口授权】中的数据", "No interface permission is configured for the current user or the data in all interface permissions is cleared")); |
||||
} |
||||
} |
||||
} |
||||
return true; |
||||
} |
||||
else |
||||
{ |
||||
// 用户未通过身份验证,可能需要进行一些处理,例如返回未经授权的错误 |
||||
context.Response.StatusCode = 401; |
||||
throw new Exception(TextHandler.GetCommonText("用户未通过身份验证", "The user is not authenticated")); |
||||
} |
||||
} |
||||
catch (Exception) |
||||
{ |
||||
// JWT验证失败 |
||||
context.Response.StatusCode = 401; |
||||
throw new Exception(TextHandler.GetCommonText("JWT验证失败", "JWT authentication failed")); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
// Authorization标头缺失或格式不正确 |
||||
context.Response.StatusCode = 401; |
||||
throw new Exception(TextHandler.GetCommonText("Authorization标头缺失或格式不正确", "The Authorization header is missing or incorrectly formatted")); |
||||
} |
||||
} |
||||
public static string GetActionTypeName(ActionType actionType) |
||||
{ |
||||
return $"ReZero.SuperAPI.{actionType}"; |
||||
} |
||||
public static string GetActionTypeName(DataModel dataModel) |
||||
{ |
||||
return $"ReZero.SuperAPI.{dataModel.ActionType}"; |
||||
} |
||||
public static string GetActionTypeElementName(ActionType actionType) |
||||
{ |
||||
return $"ReZero.SuperAPI.Element{actionType}"; |
||||
} |
||||
|
||||
public static string GetSaveInterfaceType(ActionType actionType) |
||||
{ |
||||
return $"ReZero.SuperAPI.SaveInterfaceList{actionType}"; |
||||
} |
||||
public static void CheckActionType(DataModel dataModel, Type actionType) |
||||
{ |
||||
if (actionType == null) |
||||
{ |
||||
throw new ArgumentException($"Invalid ActionType: {dataModel.ActionType}"); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,240 @@
|
||||
using Microsoft.AspNetCore.Http; |
||||
using Newtonsoft.Json.Linq; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Linq; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public partial class BindHttpParameters |
||||
{ |
||||
internal void Bind(DataModel? dataModel, HttpContext context, string? path, bool isUrlParameters, ZeroInterfaceList interInfo) |
||||
{ |
||||
var formDatas = GetFormDatas(context); |
||||
BindPageParameters(dataModel, context, formDatas); |
||||
BindDefaultParameters(dataModel, context, formDatas, interInfo); |
||||
BindOrderByParameters(dataModel, context, formDatas); |
||||
BindGroupByParameters(dataModel, context, formDatas); |
||||
BindUrlParameters(isUrlParameters,path, dataModel!, interInfo); |
||||
} |
||||
|
||||
private void BindUrlParameters(bool isUrlParameters, string? path, DataModel dataModel, ZeroInterfaceList interInfo) |
||||
{ |
||||
if (isUrlParameters) |
||||
{ |
||||
var parameterString = path!.Replace(interInfo.OriginalUrl!.ToLower(), string.Empty); |
||||
var parameters= parameterString.Split('/').Where(it=>!string.IsNullOrWhiteSpace(it)).ToArray(); |
||||
var index = 0; |
||||
foreach (var item in dataModel.DefaultParameters??new List<DataModelDefaultParameter>()) |
||||
{ |
||||
item.Value= parameters[index]; |
||||
index++; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void BindGroupByParameters(DataModel? dataModel, HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
if (dataModel?.GroupParemters != null) |
||||
{ |
||||
var groupBys = formDatas.FirstOrDefault(it => it.Key.EqualsCase(nameof(DataModel.GroupParemters))); |
||||
if (groupBys.Value != null) |
||||
{ |
||||
dataModel!.GroupParemters = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DataModelGroupParameter>>(groupBys.Value + ""); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void BindOrderByParameters(DataModel? dataModel, HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
if (dataModel?.OrderDynamicParemters != null) |
||||
{ |
||||
//var data = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(nameof(DataModel.OrderByFixedParemters )) == true); |
||||
//if (data != null) |
||||
//{ |
||||
var orderDatas = formDatas.FirstOrDefault(it => it.Key.EqualsCase(nameof(DataModel.OrderDynamicParemters))); |
||||
if (orderDatas.Value != null) |
||||
{ |
||||
dataModel!.OrderDynamicParemters = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DataModelDynamicOrderParemter>>(orderDatas.Value + ""); |
||||
} |
||||
//} |
||||
} |
||||
} |
||||
private void BindPageParameters(DataModel? dataModel, HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
if (dataModel?.CommonPage != null) |
||||
{ |
||||
var pageNumberPar = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName) == true); |
||||
if (pageNumberPar != null) |
||||
{ |
||||
pageNumberPar.Value = GetParameterValueFromRequest(pageNumberPar, context, formDatas); |
||||
dataModel!.CommonPage.PageNumber = Convert.ToInt32(pageNumberPar.Value ?? "1"); |
||||
} |
||||
var pageSizePar = dataModel?.DefaultParameters?.FirstOrDefault(it => it?.Name?.EqualsCase(SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName) == true); |
||||
if (pageSizePar != null) |
||||
{ |
||||
pageSizePar.Value = GetParameterValueFromRequest(pageSizePar, context, formDatas); |
||||
dataModel!.CommonPage.PageSize = Convert.ToInt32(pageSizePar.Value ?? "20"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void BindDefaultParameters(DataModel? dataModel, HttpContext context, Dictionary<string, object> formDatas, ZeroInterfaceList interInfo) |
||||
{ |
||||
if (IsJObjct(dataModel, formDatas)) |
||||
{ |
||||
var data = dataModel?.DefaultParameters?.FirstOrDefault(); |
||||
if (data != null) |
||||
{ |
||||
data.Value = App.Db.Utilities.SerializeObject(formDatas); |
||||
} |
||||
} |
||||
else if (dataModel!.DefaultParameters != null) |
||||
{ |
||||
if (interInfo.IsAttributeMethod==true) |
||||
{ |
||||
// |
||||
} |
||||
else |
||||
{ |
||||
dataModel!.DefaultParameters = dataModel?.DefaultParameters?.Where(it => NoPageParameters(it)).ToList(); |
||||
} |
||||
foreach (var item in dataModel?.DefaultParameters ?? new List<DataModelDefaultParameter>()) |
||||
{ |
||||
UpdateWhereItemValue(context, formDatas, item); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private static bool IsJObjct(DataModel? dataModel, Dictionary<string, object> formDatas) |
||||
{ |
||||
var isJObject = dataModel?.DefaultParameters?.Count == 1 && dataModel!.DefaultParameters!.First().ValueType == nameof(JObject) && dataModel!.DefaultParameters!.First().IsSingleParameter == true; |
||||
return isJObject; |
||||
} |
||||
|
||||
private void UpdateWhereItemValue(HttpContext context, Dictionary<string, object> formDatas, DataModelDefaultParameter item) |
||||
{ |
||||
item.Value = GetParameterValueFromRequest(item, context, formDatas); |
||||
if (IsDefaultValue(item)) |
||||
{ |
||||
item.Value = item.DefaultValue; |
||||
} |
||||
if (IsUserName(item)) |
||||
{ |
||||
var options = SuperAPIModule._apiOptions; |
||||
item.Value = options?.DatabaseOptions!.GetCurrentUserCallback().UserName; |
||||
} |
||||
else if (IsDateTimeNow(item)) |
||||
{ |
||||
var options = SuperAPIModule._apiOptions; |
||||
item.Value = DateTime.Now; |
||||
} |
||||
else if (IsFile(item)) |
||||
{ |
||||
item.Value = PubMethod.ConvertFromBase64(item.Value + ""); |
||||
} |
||||
//if (!string.IsNullOrEmpty(item?.FieldName)) |
||||
//{ |
||||
// item.Name = item.FieldName; |
||||
//} |
||||
} |
||||
|
||||
|
||||
|
||||
private static bool NoPageParameters(DataModelDefaultParameter it) |
||||
{ |
||||
return it.Name != SuperAPIModule._apiOptions?.InterfaceOptions.PageNumberPropName && |
||||
it.Name != SuperAPIModule._apiOptions?.InterfaceOptions.PageSizePropName; |
||||
} |
||||
|
||||
private static bool IsUserName(DataModelDefaultParameter item) |
||||
{ |
||||
return item?.InsertParameter?.IsUserName == true; |
||||
} |
||||
private static bool IsDateTimeNow(DataModelDefaultParameter item) |
||||
{ |
||||
return item?.InsertParameter?.IsDateTimeNow == true; |
||||
} |
||||
private bool IsFile(DataModelDefaultParameter item) |
||||
{ |
||||
return item?.ValueType == "Byte[]"; |
||||
} |
||||
private static bool IsDefaultValue(DataModelDefaultParameter item) |
||||
{ |
||||
return item.Value == null && item.DefaultValue != null; |
||||
} |
||||
|
||||
private string GetParameterValueFromRequest(DataModelDefaultParameter parameter, HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
if (parameter.ValueIsReadOnly) |
||||
{ |
||||
return parameter.Value + ""; |
||||
} |
||||
string parameterValue = context.Request.Query[parameter.Name]; |
||||
var formData = formDatas.FirstOrDefault(it => it.Key.EqualsCase(parameter.Name ?? "")); |
||||
if (formData.Key != null) |
||||
{ |
||||
parameterValue = formData.Value + ""; |
||||
} |
||||
parameter.Value = parameterValue; |
||||
return parameterValue; |
||||
} |
||||
|
||||
private static Dictionary<string, object> GetFormDatas(HttpContext context) |
||||
{ |
||||
|
||||
Dictionary<string, object> formDatas = new Dictionary<string, object>(); |
||||
if (context.Request.Body != null) |
||||
{ |
||||
AddFormData(context, formDatas); |
||||
AddRawParameters(context, formDatas); |
||||
} |
||||
return formDatas ?? new Dictionary<string, object>(); |
||||
} |
||||
|
||||
private static void AddFormData(HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
if (IsFormData(context)) |
||||
{ |
||||
var formParams = context.Request.Form; |
||||
|
||||
foreach (var key in formParams.Keys) |
||||
{ |
||||
formDatas[key] = formParams[key]; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private static StreamReader AddRawParameters(HttpContext context, Dictionary<string, object> formDatas) |
||||
{ |
||||
using StreamReader reader = new System.IO.StreamReader(context.Request.Body); |
||||
var body = reader.ReadToEndAsync().Result; |
||||
|
||||
if (!string.IsNullOrEmpty(body)) |
||||
{ |
||||
|
||||
var bodyParams = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(body) ?? new Dictionary<string, object>(); |
||||
|
||||
var items = formDatas.Union(bodyParams).ToDictionary(pair => pair.Key, pair => pair.Value); |
||||
foreach (var item in items) |
||||
{ |
||||
formDatas.Add(item.Key,item.Value); |
||||
} |
||||
} |
||||
|
||||
return reader; |
||||
} |
||||
|
||||
private static bool IsFormData(HttpContext context) |
||||
{ |
||||
var contentTypes = new List<string>() |
||||
{ |
||||
"multipart/form-data", |
||||
"application/x-www-form-urlencoded" |
||||
}; |
||||
return context.Request.ContentType != null && contentTypes.Any(context.Request.ContentType.Contains); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,14 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class ErrorParameter |
||||
{ |
||||
public string? Name { get; set; } |
||||
|
||||
public string? ErrorType { get; set; } |
||||
public string? Message { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
internal class ErrorParameterHelper |
||||
{ |
||||
public static bool IsError(object? errorData) |
||||
{ |
||||
return errorData != null; |
||||
} |
||||
|
||||
public static async Task<object?> GetErrorParameters(List<ErrorParameter> errorParameters) |
||||
{ |
||||
object? errorData = null; |
||||
if (errorParameters.Any()) |
||||
{ |
||||
var data = await Task.FromResult(new |
||||
{ |
||||
ErrorParameters = errorParameters |
||||
}); |
||||
errorData = data; |
||||
} |
||||
|
||||
return errorData; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,105 @@
|
||||
using SqlSugar; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Net.Http.Headers; |
||||
using System.Runtime.CompilerServices; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
internal class ValidateParameters |
||||
{ |
||||
public static async Task<List<ErrorParameter>> CheckAsync(DataModel dataModel) |
||||
{ |
||||
List<ErrorParameter> errorLists = new List<ErrorParameter>(); |
||||
foreach (var item in dataModel.DefaultParameters ?? new List<DataModelDefaultParameter>()) |
||||
{ |
||||
if (IsRequired(item)) |
||||
{ |
||||
AddReuiredError(errorLists, item); |
||||
} |
||||
if (IsInsertUnique(dataModel, item)) |
||||
{ |
||||
await AddInsertUniqueError(dataModel, errorLists, item); |
||||
} |
||||
if (item?.ParameterValidate?.IsUnique == true && dataModel.ActionType == ActionType.InsertObject) |
||||
{ |
||||
} |
||||
} |
||||
return errorLists; |
||||
} |
||||
|
||||
#region Add Error |
||||
private static async Task AddInsertUniqueError(DataModel dataModel, List<ErrorParameter> errorLists, DataModelDefaultParameter item) |
||||
{ |
||||
var type = await EntityGeneratorManager.GetTypeAsync(dataModel.TableId); |
||||
var db = App.GetDbTableId(dataModel.TableId); |
||||
new CommonDataService().InitDb(type, db!); |
||||
var entityInfo = db!.EntityMaintenance.GetEntityInfo(type); |
||||
var dbColumnInfo = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(item.Name!)); |
||||
var isDeleteIdColumn = entityInfo.Columns.FirstOrDefault(it => it.PropertyName.EqualsCase(nameof(DbBase.IsDeleted))); |
||||
bool isAny = await IsAnyValue(item, type, db, dbColumnInfo, isDeleteIdColumn, dataModel); |
||||
if (isAny) |
||||
{ |
||||
errorLists.Add(new ErrorParameter() { Name = item.Name, ErrorType = "IsUnique", Message = TextHandler.GetCommonText("唯一", "Unique") }); |
||||
} |
||||
} |
||||
private static void AddReuiredError(List<ErrorParameter> errorLists, DataModelDefaultParameter item) |
||||
{ |
||||
errorLists.Add(new ErrorParameter() { Name = item.Name, ErrorType = "IsRequired", Message = TextHandler.GetCommonText("必填", "Required") }); |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Validate |
||||
private static bool IsInsertUnique(DataModel dataModel, DataModelDefaultParameter item) |
||||
{ |
||||
return item?.ParameterValidate?.IsUnique == true && dataModel.ActionType == ActionType.InsertObject; |
||||
} |
||||
private static bool IsRequired(DataModelDefaultParameter item) |
||||
{ |
||||
return item?.ParameterValidate?.IsRequired == true && string.IsNullOrEmpty(item.Value + ""); |
||||
} |
||||
private static async Task<bool> IsAnyValue(DataModelDefaultParameter? item, Type type, SqlSugarClient? db, EntityColumnInfo dbColumnInfo, EntityColumnInfo isDeleteIdColumn, DataModel dataModel) |
||||
{ |
||||
var condition = new ConditionalModel() |
||||
{ |
||||
ConditionalType = ConditionalType.Equal, |
||||
CSharpTypeName = dbColumnInfo.UnderType.Name, |
||||
FieldValue = item!.Value + "", |
||||
FieldName = dbColumnInfo.DbColumnName |
||||
|
||||
}; |
||||
var whereColumns = new List<IConditionalModel>() { condition }; |
||||
if (isDeleteIdColumn != null) |
||||
{ |
||||
var condition2 = new ConditionalModel() |
||||
{ |
||||
ConditionalType = ConditionalType.Equal, |
||||
CSharpTypeName = typeof(bool).Name, |
||||
FieldValue = false.ToString().ToLower(), |
||||
FieldName = isDeleteIdColumn.DbColumnName |
||||
}; |
||||
whereColumns.Add(condition2); |
||||
} |
||||
if (type.Name == nameof(ZeroEntityInfo)) |
||||
{ |
||||
var condition3 = new ConditionalModel() |
||||
{ |
||||
ConditionalType = ConditionalType.Equal, |
||||
CSharpTypeName = typeof(long).Name, |
||||
FieldValue = dataModel.DefaultParameters.First(it => it.Name!.EqualsCase(nameof(ZeroEntityInfo.DataBaseId))).Value + "", |
||||
FieldName = db!.EntityMaintenance.GetEntityInfo(type).Columns.First(it => it.PropertyName == nameof(ZeroEntityInfo.DataBaseId)).DbColumnName |
||||
}; |
||||
whereColumns.Add(condition3); |
||||
} |
||||
return await db!.QueryableByObject(type) |
||||
.Where(whereColumns) |
||||
.AnyAsync(); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
} |
@ -0,0 +1,112 @@
|
||||
using Microsoft.Extensions.Logging; |
||||
using SqlSugar; |
||||
using System; |
||||
using System.Linq; |
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
/// <summary> |
||||
/// Get rezero db |
||||
/// </summary> |
||||
public class ZeroDb |
||||
{ |
||||
public static ISqlSugarClient Db =>new SqlSugarClient(UtilMethods.CopyConfig( App.PreStartupDb!.CurrentConnectionConfig)); |
||||
} |
||||
/// <summary> |
||||
/// Represents the application's main entry point and provides access to essential services and resources. |
||||
/// </summary> |
||||
internal class App |
||||
{ |
||||
/// <summary> |
||||
/// Gets or sets the application's service provider, allowing access to registered services. |
||||
/// </summary> |
||||
internal static ApplicationServiceProvider? ServiceProvider { get; set; } |
||||
/// <summary> |
||||
/// Represents a database connection object used before service startup. |
||||
/// </summary> |
||||
internal static ISqlSugarClient? PreStartupDb { get; set; } |
||||
/// <summary> |
||||
/// Gets the instance of the SqlSugar client for database operations. |
||||
/// </summary> |
||||
/// <remarks> |
||||
/// This property provides convenient access to the configured SqlSugar client for database operations. |
||||
/// </remarks> |
||||
internal static ISqlSugarClient Db { get => ServiceProvider!.GetService<DatabaseContext>().SugarClient; } |
||||
|
||||
/// <summary> |
||||
/// Obtain the database operation object based on the database ID |
||||
/// </summary> |
||||
/// <param name="dbId"></param> |
||||
/// <returns></returns> |
||||
internal static SqlSugarClient? GetDbById(long dbId) |
||||
{ |
||||
var rootDb = App.Db; |
||||
var zeroDatabaseInfo = rootDb.Queryable<ZeroDatabaseInfo>().Where(it => it.Id == dbId).First(); |
||||
SqlSugarClient? db = null; |
||||
if (zeroDatabaseInfo != null) |
||||
db = GetSqlSugarClientByDatabaseInfo(zeroDatabaseInfo); |
||||
return db; |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Obtain the database operation object based on the table ID |
||||
/// </summary> |
||||
/// <param name="tableId"></param> |
||||
/// <returns></returns> |
||||
internal static SqlSugarClient? GetDbTableId(long tableId) |
||||
{ |
||||
var rootDb = App.Db; |
||||
var dbId = CacheManager<ZeroEntityInfo>.Instance.GetList().Where(it => it.Id == tableId).First()?.DataBaseId; |
||||
var zeroDatabaseInfo =CacheManager<ZeroDatabaseInfo>.Instance.GetList().Where(it => it.Id == dbId).First(); |
||||
zeroDatabaseInfo = rootDb.Utilities.TranslateCopy(zeroDatabaseInfo); |
||||
SqlSugarClient? db = null; |
||||
if (zeroDatabaseInfo != null) |
||||
db = GetSqlSugarClientByDatabaseInfo(zeroDatabaseInfo); |
||||
return db; |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Obtain the database operation object based on the ZeroDatabaseInfo |
||||
/// </summary> |
||||
/// <param name="zeroDatabaseInfo"></param> |
||||
/// <returns></returns> |
||||
private static SqlSugarClient GetSqlSugarClientByDatabaseInfo(ZeroDatabaseInfo zeroDatabaseInfo) |
||||
{ |
||||
return new SqlSugarClient(new ConnectionConfig() |
||||
{ |
||||
ConfigId=int.MaxValue, |
||||
ConnectionString = zeroDatabaseInfo.Connection, |
||||
DbType = zeroDatabaseInfo.DbType, |
||||
IsAutoCloseConnection = true, |
||||
InitKeyType = InitKeyType.Attribute, |
||||
MoreSettings = new ConnMoreSettings |
||||
{ |
||||
SqlServerCodeFirstNvarchar = true, |
||||
SqliteCodeFirstEnableDropColumn = true, |
||||
EnableCodeFirstUpdatePrecision = true, |
||||
IsAutoToUpper=false, |
||||
PgSqlIsAutoToLower=false, |
||||
PgSqlIsAutoToLowerCodeFirst=false, |
||||
EnableOracleIdentity=true |
||||
} |
||||
}, |
||||
db => |
||||
{ |
||||
db.Aop.OnLogExecuting = (s, p) => |
||||
{ |
||||
ReZero.DependencyInjection.DependencyResolver.GetLogger().LogInformation(UtilMethods.GetNativeSql(s, p)); |
||||
}; |
||||
}); |
||||
} |
||||
/// <summary> |
||||
/// Gets the language used by the SuperAPI module. |
||||
/// </summary> |
||||
/// <returns>The language.</returns> |
||||
internal static Language Language |
||||
{ |
||||
get |
||||
{ |
||||
return SuperAPIModule._apiOptions!.UiOptions!.UiLanguage; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
using Microsoft.AspNetCore.Builder; |
||||
using Microsoft.Extensions.DependencyInjection; |
||||
using System; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
|
||||
/// <summary> |
||||
/// The main class of the application, used for managing dependency injection and service location. |
||||
/// </summary> |
||||
public class ApplicationServiceProvider |
||||
{ |
||||
private readonly IApplicationBuilder _app; |
||||
|
||||
/// <summary> |
||||
/// Constructor that accepts an <see cref="IServiceProvider"/> instance. |
||||
/// </summary> |
||||
/// <param name="serviceProvider">The dependency injection container.</param> |
||||
public ApplicationServiceProvider(IApplicationBuilder serviceProvider) |
||||
{ |
||||
_app = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Gets an instance of the specified service type. |
||||
/// </summary> |
||||
/// <typeparam name="T">The type of service to retrieve.</typeparam> |
||||
/// <returns>An instance of the specified service type.</returns> |
||||
public T GetService<T>() where T : class
|
||||
{ |
||||
// Get the IOC container (service provider) |
||||
var serviceProvider = _app.ApplicationServices; |
||||
|
||||
// Perform the operation using the IOC container |
||||
var myService = serviceProvider!.GetRequiredService<T>(); |
||||
return myService; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,23 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class CacheCenter |
||||
{ |
||||
private static readonly object cacheLock = new object(); |
||||
public void ClearAllInternalCache() |
||||
{ |
||||
lock (cacheLock) |
||||
{ |
||||
CacheManager<ZeroDatabaseInfo>.Instance.ClearCache(); |
||||
CacheManager<ZeroInterfaceList>.Instance.ClearCache(); |
||||
CacheManager<ZeroEntityInfo>.Instance.ClearCache(); |
||||
CacheManager<ZeroJwtTokenManagement>.Instance.ClearCache(); |
||||
CacheManager<ZeroPermissionInfo>.Instance.ClearCache(); |
||||
CacheManager<ZeroPermissionMapping>.Instance.ClearCache(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,46 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ReZero.SuperAPI |
||||
{ |
||||
public class CacheManager<T>: ICacheManager<T> where T:class,new() |
||||
{ |
||||
private static List<T> cacheObject = null!; |
||||
private static readonly object cacheLock = new object(); |
||||
|
||||
public static CacheManager<T> Instance |
||||
{ |
||||
get |
||||
{ |
||||
return new CacheManager<T>(); |
||||
} |
||||
} |
||||
public List<T> GetList() |
||||
{ |
||||
if (cacheObject != null) |
||||
{ |
||||
return cacheObject; |
||||
} |
||||
|
||||
lock (cacheLock) |
||||
{ |
||||
if (cacheObject == null) |
||||
{ |
||||
var db = App.Db; |
||||
cacheObject = db.Queryable<T>().ToList(); |
||||
} |
||||
} |
||||
|
||||
return cacheObject; |
||||
} |
||||
|
||||
public void ClearCache() |
||||
{ |
||||
lock (cacheLock) |
||||
{ |
||||
cacheObject = null!; |
||||
} |
||||
} |
||||
} |
||||
} |