32 lines
874 B
C#
32 lines
874 B
C#
using MAX.Core.DependencyInjection;
|
|
using MAX.Core.Helpers;
|
|
using Store.Framework.Jobs;
|
|
using Store.VirtualLogistics.Services;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Store.SyncLogistics.Jobs;
|
|
|
|
[Job("synclogistics_balance_check", "*/10 * * * *")]
|
|
internal class BalanceCheckJob : IScheduledJobs, ITransientDependency
|
|
{
|
|
private readonly VirtualLogisticsService _virtualLogisticsService;
|
|
|
|
public BalanceCheckJob(VirtualLogisticsService virtualLogisticsService)
|
|
{
|
|
_virtualLogisticsService = virtualLogisticsService;
|
|
}
|
|
public Task RunAsync()
|
|
{
|
|
var money = _virtualLogisticsService.GetUserMoney();
|
|
if (money < 50)
|
|
{
|
|
HttpHelper.Get($"https://iyuu.cn/IYUU71425T5f235fa5f5afb2087416750622ed4d241c89da44.send?text=余额不足:{money}");
|
|
}
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|