feat: 支持多选模型库条件
This commit is contained in:
@@ -16,17 +16,17 @@ public class ModelLibraryGetListInput : PagedAllResultRequestDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 供应商名称筛选
|
/// 供应商名称筛选
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? ProviderName { get; set; }
|
public List<string>? ProviderNames { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模型类型筛选
|
/// 模型类型筛选
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ModelTypeEnum? ModelType { get; set; }
|
public List<ModelTypeEnum>? ModelTypes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// API类型筛选
|
/// API类型筛选
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ModelApiTypeEnum? ModelApiType { get; set; }
|
public List<ModelApiTypeEnum>? ModelApiTypes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否只显示尊享模型
|
/// 是否只显示尊享模型
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ public class ModelService : ApplicationService, IModelService
|
|||||||
.Where(x => !x.IsDeleted)
|
.Where(x => !x.IsDeleted)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), x =>
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), x =>
|
||||||
x.Name.Contains(input.SearchKey) || x.ModelId.Contains(input.SearchKey))
|
x.Name.Contains(input.SearchKey) || x.ModelId.Contains(input.SearchKey))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.ProviderName), x =>
|
.WhereIF(input.ProviderNames is not null, x =>
|
||||||
x.ProviderName == input.ProviderName)
|
input.ProviderNames.Contains(x.ProviderName))
|
||||||
.WhereIF(input.ModelType.HasValue, x =>
|
.WhereIF(input.ModelTypes is not null, x =>
|
||||||
x.ModelType == input.ModelType.Value)
|
input.ModelTypes.Contains(x.ModelType))
|
||||||
.WhereIF(input.ModelApiType.HasValue, x =>
|
.WhereIF(input.ModelApiTypes is not null, x =>
|
||||||
x.ModelApiType == input.ModelApiType.Value)
|
input.ModelApiTypes.Contains(x.ModelApiType))
|
||||||
.WhereIF(input.IsPremiumOnly == true, x =>
|
.WhereIF(input.IsPremiumOnly == true, x =>
|
||||||
x.ModelType == ModelTypeEnum.PremiumChat)
|
x.ModelType == ModelTypeEnum.PremiumChat)
|
||||||
.OrderBy(x => x.OrderNum)
|
.OrderBy(x => x.OrderNum)
|
||||||
@@ -113,4 +113,4 @@ public class ModelService : ApplicationService, IModelService
|
|||||||
|
|
||||||
return Task.FromResult(options);
|
return Task.FromResult(options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user