feat: 支持多选模型库条件

This commit is contained in:
ccnetcore
2025-12-10 00:31:14 +08:00
parent 909406238c
commit 1a32fa9e20
2 changed files with 10 additions and 10 deletions

View File

@@ -35,12 +35,12 @@ public class ModelService : ApplicationService, IModelService
.Where(x => !x.IsDeleted)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), x =>
x.Name.Contains(input.SearchKey) || x.ModelId.Contains(input.SearchKey))
.WhereIF(!string.IsNullOrWhiteSpace(input.ProviderName), x =>
x.ProviderName == input.ProviderName)
.WhereIF(input.ModelType.HasValue, x =>
x.ModelType == input.ModelType.Value)
.WhereIF(input.ModelApiType.HasValue, x =>
x.ModelApiType == input.ModelApiType.Value)
.WhereIF(input.ProviderNames is not null, x =>
input.ProviderNames.Contains(x.ProviderName))
.WhereIF(input.ModelTypes is not null, x =>
input.ModelTypes.Contains(x.ModelType))
.WhereIF(input.ModelApiTypes is not null, x =>
input.ModelApiTypes.Contains(x.ModelApiType))
.WhereIF(input.IsPremiumOnly == true, x =>
x.ModelType == ModelTypeEnum.PremiumChat)
.OrderBy(x => x.OrderNum)
@@ -113,4 +113,4 @@ public class ModelService : ApplicationService, IModelService
return Task.FromResult(options);
}
}
}