Viazy 是一个基于 .NET 开发的业务开发框架,项目中集成了多种技术,涉及到微服务,分布式,定时任务,认证鉴权等组件。非常适合在业务中集成使用。
? ViazyNetCore.Data.FreeSql 引入 FreeSql 作为数据ORM框架
? ViazyNetCore.Auth 权限管理模块
? ViazyNetCore.Caching 缓存模块
? ViazyNetCore.Redis Redis及缓存管理
? ViazyNetCore.Swagger Swagger管理及Knife4jUI
? ViazyNetCore.EventBus 事件推送模块
? ViazyNetCore.EventBus.RabbitMQ RabbitMQ分布式EventBus
? ViazyNetCore.EventBus.Redis Redis分布式EventBus
? ViazyNetCore.Formmatter.Response 公共处理返回业务模块。
? ViazyNetCore.Formmatter.Excel 数据转Excel文件下载模块
? ViazyNetCore.Web.DevServer ViteNode Spa处理模块。
? ViazyNetCore.TaskScheduler 基于Quartz.Net的任务管理。
? ViazyNetCore.RabbitMQ RabbitMQ消息队列
? ViazyNetCore.TaskScheduler.RabbitMQ RabbitMQ Quartz任务消费者
? ViazyNetCore.AttachmentProvider 附件上传处理
? ViazyNetCore.OSS OSS 文件存储基类
? ViazyNetCore.OSS.Minio MinIO 文件存储
? ViazyNetCore.MultiTenancy 多租户模块
? ViazyNetCore.Dapr Dapr边车应用
? fontend/ele-admin-ui vue3 管理后台-前端UI
? fontend/shopmall-uniapp 前端商城小程序 uni-app项目
// 模块注入
builder.Services.AddCaching() // 缓存注入
.UseDistributedMemoryCache() // 内存缓存
.UseStackExchangeRedisCaching(options => // 基于 StackExchangeRedis 的缓存
{
options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions
{
EndPoints =
{
{ redisConfig.Host, redisConfig.Port }
},
Password = redisConfig.Password,
ChannelPrefix = "ViazyNetCore"
};
});
await builder.Services.AddApplicationAsync<TestModule>();
// Api 返回全局拦截及处理
app.UseApiResponseWrapper(option =>
{
option.IsApiOnly = false;
option.EnableResponseLogging = true;
option.EnableExceptionLogging = true;
});
依赖注入
[DependsOn(typeof(AutoMapperModule)
, typeof(IdentityModule)
, typeof(AspNetCoreMvcModule)
, typeof(AuthorizationModule)
, typeof(AuthApplicationModule)
, typeof(BloggingModulsModule)
)]
public class BloggingManageHostModule : InjectionModule
{
…
}
注册服务
await builder.Services.AddApplicationAsync<BloggingManageHostModule>();
IOC 支持
[Injection] // 默认 Scoped
public class CategoryService
{
}
[Injection(Lifetime = ServiceLifetime.Singleton)] //更改生命周期
public class CategoryService
{
}
https://gitee.com/ldaxian/viazy-net-core