评论

Viazy,又一个 .NET 业务开发框架开源了

原标题:Viazy,又一个 .NET 业务开发框架开源了

Viazy

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 = newStackExchange.Redis.ConfigurationOptions

{

EndPoints =

{

{ redisConfig.Host, redisConfig.Port }

},

Password = redisConfig.Password,

ChannelPrefix = "ViazyNetCore"

};

});

awaitbuilder.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)

)]

publicclassBloggingManageHostModule: InjectionModule

{

}

注册服务

awaitbuilder.Services.AddApplicationAsync<BloggingManageHostModule>;

IOC 支持

[Injection] // 默认 Scoped

publicclassCategoryService

{

}

[Injection(Lifetime = ServiceLifetime.Singleton)] //更改生命周期

publicclassCategoryService

{

}

项目地址

https://gitee.com/ldaxian/viazy-net-core

分享

点收藏

点点赞

点在看返回搜狐,查看更多

责任编辑:

平台声明:该文观点仅代表作者本人,搜狐号系信息发布平台,搜狐仅提供信息存储空间服务。
阅读 ()
大家都在看
推荐阅读