Files
QYZH.InteractiveMagazine/QYZH.InteractiveMagazine.WorkService/Jobs/SampleJob.cs
glz 4142b621c3 feat: 新增工作服务项目并调整部分接口路由
1. 新增QYZH.InteractiveMagazine.WorkService工作服务项目,包含队列消费者框架、Hangfire定时任务支持
2. 修复PetService中未定义FeedPetOutput变量的问题
3. 调整JournalController的路由前缀从api/icr改为api
4. 将工作服务项目添加到解决方案中
2026-06-11 18:01:07 +08:00

31 lines
706 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.Extensions.Logging;
namespace QYZH.InteractiveMagazine.WorkService.Jobs;
/// <summary>
/// 示例定时任务
/// </summary>
public class SampleJob
{
private readonly ILogger<SampleJob> _logger;
public SampleJob(ILogger<SampleJob> logger)
{
_logger = logger;
}
/// <summary>
/// 执行定时任务由Hangfire调度
/// </summary>
public async Task ExecuteAsync()
{
_logger.LogInformation("SampleJob 开始执行 {Time}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// TODO: 在此编写具体的定时任务逻辑
await Task.CompletedTask;
_logger.LogInformation("SampleJob 执行完毕");
}
}