HZY.Framework.Core
HZY.Framework 核心:模块化启动、依赖注入特性注册、定时任务、Redis、服务器指标监控 ===== 使用教程 ===== 1、定义启动模块(可组合多个模块,按 Order 从小到大执行): [ImportStartupModule(typeof(OtherStartupModule))] public class AppStartup : StartupModule<AppStartup> { public override void ConfigureServices(WebApplicationBuilder builder) { // 扫描 [Component] 特性自动注册服务 builder.Services.AddDependencyInjectionByComponent( [typeof(Program).Assembly]); } } 2、Program.cs 一行启动: var builder = WebApplication.CreateSlimBuilder(args); HzyApplication.Run<AppStartup>(builder); 3、服务注册与注入: [Component] // 默认 Transient [Component(ServiceLifetime.Scoped)] // 指定生命周期 [Component(typeof(IUserService), ServiceLifetime.Singleton)] // 指定接口注册 public class UserService : IUserService { } public class OrderService { [Autowired] public IUserService UserService { get; set; } // 属性注入 } 4、定时任务(Quartz Cron): [Component] public class JobService { [Scheduled("0/5 * * * * ?")] // 每 5 秒执行 public void SyncData() { } } 5、全局服务网关: App.ServiceProvider // 根容器 App.HttpContext // 当前请求上下文 App.CreateScope() // 手动创建服务作用域 更多功能(动态 API、EF Core 仓储、AOP)请安装对应包,见项目地址。 源码与完整文档:https://gitee.com/hzy6/HZY.Framework 实战案例(HzyAdmin):https://gitee.com/hzy6/HzyAdmin Aop 拦截能力已拆分至独立包 HZY.Framework.Aop
Activity
- Latest release
- 3w ago
- Total releases
- 199
- Cadence
- ~daily
- Last 12 months
- 28
Details
- License
- MIT
- First release
- Jan 29, 2023
| Version | Released | |
|---|---|---|
10.1.18
patch
|
10.1.18
patch
Dependencies (6)
|
|
10.1.17
patch
|
10.1.17
patch
Dependencies (6)
|
|
10.1.16
patch
|
10.1.16
patch
Dependencies (6)
|
|
10.1.15
patch
|
10.1.15
patch
Dependencies (6)
|
|
10.1.14
patch
|
10.1.14
patch
Dependencies (6)
|
|
10.1.10
patch
|
10.1.10
patch
Dependencies (6)
|
|
10.1.9
patch
|
10.1.9
patch
Dependencies (6)
|
|
10.1.8
patch
|
10.1.8
patch
Dependencies (6)
|
|
10.1.7
patch
|
10.1.7
patch
Dependencies (6)
|
|
10.1.6
patch
|
10.1.6
patch
Dependencies (6)
|
|
10.1.5
patch
|
10.1.5
patch
Dependencies (6)
|
|
10.1.4
patch
|
10.1.4
patch
Dependencies (6)
|
|
10.1.3
patch
|
10.1.3
patch
Dependencies (6)
|
|
10.1.2
patch
|
10.1.2
patch
Dependencies (6)
|
|
10.1.1
minor
|
10.1.1
minor
Dependencies (6)
|
|
10.0.13
patch
|
10.0.13
patch
Dependencies (5)
|
|
10.0.12
patch
|
10.0.12
patch
Dependencies (5)
|
|
10.0.11
patch
|
10.0.11
patch
Dependencies (5)
|
|
10.0.9
patch
|
10.0.9
patch
Dependencies (5)
|
|
10.0.8
patch
|
10.0.8
patch
Dependencies (5)
|
|
10.0.7
patch
|
10.0.7
patch
Dependencies (5)
|
|
10.0.6
patch
|
10.0.6
patch
Dependencies (6)
|
|
10.0.5
patch
|
10.0.5
patch
Dependencies (6)
|
|
10.0.4
patch
|
10.0.4
patch
Dependencies (6)
|
|
10.0.3
patch
|
10.0.3
patch
Dependencies (6)
|
|
10.0.2
patch
|
10.0.2
patch
Dependencies (6)
|
|
10.0.1
patch
|
10.0.1
patch
Dependencies (6)
|
|
10.0.0
major
|
10.0.0
major
Dependencies (6)
|
|
8.0.66
patch
|
8.0.66
patch
Dependencies (6)
|
|
8.0.65
patch
|
8.0.65
patch
Dependencies (6)
|
|
8.0.64
patch
|
8.0.64
patch
Dependencies (6)
|
|
8.0.63
patch
|
8.0.63
patch
Dependencies (6)
|
|
8.0.62
patch
|
8.0.62
patch
Dependencies (6)
|
|
8.0.61
patch
|
8.0.61
patch
Dependencies (6)
|
|
8.0.60
patch
|
8.0.60
patch
Dependencies (6)
|
|
8.0.59
patch
|
8.0.59
patch
Dependencies (6)
|
|
8.0.58
patch
|
8.0.58
patch
Dependencies (6)
|
|
8.0.57
patch
|
8.0.57
patch
Dependencies (5)
|
|
8.0.56
patch
|
8.0.56
patch
Dependencies (3)
|
|
8.0.55
patch
|
8.0.55
patch
Dependencies (3)
|
|
8.0.54
patch
|
8.0.54
patch
Dependencies (3)
|
|
8.0.53
patch
|
8.0.53
patch
Dependencies (3)
|
|
8.0.52
patch
|
8.0.52
patch
Dependencies (3)
|
|
8.0.51
patch
|
8.0.51
patch
Dependencies (3)
|
|
8.0.50
patch
|
8.0.50
patch
Dependencies (3)
|
|
8.0.49
patch
|
8.0.49
patch
Dependencies (3)
|
|
8.0.48
patch
|
8.0.48
patch
Dependencies (3)
|
|
8.0.47
patch
|
8.0.47
patch
Dependencies (3)
|
|
8.0.46
patch
|
8.0.46
patch
Dependencies (3)
|
|
8.0.45
patch
|
8.0.45
patch
Dependencies (3)
|