Test.Core.Web/utils/RechargeCodeUtil.cs

(完整代码) 899B

using CommonUtils;
using System;
using System.Linq;

namespace Test.Core.Web
{
    public static class RechargeCodeUtil
    {
        public static string GetConsumed(bool state = true)
        {
            return Db.Instance.RechargeCodes.Where(m => m.Consumed == state).ToJson();
        }

        public static void Generate()
        {
            var dbContext = Db.Instance;
            for (int index = 0; index < 10; index++)
            {
                dbContext.Add(new RechargeCode
                {
                    Value = StringUtil.GetGuid(),
                    CreateTime = DateTime.Now
                });
            }
            dbContext.SaveChanges();
        }

        public static void Clear()
        {
            var dbContext = Db.Instance;
            dbContext.RemoveRange(Db.Instance.RechargeCodes);
            dbContext.SaveChanges();
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。