feat: 新增SDK模块、OSS相关功能并优化Redis与代码扩展
1. 新增API版本枚举SDK项,创建SDK基础控制器 2. 添加IList、string扩展方法,新增时间戳扩展工具 3. 新增OSS配置、STS凭证服务、文件处理相关代码 4. 重构Redis缓存组件,替换StackExchange.Redis为CSRedisCore 5. 修复原有Redis操作方法调用,新增基础控制器快捷返回方法 6. 新增阿里云OSS、短信、VOD相关SDK依赖 7. 配置阿里云OSS相关参数到appsettings
This commit is contained in:
@ -12,6 +12,7 @@ using QYZH.InteractiveMagazine.Infrastructure.Autofacs;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Context;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Extensions;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Middleware;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Redis;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
using QYZH.InteractiveMagazine.Models.Settings;
|
||||
@ -34,6 +35,8 @@ YitIdHelper.SetIdGenerator(new IdGeneratorOptions() { WorkerId = 1 });
|
||||
// autofac注入 允许使用autofac作为DI容器
|
||||
builder.UseAutofac();
|
||||
|
||||
|
||||
|
||||
builder.InitSqlSugarDb(new IocConfig()
|
||||
{
|
||||
ConfigId = 0,
|
||||
@ -45,7 +48,8 @@ builder.InitSqlSugarDb(new IocConfig()
|
||||
// 消除Error unprotecting the session cookie警告
|
||||
builder.Services.AddDataProtection()
|
||||
.PersistKeysToFileSystem(new DirectoryInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "DataProtection"));
|
||||
|
||||
//redis
|
||||
builder.Services.AddCSRedisCacheExtension(builder.Configuration.GetSection("RedisSettings"));
|
||||
// 配置Serilog
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.ReadFrom.Configuration(builder.Configuration)
|
||||
@ -158,6 +162,7 @@ builder.Services.AddCors(options =>
|
||||
.AllowAnyHeader();
|
||||
});
|
||||
});
|
||||
|
||||
#region 配置数据压缩选项
|
||||
|
||||
// 1.首先配置压缩选项的Options>
|
||||
@ -182,6 +187,7 @@ builder.Services.AddResponseCompression(options =>
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user