CSharp-Single-EFCore/Bunny.Service/Job/SimpleJob.cs

18 lines
518 B
C#
Raw Normal View History

using log4net;
using Quartz;
2024-08-14 23:57:43 +08:00
namespace Bunny.Service.Job;
2024-08-15 22:55:32 +08:00
public class SimpleJob : IJob
2024-08-14 23:57:43 +08:00
{
private static readonly ILog Log = LogManager.GetLogger(typeof(SimpleJob));
2024-08-14 23:57:43 +08:00
public Task Execute(IJobExecutionContext context)
{
var dataMap = context.JobDetail.JobDataMap;
var username = dataMap.GetString("username");
var password = dataMap.GetString("password");
Log.Info($"SimpleJob用户名{username},密码: {password}");
2024-08-14 23:57:43 +08:00
return Task.CompletedTask;
}
}