Files
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

57 lines
1.9 KiB
C#
Raw Permalink 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.

namespace QYZH.InteractiveMagazine.Models.Settings;
/// <summary>
/// Hangfire 定时任务配置集合(对应 appsettings.json 中的 "HangfireJobs" 节点)
/// </summary>
public class HangfireJobSettings
{
/// <summary>
/// 定时任务列表,每一项对应一个 Hangfire RecurringJob
/// </summary>
public List<HangfireJobConfig> Jobs { get; set; } = new();
}
/// <summary>
/// 单个定时任务配置
/// </summary>
public class HangfireJobConfig
{
/// <summary>
/// 任务名称Hangfire Dashboard 中展示的唯一标识,建议英文短横线命名,如 "sample-job"
/// </summary>
public string Name { get; set; } = "";
/// <summary>
/// Job 类的完整类型名称(含命名空间,如 "QYZH.InteractiveMagazine.WorkService.Jobs.SampleJob"
/// </summary>
public string JobType { get; set; } = "";
/// <summary>
/// 要调用的方法名称(默认 "ExecuteAsync",方法必须为 public 无参 Task
/// </summary>
public string MethodName { get; set; } = "ExecuteAsync";
/// <summary>
/// Cron 表达式,控制执行频率。常用示例:
/// "* * * * *" 每分钟
/// "*/5 * * * *" 每5分钟
/// "0 * * * *" 每小时整点
/// "0 0 * * *" 每天午夜
/// "0 9 * * *" 每天上午9点
/// "0 9 * * 1" 每周一上午9点
/// "0 0 1 * *" 每月1号午夜
/// 格式:分 时 日 月 星期5位不支持秒和年
/// </summary>
public string Cron { get; set; } = "";
/// <summary>
/// 是否启用此任务(设为 false 将从 Hangfire 中移除该任务)
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// 备注说明(仅供阅读理解,不参与运行逻辑)
/// </summary>
public string? Description { get; set; }
}