Revert "feat: 支持尊享包渠道"

This reverts commit 70ae2fab44.
This commit is contained in:
ccnetcore
2025-12-31 00:10:44 +08:00
parent 70ae2fab44
commit 0c31b97824
28 changed files with 34 additions and 1666 deletions

View File

@@ -150,12 +150,7 @@ public class AiGateWayManager : DomainService
await _usageStatisticsManager.SetUsageAsync(userId.Value, request.Model, data.Usage, tokenId);
// 扣减尊享token包用量
var isPremium = await _aiModelRepository._DbQueryable
.Where(x => x.ModelId == request.Model)
.Select(x => x.IsPremium)
.FirstAsync();
if (isPremium)
if (PremiumPackageConst.ModeIds.Contains(request.Model))
{
var totalTokens = data.Usage?.TotalTokens ?? 0;
if (totalTokens > 0)
@@ -305,20 +300,12 @@ public class AiGateWayManager : DomainService
await _usageStatisticsManager.SetUsageAsync(userId, request.Model, tokenUsage, tokenId);
// 扣减尊享token包用量
if (userId is not null)
if (userId is not null && PremiumPackageConst.ModeIds.Contains(request.Model))
{
var isPremium = await _aiModelRepository._DbQueryable
.Where(x => x.ModelId == request.Model)
.Select(x => x.IsPremium)
.FirstAsync();
if (isPremium)
var totalTokens = tokenUsage.TotalTokens ?? 0;
if (totalTokens > 0)
{
var totalTokens = tokenUsage.TotalTokens ?? 0;
if (totalTokens > 0)
{
await PremiumPackageManager.TryConsumeTokensAsync(userId.Value, totalTokens);
}
await PremiumPackageManager.TryConsumeTokensAsync(userId.Value, totalTokens);
}
}
}
@@ -376,20 +363,12 @@ public class AiGateWayManager : DomainService
await _usageStatisticsManager.SetUsageAsync(userId, model, response.Usage, tokenId);
// 扣减尊享token包用量
if (userId is not null)
if (userId is not null && PremiumPackageConst.ModeIds.Contains(request.Model))
{
var isPremium = await _aiModelRepository._DbQueryable
.Where(x => x.ModelId == request.Model)
.Select(x => x.IsPremium)
.FirstAsync();
if (isPremium)
var totalTokens = response.Usage.TotalTokens ?? 0;
if (totalTokens > 0)
{
var totalTokens = response.Usage.TotalTokens ?? 0;
if (totalTokens > 0)
{
await PremiumPackageManager.TryConsumeTokensAsync(userId.Value, totalTokens);
}
await PremiumPackageManager.TryConsumeTokensAsync(userId.Value, totalTokens);
}
}
}