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

@@ -109,7 +109,7 @@ public class AiChatService : ApplicationService
ApiHost = null,
ApiKey = null,
Remark = x.Description,
IsPremiumPackage = x.IsPremium
IsPremiumPackage = PremiumPackageConst.ModeIds.Contains(x.ModelId)
}).ToListAsync();
return output;
}
@@ -144,21 +144,13 @@ public class AiChatService : ApplicationService
}
//如果是尊享包服务,需要校验是是否尊享包足够
if (CurrentUser.IsAuthenticated)
if (CurrentUser.IsAuthenticated && PremiumPackageConst.ModeIds.Contains(input.Model))
{
var isPremium = await _aiModelRepository._DbQueryable
.Where(x => x.ModelId == input.Model)
.Select(x => x.IsPremium)
.FirstAsync();
if (isPremium)
// 检查尊享token包用量
var availableTokens = await _premiumPackageManager.GetAvailableTokensAsync(CurrentUser.GetId());
if (availableTokens <= 0)
{
// 检查尊享token包用量
var availableTokens = await _premiumPackageManager.GetAvailableTokensAsync(CurrentUser.GetId());
if (availableTokens <= 0)
{
throw new UserFriendlyException("尊享token包用量不足请先购买尊享token包");
}
throw new UserFriendlyException("尊享token包用量不足请先购买尊享token包");
}
}
@@ -227,12 +219,7 @@ public class AiChatService : ApplicationService
}
//如果是尊享包服务,需要校验是是否尊享包足够
var isPremium = await _aiModelRepository._DbQueryable
.Where(x => x.ModelId == input.ModelId)
.Select(x => x.IsPremium)
.FirstAsync();
if (isPremium)
if (PremiumPackageConst.ModeIds.Contains(input.ModelId))
{
// 检查尊享token包用量
var availableTokens = await _premiumPackageManager.GetAvailableTokensAsync(tokenValidation.UserId);