TeamCurrency.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using OASystem.Infrastructure.Repositories.Groups;
  2. namespace OASystem.API.OAMethodLib.Quartz.Business
  3. {
  4. public class TeamCurrency
  5. {
  6. private readonly static TeamRateRepository _grpCurrencyRep = AutofacIocManager.Instance.GetService<TeamRateRepository>();
  7. /// <summary>
  8. /// 团组币种信息
  9. /// 每天 凌晨零点更新
  10. /// </summary>
  11. public static async void PostTeamCurrencyUpdate()
  12. {
  13. string grpCurrencyName = "GroupTeamCurrencyData";
  14. var _currData = await _grpCurrencyRep.PostGroupTeamRateHot();
  15. if (_currData != null)
  16. {
  17. var s = await RedisRepository.RedisFactory.CreateRedisRepository().KeyDeleteAsync(grpCurrencyName);
  18. if (s)
  19. {
  20. TimeSpan ts = DateTime.Now.AddHours(25).TimeOfDay;
  21. await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync(grpCurrencyName, JsonConvert.SerializeObject(_currData), ts);
  22. }
  23. }
  24. }
  25. }
  26. }