feat: 支持多选模型库条件
This commit is contained in:
@@ -16,17 +16,17 @@ public class ModelLibraryGetListInput : PagedAllResultRequestDto
|
||||
/// <summary>
|
||||
/// 供应商名称筛选
|
||||
/// </summary>
|
||||
public string? ProviderName { get; set; }
|
||||
public List<string>? ProviderNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模型类型筛选
|
||||
/// </summary>
|
||||
public ModelTypeEnum? ModelType { get; set; }
|
||||
public List<ModelTypeEnum>? ModelTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// API类型筛选
|
||||
/// </summary>
|
||||
public ModelApiTypeEnum? ModelApiType { get; set; }
|
||||
public List<ModelApiTypeEnum>? ModelApiTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否只显示尊享模型
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user