| | |
| | | using Furion; |
| | | using Furion.DependencyInjection; |
| | | using Microsoft.AspNetCore.DataProtection.KeyManagement; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | return Data; |
| | | } |
| | | |
| | | |
| | | public long Incrby(string key) |
| | | { |
| | | return RedisHelper.IncrBy(key); |
| | | } |
| | | |
| | | public string Get32sn() |
| | | { |
| | | string formattedDate = DateTime.Now.ToString("yyyyMMdd"); |
| | | |
| | | |
| | | var sn = Incrby($"CreatSnKey:{formattedDate}"); |
| | | if(sn<1) |
| | | { |
| | | //设置有效期限为24小时 |
| | | SetTtl($"CreatSnKey:{formattedDate}", 24 * 60 * 60); |
| | | } |
| | | string re = "Ez" + formattedDate + sn.ToString(); |
| | | |
| | | return re; |
| | | } |
| | | } |
| | | } |