[Middleware] C#/. NET uses GZY.Quartz.MUI to build a visual scheduled task panel

[Middleware] C#/. NET uses GZY.Quartz.MUI to build a visual scheduled task panel

Help developers set up scheduled tasks through panels. The main thing I want to do is to be like Swagger UI, where the project intrusion is small and only requires UI components injected in Startup.

最后更新 5/26/2022 8:17 PM
黑哥聊dotNet
预计阅读 2 分钟
分类
.NET
标签
.NET C#

preface

GZY.Quartz.MUI is an open source ASP.NET Core project on github. It aims to help developers set up scheduled tasks through panels. The main thing it wants to do is, like SwaggerUI, has less project intrusion and only requires UI components injected in Startup.

官方地址: https://www.cnblogs.com/GuZhenYin/p/15745002.html

** Main functions **

  1. Add local json persistent scheduling tasks without a database.

  2. Add direct calls to local class methods without using the WebAPI interface.

How to use it?

Step 1: Open VS to create a new. NET project. I use the. NET Core Web API to demonstrate it.

第二步:使用 NuGet 安装 GZY.Quartz.MUI 包:

Step 3: Add the GZY.Quartz.MUI service to ConfigureServices in StartUp.cs

public void ConfigureServices(IServiceCollection services)
{

	services.AddControllers();
	services.AddQuartzUI();
	services.AddQuartzClassJobs(); //添加本地调度任务访问
	//  services.AddSingleton<TestJob>();//注入
}

Step 4: Enable the middleware

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
		if (env.IsDevelopment())
		{
			app.UseDeveloperExceptionPage();
		}


		app.UseRouting();
		app.UseQuartz(); //添加这行代码
		app.UseEndpoints(endpoints =>
		{
			endpoints.MapGet("/", async context =>
			{
				await context.Response.WriteAsync("Hello World!");
			});
		});
	}

最后运行项目,在浏览器中导航到 [您的域名]/QuartzUI 就可以看到该项目已经搭建成功了。

brief description

There are two types of setting up scheduled tasks:

  • One is to call the interface directly

Enter the interface you want to start regularly, and I use the test interface I wrote here

  • One is to call local classes

通过调用本地 dll 的方式,新建的类继承IJobService即可

summary

This blog describes GZY.Quartz.MUI building a visual scheduled task panel.

Keep Exploring

延伸阅读

更多文章
同分类 / 同标签 4/22/2026

Support for. NET by operating system versions (250707 update)

Use virtual machines and test machines to test the support of each version of the operating system for. NET. After installing the operating system, it is passed by measuring the corresponding running time of the installation and being able to run the Stardust Agent.

继续阅读
同分类 / 同标签 2/7/2026

Summary of experience in using AOT

From the very beginning of project creation, you should develop a good habit of conducting AOT release testing in a timely manner whenever new features are added or newer syntax is used.

继续阅读