ow
This commit is contained in:
1 parent
31fbe199c1
commit
1c0c83af5f
469 files changed
+62544
-5
No files matched your search
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "8.0.1",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>false</InvariantGlobalization>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CliWrap" Version="3.6.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.OLE.Interop" Version="17.8.37221" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.0" />
|
||||
<PackageReference Include="ClosedXML" Version="0.102.1" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="CloudBuilder.Core">
|
||||
<HintPath>..\CloudBuilder.Core\bin\Debug\net8.0\CloudBuilder.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CloudBuilder.Security">
|
||||
<HintPath>..\CloudBuilder.Security\bin\Debug\net8.0\CloudBuilder.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CloudBuilder.Security.Service">
|
||||
<HintPath>..\CloudBuilder.Security.Service\bin\Debug\net8.0\CloudBuilder.Security.Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\Security\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<NameOfLastUsedPublishProfile>D:\NET8\CloudBuilder\CloudBuilder.Web.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,178 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAuthService authService;
|
||||
|
||||
public AuthController(IApplicationService service, IAuthService authService)
|
||||
{
|
||||
this.service = service;
|
||||
this.authService= authService;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Login(LoginData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.Login(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "LoginAgent")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic LoginAgent(LoginData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.LoginAgent(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Register(RegisterData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.Register(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic AmendPassword(LoginData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.AmendPassword(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public dynamic GetRsaPublicKey()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.GetRsaPublicKey();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic RefreshToken(JwtInfo jwtInfo)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = authService.RefreshToken(jwtInfo);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic Logout()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
authService.Logout();
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class LocaleController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ILocaleService localeService;
|
||||
|
||||
public LocaleController(IApplicationService service, ILocaleService localeService)
|
||||
{
|
||||
this.service = service;
|
||||
this.localeService= localeService;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public dynamic FindAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = localeService.FindAll();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(LocaleSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = localeService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(LocaleEntityKey key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = localeService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "Locale", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(LocaleEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = localeService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "Locale", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(LocaleEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = localeService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "Locale", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic UpdateLocaleData(LocaleData data){
|
||||
try
|
||||
{
|
||||
localeService.UpdateLocaleData(data);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "Locale", operate: "Delete")]
|
||||
[HttpPost]
|
||||
public dynamic Delete(LocaleEntityKey key){
|
||||
try
|
||||
{
|
||||
localeService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityActorController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityActorService securityActorService;
|
||||
|
||||
public SecurityActorController(IApplicationService service, ISecurityActorService securityActorService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityActorService= securityActorService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.FindAll();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityActorSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityActorSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityActorData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityActorData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityActorService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
securityActorService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityActor", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Deletes(string[] keys){
|
||||
try
|
||||
{
|
||||
securityActorService.Deletes(keys);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityFunctionController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityFunctionService securityFunctionService;
|
||||
|
||||
public SecurityFunctionController(IApplicationService service, ISecurityFunctionService securityFunctionService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityFunctionService= securityFunctionService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityFunctionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityFunctionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityFunctionData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityFunctionData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
securityFunctionService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityFunction", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Deletes(string[] keys){
|
||||
try
|
||||
{
|
||||
securityFunctionService.Deletes(keys);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindByFunctionName(string functionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.FindByFunctionName(functionName);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindMenus()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityFunctionService.FindMenus();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityGeneratorNumberController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityGeneratorNumberService securityGeneratorNumberService;
|
||||
|
||||
public SecurityGeneratorNumberController(IApplicationService service, ISecurityGeneratorNumberService securityGeneratorNumberService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityGeneratorNumberService= securityGeneratorNumberService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(Int32 key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGeneratorNumberService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityGeneratorNumberSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGeneratorNumberService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityGeneratorNumberSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGeneratorNumberService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityGeneratorNumberEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGeneratorNumberService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityGeneratorNumberEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGeneratorNumberService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGeneratorNumber", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(Int32 key){
|
||||
try
|
||||
{
|
||||
securityGeneratorNumberService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityGroupController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityGroupService securityGroupService;
|
||||
|
||||
public SecurityGroupController(IApplicationService service, ISecurityGroupService securityGroupService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityGroupService= securityGroupService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.FindAll();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityGroupSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityGroupSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityGroupData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityGroupData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityGroupService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
securityGroupService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityGroup", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Deletes(string[] keys){
|
||||
try
|
||||
{
|
||||
securityGroupService.Deletes(keys);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityLockController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityLockService securityLockService;
|
||||
|
||||
public SecurityLockController(IApplicationService service, ISecurityLockService securityLockService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityLockService= securityLockService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityLock", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(SecurityLockEntityKey key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityLockService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityLock", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityLockEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityLockService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityLock", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityLockEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityLockService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityLock", operate: "Delete")]
|
||||
[HttpPost]
|
||||
public dynamic Delete(SecurityLockEntityKey key){
|
||||
try
|
||||
{
|
||||
securityLockService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class IsLockedCompositionData
|
||||
{
|
||||
public string entityName { get; set; }
|
||||
public string key { get; set; }
|
||||
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic IsLocked(IsLockedCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityLockService.IsLocked(compositionData.entityName,compositionData.key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class LockCompositionData
|
||||
{
|
||||
public string entityName { get; set; }
|
||||
public string key { get; set; }
|
||||
public string username { get; set; }
|
||||
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic Lock(LockCompositionData compositionData){
|
||||
try
|
||||
{
|
||||
securityLockService.Lock(compositionData.entityName,compositionData.key,compositionData.username);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ForceLockCompositionData
|
||||
{
|
||||
public string entityName { get; set; }
|
||||
public string key { get; set; }
|
||||
public string username { get; set; }
|
||||
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic ForceLock(ForceLockCompositionData compositionData){
|
||||
try
|
||||
{
|
||||
securityLockService.ForceLock(compositionData.entityName,compositionData.key,compositionData.username);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ConsumeLockCompositionData
|
||||
{
|
||||
public string entityName { get; set; }
|
||||
public string key { get; set; }
|
||||
public string username { get; set; }
|
||||
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic ConsumeLock(ConsumeLockCompositionData compositionData){
|
||||
try
|
||||
{
|
||||
securityLockService.ConsumeLock(compositionData.entityName,compositionData.key,compositionData.username);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ClearLockCompositionData
|
||||
{
|
||||
public string entityName { get; set; }
|
||||
public string key { get; set; }
|
||||
|
||||
}
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic ClearLock(ClearLockCompositionData compositionData){
|
||||
try
|
||||
{
|
||||
securityLockService.ClearLock(compositionData.entityName,compositionData.key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityMasterController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityMasterService securityMasterService;
|
||||
|
||||
public SecurityMasterController(IApplicationService service, ISecurityMasterService securityMasterService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityMasterService= securityMasterService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(SecurityMasterEntityKey key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public dynamic FindAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.FindAll();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityMasterSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityMasterSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityMasterEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityMasterEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityMasterService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Delete")]
|
||||
[HttpPost]
|
||||
public dynamic Delete(SecurityMasterEntityKey key){
|
||||
try
|
||||
{
|
||||
securityMasterService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityMaster", operate: "Delete")]
|
||||
[HttpPost]
|
||||
public dynamic Deletes(SecurityMasterEntity[] datas){
|
||||
try
|
||||
{
|
||||
securityMasterService.Deletes(datas);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityPermissionController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityPermissionService securityPermissionService;
|
||||
|
||||
public SecurityPermissionController(IApplicationService service, ISecurityPermissionService securityPermissionService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityPermissionService= securityPermissionService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityPermissionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindDependentBySearchCriteria(SecurityPermissionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.FindDependentBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindDependentsBySearchCriteria(SecurityPermissionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.FindDependentsBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityPermissionSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityPermissionData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityPermissionData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityPermissionService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
securityPermissionService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityPermission", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Deletes(string[] keys){
|
||||
try
|
||||
{
|
||||
securityPermissionService.Deletes(keys);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityUserController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityUserService securityUserService;
|
||||
|
||||
public SecurityUserController(IApplicationService service, ISecurityUserService securityUserService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityUserService= securityUserService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByStaffId(string staffid)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.FindByStaffId(staffid);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindAll()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.FindAll();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityUserSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityUserSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityUserData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityUserData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
securityUserService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Deletes(string[] keys){
|
||||
try
|
||||
{
|
||||
securityUserService.Deletes(keys);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUser", operate: "None")]
|
||||
[HttpPost]
|
||||
public dynamic FindMenuByUsername()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserService.FindMenuByUsername();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic UpdateLocalName(string localName){
|
||||
try
|
||||
{
|
||||
securityUserService.UpdateLocalName(localName);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class SecurityUserPreferenceController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly ISecurityUserPreferenceService securityUserPreferenceService;
|
||||
|
||||
public SecurityUserPreferenceController(IApplicationService service, ISecurityUserPreferenceService securityUserPreferenceService)
|
||||
{
|
||||
this.service = service;
|
||||
this.securityUserPreferenceService= securityUserPreferenceService;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(SecurityUserPreferenceEntityKey key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserPreferenceService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUserPreference", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(SecurityUserPreferenceSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserPreferenceService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "SecurityUserPreference", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(SecurityUserPreferenceSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserPreferenceService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(SecurityUserPreferenceEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserPreferenceService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(SecurityUserPreferenceEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = securityUserPreferenceService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic Delete(SecurityUserPreferenceEntityKey key){
|
||||
try
|
||||
{
|
||||
securityUserPreferenceService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
using CloudBuilder.Security;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Security
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class YesNoPolicyController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IYesNoPolicyService yesNoPolicyService;
|
||||
|
||||
public YesNoPolicyController(IApplicationService service, IYesNoPolicyService yesNoPolicyService)
|
||||
{
|
||||
this.service = service;
|
||||
this.yesNoPolicyService= yesNoPolicyService;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public dynamic FindSelectOption(bool blank)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = yesNoPolicyService.FindSelectOption(blank);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using CloudBuilder.Core.DependencyInjection.Form;
|
||||
using CloudBuilder.Core.Extensions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.Http.Json;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
||||
builder.Services.Initialize();
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddHttpClient().AddControllers()
|
||||
.AddNewtonsoftJson(options =>
|
||||
{
|
||||
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
|
||||
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
|
||||
options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||
});
|
||||
|
||||
|
||||
builder.Services.AddSpaStaticFiles(options => { options.RootPath = "dist"; });
|
||||
|
||||
//================================上传文件==============================
|
||||
//上传文件大小限制Kestrel设置
|
||||
builder.Services.Configure<KestrelServerOptions>(options =>
|
||||
{
|
||||
// Set the limit to 256 MB
|
||||
options.Limits.MaxRequestBodySize = null;
|
||||
});
|
||||
//上传文件大小限制IIS设置
|
||||
builder.Services.Configure<IISServerOptions>(options =>
|
||||
{
|
||||
options.MaxRequestBodySize = null;
|
||||
});
|
||||
|
||||
builder.Services.Configure<FormOptions>(options =>
|
||||
{
|
||||
options.ValueLengthLimit = int.MaxValue;
|
||||
options.MultipartBodyLengthLimit = int.MaxValue;
|
||||
options.MultipartHeadersLengthLimit = int.MaxValue;
|
||||
});
|
||||
/*
|
||||
如果是在VS中调试的项目
|
||||
需要修改项目根目录.vs\CloudBuilder\config\applicationhost.config 中找到<requestFiltering>节点添加
|
||||
<requestLimits maxAllowedContentLength="1073741824" />
|
||||
|
||||
如果是发布到IIS上的项目
|
||||
找到web.config在<system.webServer>节点下添加。注意以后每次发布不要覆盖掉该web.config
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.2">
|
||||
<assemblies>
|
||||
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<pages controlRenderingCompatibilityVersion="4.0" />
|
||||
<httpRuntime maxRequestLength="2147483647" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<requestLimits maxAllowedContentLength="2147483647" />
|
||||
</requestFiltering>
|
||||
</security>
|
||||
</system.webServer>
|
||||
IIS內修改ASP中修改最大请求实体主体限制
|
||||
*/
|
||||
|
||||
//================================上传文件==============================
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
string urlOrigins = app.Configuration["UrlOrigins"];
|
||||
//跨域是否使用SSL
|
||||
if (urlOrigins.Contains("https"))
|
||||
{
|
||||
app.UseHttpsRedirection();
|
||||
}
|
||||
|
||||
app.UseCors(b =>
|
||||
{
|
||||
b.WithOrigins(urlOrigins.Split(',')).AllowAnyMethod().AllowAnyHeader().AllowCredentials();
|
||||
});
|
||||
|
||||
//================================添加静态文件映射,在IIS及vs启动文件applicationhost.config的地方加入无效
|
||||
//开发环境使用以下设置,如果上线还需在IIS设置MIME
|
||||
var provider = FileExtension.GetFileExtensionContentTypeProvider();
|
||||
provider.Mappings[".mp4"] = "application/x-mpegURL";
|
||||
provider.Mappings[".flac"] = "audio/x-flac";
|
||||
provider.Mappings[".m3u8"] = "application/vnd.apple.mpegurl";
|
||||
provider.Mappings[".lrc"] = "application/octet-stream";
|
||||
//虚拟文件,App.Configuration[VirtualPathPolicy.VirtualPath_RealPath]这个路径一定要存在,不然直接出错
|
||||
app.UseStaticFiles(new StaticFileOptions()
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(app.Configuration["FileServiceSettings:PhysicalFileDirectory"]),
|
||||
RequestPath = app.Configuration["FileServiceSettings:RequestPath"],
|
||||
ContentTypeProvider = provider
|
||||
});
|
||||
//================================添加静态文件映射
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
app.UseAuthentication();
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.UseSpaStaticFiles();
|
||||
app.UseSpa(configuration => { });
|
||||
|
||||
app.Run();
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>C:\inetpub\wwwroot\vue</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ProjectGuid>369132cb-47f8-44fd-ba90-1d6a605ac801</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>C:\inetpub\wwwroot\vue</_PublishTargetUrl>
|
||||
<History>True|2025-02-21T01:17:42.0332319Z||;True|2025-02-20T17:54:48.5227502+08:00||;True|2025-02-20T14:43:44.4755548+08:00||;True|2025-02-18T14:48:38.1279736+08:00||;True|2025-02-18T14:30:06.8713276+08:00||;True|2025-02-18T12:23:21.7029574+08:00||;False|2025-02-18T12:00:12.8451503+08:00||;False|2025-02-18T11:59:48.3718169+08:00||;False|2025-02-18T11:59:27.1705555+08:00||;True|2025-02-18T11:58:00.6819258+08:00||;True|2025-02-18T11:55:11.3497343+08:00||;True|2025-02-18T11:17:38.2416175+08:00||;True|2025-02-18T11:15:42.5176910+08:00||;True|2025-02-18T10:18:58.1976451+08:00||;True|2025-02-18T10:12:10.1899652+08:00||;True|2025-02-18T10:11:17.8366085+08:00||;True|2025-02-18T10:05:26.8898914+08:00||;False|2025-02-18T10:04:33.0136788+08:00||;True|2025-01-13T15:33:36.8856684+08:00||;True|2025-01-13T15:09:43.9813208+08:00||;True|2025-01-13T14:48:28.7425876+08:00||;True|2024-12-09T08:41:48.9637493+08:00||;True|2024-06-11T17:33:49.2040712+08:00||;False|2024-06-11T17:32:59.6407939+08:00||;True|2024-06-11T16:30:00.2893189+08:00||;True|2024-06-11T16:17:09.6736622+08:00||;True|2024-06-06T16:29:09.6865383+08:00||;True|2024-06-06T08:52:48.6214582+08:00||;True|2024-06-06T08:27:23.8935107+08:00||;True|2024-06-05T16:54:39.9877626+08:00||;True|2024-06-05T16:43:47.3099658+08:00||;True|2024-06-05T15:16:50.1847108+08:00||;True|2024-05-31T08:05:26.5317322+08:00||;True|2024-05-31T08:04:03.7974732+08:00||;True|2024-05-30T21:42:27.5196708+08:00||;True|2024-05-30T21:37:33.9751309+08:00||;True|2024-05-30T17:28:17.6733343+08:00||;False|2024-05-30T17:28:01.8112502+08:00||;True|2024-05-29T10:59:16.8699002+08:00||;False|2024-05-29T10:58:38.9766757+08:00||;True|2024-05-28T09:35:21.2744589+08:00||;True|2024-05-27T10:28:23.0585167+08:00||;True|2024-05-26T12:51:58.7093675+08:00||;True|2024-05-26T12:51:52.1552336+08:00||;True|2024-05-26T11:33:30.5529917+08:00||;True|2024-05-26T11:22:22.0291577+08:00||;False|2024-05-26T11:22:10.9637009+08:00||;False|2024-05-26T11:21:27.5808366+08:00||;True|2024-05-25T19:32:42.7850312+08:00||;True|2024-05-25T18:16:06.8982836+08:00||;True|2024-05-25T17:56:31.4643806+08:00||;True|2024-05-25T17:54:24.5011091+08:00||;True|2024-05-25T16:53:10.2158278+08:00||;False|2024-05-25T16:52:30.0122904+08:00||;True|2024-05-22T15:20:02.5175934+08:00||;True|2024-05-21T16:57:20.6206412+08:00||;True|2024-05-21T16:29:19.8761381+08:00||;True|2024-05-21T15:42:29.4258892+08:00||;True|2024-05-21T11:13:06.6678431+08:00||;True|2024-05-21T11:10:55.1931883+08:00||;True|2024-05-21T11:07:54.1533538+08:00||;True|2024-05-21T11:07:26.0319621+08:00||;True|2024-05-21T11:06:23.7546831+08:00||;True|2024-05-21T11:01:41.0827477+08:00||;True|2024-05-20T15:04:24.6641402+08:00||;True|2024-05-20T14:46:24.0260148+08:00||;False|2024-05-20T14:45:45.0345419+08:00||;True|2024-04-26T16:32:10.3514161+08:00||;True|2024-04-26T16:03:18.3351196+08:00||;True|2024-04-26T15:53:32.9469568+08:00||;True|2024-04-26T15:49:16.1813318+08:00||;True|2024-04-26T11:41:08.9174989+08:00||;True|2024-04-26T11:39:27.5019165+08:00||;True|2024-04-26T11:33:54.2122690+08:00||;True|2024-04-26T11:11:36.8532751+08:00||;True|2024-04-26T11:11:19.8849783+08:00||;True|2024-04-26T10:07:07.7216761+08:00||;True|2024-04-26T08:54:11.5626013+08:00||;True|2024-04-03T15:31:52.2410946+08:00||;False|2024-04-03T15:10:36.5624576+08:00||;True|2024-04-03T14:18:55.5362847+08:00||;True|2024-04-02T10:31:27.4134967+08:00||;True|2024-04-02T10:17:21.1633276+08:00||;True|2024-04-02T09:18:46.3515162+08:00||;True|2024-04-02T09:17:25.1201533+08:00||;True|2024-04-02T09:13:42.1533840+08:00||;True|2024-03-25T09:05:24.0358289+08:00||;True|2024-03-22T11:10:12.4214308+08:00||;True|2024-03-22T08:56:07.5983805+08:00||;True|2024-03-21T16:38:13.6531866+08:00||;True|2024-03-20T16:51:09.0721907+08:00||;True|2024-03-20T15:39:34.0644852+08:00||;True|2024-03-19T14:24:58.8903495+08:00||;True|2024-03-19T10:22:21.2273556+08:00||;True|2024-03-18T15:29:38.8873414+08:00||;True|2024-03-14T16:06:51.9651367+08:00||;True|2024-03-07T09:21:31.6615954+08:00||;True|2024-03-05T13:45:57.1941176+08:00||;True|2024-03-05T11:48:44.3806050+08:00||;True|2024-03-05T11:02:38.1040818+08:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "D:\\NET8\\CloudBuilder\\CloudBuilder.Security.Service\\bin\\Debug\\net8.0\\CloudBuilder.Security.Service.dll",
|
||||
"launchBrowser": true,
|
||||
//"launchUrl": "SecurityMaster/FindByAllowAnonymous",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5235"
|
||||
//D:\NET8\CloudBuilder\CloudBuilder.Web.Entry\bin\Debug\net8.0\CloudBuilder.Web.Entry.exe --urls http://localhost:5235
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "SecurityMaster/FindByAllowAnonymous",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
},
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:16958",
|
||||
"sslPort": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogFileDirectory": "D:\\Net8\\FileServer\\Log",
|
||||
"MaxFileSizeMB": 20
|
||||
},
|
||||
"UrlOrigins": "http://192.168.195.68,http://localhost,http://localhost:8088,http://localhost:5235", //这个参数是反向指向的地址,也是跨域访问的地址,包含Vue内WebSitePolicy设置WebSite
|
||||
"applicationUrl": "https://uat.youjiala.com", //這個地址是最外层用户访问的,不是反向指向的地址https://uat.youjiala.com
|
||||
"CloudBuilder": {
|
||||
"Culture": "zh-cn",
|
||||
"DbContexts": {
|
||||
"MasterDbContext": {
|
||||
"DbContextTypeName": "MasterDbContext",
|
||||
"ConnectionString": "Server=localhost\\SQLEXPRESS;Database=Furion;User=sa;Password=owen123456;MultipleActiveResultSets=True;TrustServerCertificate=true",
|
||||
"DatabaseType": "SqlServer",
|
||||
"LazyLoadingProxiesEnabled": true,
|
||||
"AuditEntityEnabled": true,
|
||||
"AutoMigrationEnabled": true
|
||||
},
|
||||
"SecondaryDbContext": {
|
||||
"DbContextTypeName": "SecondaryDbContext",
|
||||
"ConnectionString": "Server=localhost\\SQLEXPRESS;Database=Furion;User=sa;Password=owen123456;MultipleActiveResultSets=True;TrustServerCertificate=true",
|
||||
"DatabaseType": "SqlServer",
|
||||
"LazyLoadingProxiesEnabled": true,
|
||||
"AuditEntityEnabled": true,
|
||||
"AutoMigrationEnabled": true
|
||||
}
|
||||
},
|
||||
"MailSender": {
|
||||
"Host": "smtp.mxhichina.com",
|
||||
"Port": 587,
|
||||
"EnableSsl": true,
|
||||
"DisplayName": "OSharp邮件发送",
|
||||
"UserName": "osharpsender@66soft.net",
|
||||
"Password": "OSharp147963"
|
||||
},
|
||||
"Authorization": { "EnableGlobalAuthorize": false }, //全局授权
|
||||
"Jwt": {
|
||||
"Issuer": "Owen Chen",
|
||||
"Audience": "Cloud Builder",
|
||||
"Secret": "{8619F7C3-B53C-4B85-99F0-983D351ECD82}",
|
||||
"AccessExpireMins": 120, //4小时过期
|
||||
"RefreshExpireMins": 1440, // 1天
|
||||
"IsRefreshAbsoluteExpired": false
|
||||
},
|
||||
"Redis": {
|
||||
"Configuration": "localhost",
|
||||
"InstanceName": "CloudBuilder:"
|
||||
}
|
||||
},
|
||||
"FileServiceSettings": {
|
||||
"PhysicalFileDirectory": "D:\\Net8\\FileServer",
|
||||
"RequestPath": "/FileServer", //如果是IIS反向代理来的,那么要在本地给这个文件添加IUSR,IIS_IUSRS权限
|
||||
"UploadDmsFileDirectory": "D:\\Net8\\FileServer\\Upload\\DmsFile",
|
||||
"BackupDmsFileDirectory": "D:\\Net8\\FileServer\\Backup\\DmsFile",
|
||||
"ScaleDmsFileDirectory": "D:\\Net8\\FileServer\\Scale\\DmsFile",
|
||||
"ExcelOutputDirectory": "D:\\Net8\\FileServer\\Output"
|
||||
},
|
||||
"Ffmpeg": {
|
||||
"Path": "D:\\NET8\\Exe\\ffmpeg\\bin\\ffmpeg.exe", //视频转码
|
||||
"Pictrue": " -i {0} -ss 00:00:10.000 -frames:v 1 {1}",
|
||||
"Arguments": " -i {0} -c:v libx264 -vf scale=1280:-1 -start_number 0 -hls_time {1} -hls_list_size 0 -f hls {2}" //0-源路径,1-目标路径,2-存放多少秒 1280×720,852*480
|
||||
},
|
||||
"CloudBuilder.Topshelf": {
|
||||
"Path": "D:\\NET8\\CloudBuilder.Topshelf\\bin\\Debug\\net8.0\\CloudBuilder.Topshelf.exe" //图片压缩
|
||||
},
|
||||
"SecuritySettings": {
|
||||
"RsaPublicKey": "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8HMr2CBpoZPm3t9tCVlrKtTmI4jNJc7/HhxjIEiDjC8czP4PV+44LjXvLYcSV0fwi6nE4LH2c5PBPEnPfqp0g8TZeX+bYGvd70cXee9d8wHgBqi4k0J0X33c0ZnW7JruftPyvJo9OelYSofBXQTcwI+3uIl/YvrgQRv6A5mW01QIDAQAB-----END PUBLIC KEY-----",
|
||||
"RsaPrivateKey": "-----BEGIN RSA PRIVATE KEY-----MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALwcyvYIGmhk+be320JWWsq1OYjiM0lzv8eHGMgSIOMLxzM/g9X7jguNe8thxJXR/CLqcTgsfZzk8E8Sc9+qnSDxNl5f5tga93vRxd5713zAeAGqLiTQnRffdzRmdbsmu5+0/K8mj056VhKh8FdBNzAj7e4iX9i+uBBG/oDmZbTVAgMBAAECgYEAmgNU5NTDkj9B+Pnt6UU8doSjw3+3j+bV2K2yS3QUOvAUus/Ax7x6ktjWxzCXvDY9IfUil2RNv9vtKEAqYLCWjc+lf8PV/yH1b7NEgyeAPBXtAJRoOnmYL2bdPW92kP9KgxJruF6Dz/C5AmMOncsvq8ABD+9Darn4p8dwj2ZC4O0CQQDf/AHmZsQokEItfCy4mHS9UbxbfIhEUv1ApPh/+Sr7NkJkHWYCtBQo+8jKO6zurAZQgWBPD1XX2UE4R+VIiZazAkEA1wAqtMvGhccyRZr+6kpkpDIa8+9jOE+nGUzqTDvgCID6as8AzOONFVVK6m/UUqkhcJ8Qu1pF36BGojy5BX2KVwJBAJSFpbji0hXXupowqfLp3RcgmNbNWAp+QUJZYhJx5cdYbmO2fssyH+AhPT6knYJR/YnqkDM8hv6vKCkqu2YDHjMCQAOA8TE5EOclM+CGghj3VWSHnIDVKdzFD4gOBNNxNlltIKeU8AJmwunSFgJ0CBXAw9a+ANvMwM7AIeaK7sj0HskCQAvxfDCq7gaNx+pfu0FHG8Gix08A/A6foggBl1fVu+L9sr9ZuOQ3HbXnl28F9ewuB9xdjnLUDjp7W7U0pB+vKoQ=-----END RSA PRIVATE KEY-----",
|
||||
"DescKey": "052636a8b1469efdf5dc0034a3c5bb34",
|
||||
"DefaultActor": "VIEW_SYSTEM"
|
||||
},
|
||||
"IpRateLimiting": {
|
||||
"EnableEndpointRateLimiting": true, //False: globally executed, true: executed for each
|
||||
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
|
||||
"RealIpHeader": "X-Real-IP",
|
||||
"ClientIdHeader": "X-ClientId",
|
||||
"IpWhitelist": [], //白名单
|
||||
"EndpointWhitelist": [],
|
||||
"ClientWhitelist": [],
|
||||
"HttpStatusCode": 200,
|
||||
"QuotaExceededResponse": {
|
||||
"Content": "{{\"code\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"data\":null}}",
|
||||
"ContentType": "application/json",
|
||||
"StatusCode": 200
|
||||
},
|
||||
"GeneralRules": [
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1s",
|
||||
"Limit": 5
|
||||
},
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "1m",
|
||||
"Limit": 50
|
||||
},
|
||||
{
|
||||
"Endpoint": "*",
|
||||
"Period": "12h",
|
||||
"Limit": 500
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"CreateDmsFolder": {
|
||||
"FileNameList": "居家类,旅游类,作品类,音乐,视频",
|
||||
"0": "YYYY-主题",
|
||||
"1": "YYYY-主题",
|
||||
"2": "YYYY-主题",
|
||||
"3": "人物分类,榜单分类,专辑分类",
|
||||
"4": "YYYY-自拍,电影,电视剧"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user