feat: 完成基础接口搭建

This commit is contained in:
橙子
2024-10-15 22:14:14 +08:00
parent a0ef3af155
commit 3383e86064
6 changed files with 143 additions and 2 deletions

View File

@@ -44,6 +44,12 @@ public class MiningPoolManager : DomainService
return await ComputeMiningProbabilityAsync();
});
public async Task<MiningPoolContent> GetMiningPoolContentAsync()
{
var pool = await _cache.GetAsync(CacheConst.MiningPoolContent);
return pool;
}
/// <summary>
/// 用户进行一次挖矿
/// </summary>
@@ -56,7 +62,7 @@ public class MiningPoolManager : DomainService
//挖到了放到用户仓库即可
//如果概率是挖到了矿,再从矿物中随机选择一个稀有度,再在当前稀有度中的矿物列表,随机选择一个具体的矿物
var pool = await _cache.GetAsync(CacheConst.MiningPoolContent);
var pool =await GetMiningPoolContentAsync();
if (pool.TotalNumber == 0)
{
result.Result = MiningResultEnum.PoolIsEmpty;