模板 更新
This commit is contained in:
parent
73134b736a
commit
658b2c8115
|
@ -1,57 +1,37 @@
|
|||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using BZPT.Api.Middleware;
|
||||
using BZPT.Domains.IRepositories;
|
||||
using BZPT.Repositories;
|
||||
using IGeekFan.AspNetCore.Knife4jUI;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NPlatform.Infrastructure.Config;
|
||||
using NPlatform.Middleware;
|
||||
using NPlatform.API;
|
||||
using NPlatform.DI;
|
||||
using NPlatform.Repositories;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using IGeekFan.AspNetCore.Knife4jUI;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using IdentityServer4.Configuration;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using BZPT.Repositories;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using NPlatform.Infrastructure.Config.Section;
|
||||
using ServiceStack;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Hangfire;
|
||||
using Hangfire.Redis.StackExchange;
|
||||
using Hangfire.Dashboard.BasicAuthorization;
|
||||
using BZPT.Domains.Application;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Newtonsoft.Json;
|
||||
using NPlatform.API;
|
||||
using NPlatform.Infrastructure.Config;
|
||||
//using Hangfire;
|
||||
//using Hangfire.Redis.StackExchange;
|
||||
//using Hangfire.Dashboard.BasicAuthorization;
|
||||
using NPlatform.Infrastructure.IdGenerators;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using StackExchange.Redis;
|
||||
using BZPT.Api.Middleware;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Serilog.Context;
|
||||
using NPlatform.Middleware;
|
||||
using NPlatform.Repositories;
|
||||
using Serilog;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using BZPT.Domains.IRepositories;
|
||||
using BZPT.Domains.IService.Sys;
|
||||
using BZPT.Api;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Serilog.Context;
|
||||
using ServiceStack;
|
||||
using SqlSugar;
|
||||
using StackExchange.Redis;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var serviceConfig = builder.Configuration.GetServiceConfig();
|
||||
|
@ -70,20 +50,20 @@ var redisConfig = builder.Configuration.GetRedisConfig();
|
|||
//从配置获取 Redis 连接字符串
|
||||
var redisConn = $"{redisConfig.Connections?.FirstOrDefault()},password={redisConfig.Password}";
|
||||
Console.WriteLine("redis 连接:" + redisConn);
|
||||
// 配置 Hangfire
|
||||
builder.Services.AddHangfire(x =>
|
||||
{
|
||||
x.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
|
||||
.UseSimpleAssemblyNameTypeSerializer()
|
||||
.UseRecommendedSerializerSettings()
|
||||
.UseRedisStorage(redisConn, new RedisStorageOptions
|
||||
{
|
||||
Db = 11,
|
||||
Prefix = "Hangfire:"
|
||||
});
|
||||
});
|
||||
//// 配置 Hangfire
|
||||
//builder.Services.AddHangfire(x =>
|
||||
//{
|
||||
// x.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
|
||||
// .UseSimpleAssemblyNameTypeSerializer()
|
||||
// .UseRecommendedSerializerSettings()
|
||||
// .UseRedisStorage(redisConn, new RedisStorageOptions
|
||||
// {
|
||||
// Db = 11,
|
||||
// Prefix = "Hangfire:"
|
||||
// });
|
||||
//});
|
||||
|
||||
builder.Services.AddHangfireServer();
|
||||
//builder.Services.AddHangfireServer();
|
||||
|
||||
// 连接到 Redis
|
||||
var connectionMultiplexer = ConnectionMultiplexer.Connect(redisConn);
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
using BZPT.Domains.IRepositories.Sys;
|
||||
using BZPT.Dto.Sys;
|
||||
using BZPT.Repositories;
|
||||
using Consul.Filtering;
|
||||
using BZPT.Repositories;
|
||||
using DevExtreme.AspNet.Data;
|
||||
using NetTaste;
|
||||
using NPlatform.Domains.Entity;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using ServiceStack;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace BZPT.Domains.Services
|
||||
{
|
||||
|
@ -127,6 +115,12 @@ namespace BZPT.Domains.Services
|
|||
{
|
||||
loadOptionsexp.Sort = new SortingInfo[] { new SortingInfo() { Selector = "CreateTime", Desc = true } };
|
||||
}
|
||||
|
||||
if (loadOptionsexp.Filter == null)
|
||||
{
|
||||
loadOptionsexp.Filter = new List<object>();
|
||||
}
|
||||
|
||||
Type type = typeof(TEntity);
|
||||
// 检查是否存在指定名称的接口
|
||||
Type interfaceType = type.GetInterface("ILogicDelete");
|
||||
|
@ -146,6 +140,11 @@ namespace BZPT.Domains.Services
|
|||
{
|
||||
loadOptionsexp.Sort = new SortingInfo[] { new SortingInfo() { Selector = "CreateTime", Desc = true } };
|
||||
}
|
||||
if (loadOptionsexp.Filter == null)
|
||||
{
|
||||
loadOptionsexp.Filter = new List<object>();
|
||||
}
|
||||
|
||||
Type type = typeof(TEntity);
|
||||
// 检查是否存在指定名称的接口
|
||||
Type interfaceType = type.GetInterface("ILogicDelete");
|
||||
|
|
Loading…
Reference in New Issue