Add project files.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using JSMR.Application.Common;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
public class VoiceWorkSearchCriteria
|
||||
{
|
||||
public string? Keywords { get; init; }
|
||||
public string? Title { get; init; }
|
||||
public string? Circle { get; init; }
|
||||
//public SaleStatus SaleStatus { get; init; }
|
||||
//public CircleStatus CircleStatus { get; init; }
|
||||
//public TagStatus TagStatus { get; init; }
|
||||
//public CreatorStatus CreatorStatus { get; init; }
|
||||
public int[] TagIds { get; init; } = [];
|
||||
public bool IncludeAllTags { get; init; }
|
||||
public int[] CreatorIds { get; init; } = [];
|
||||
public bool IncludeAllCreators { get; init; }
|
||||
//public VoiceWorkSort Sort { get; init; }
|
||||
//public VoiceWorkLanguage Language { get; init; }
|
||||
public DateTime? ReleaseDateStart { get; init; }
|
||||
public DateTime? ReleaseDateEnd { get; init; }
|
||||
//public List<AgeRating> AgeRatings { get; init; }
|
||||
public Language[] SupportedLanguages { get; init; } = [];
|
||||
//public List<AIGeneration> AIGenerationOptions { get; init; }
|
||||
public bool ShowFavoriteVoiceWorks { get; init; }
|
||||
public bool ShowInvalidVoiceWorks { get; init; }
|
||||
public int? MinDownloads { get; init; }
|
||||
public int? MaxDownloads { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
//public record VoiceWorkSearchOptions : SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField>
|
||||
//{
|
||||
|
||||
//}
|
||||
@@ -0,0 +1,8 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
public record VoiceWorkSearchResults : SearchResult<object>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
public enum VoiceWorkSortField
|
||||
{
|
||||
ReleaseDateNewToOld,
|
||||
ReleaseDateOldToNew,
|
||||
BestSelling,
|
||||
MostWishedFor,
|
||||
SalesToWishlistRatio,
|
||||
StarRating
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using JSMR.Application.Common.Caching;
|
||||
using JSMR.Application.VoiceWorks.Ports;
|
||||
using JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search;
|
||||
|
||||
//public sealed class SearchVoiceWorksHandler(IVoiceWorkReader reader, ICache cache)
|
||||
//{
|
||||
// //public async Task<SearchVoiceWorksResponse> HandleAsync(SearchVoiceWorksRequest request, CancellationToken cancellationToken)
|
||||
// //{
|
||||
// // VoiceWorkSearchOptions searchOptions = request.Options;
|
||||
|
||||
// // string cacheKey = $"vw:{searchOptions.GetHashCode()}";
|
||||
|
||||
// // VoiceWorkSearchResults? cachedResults = await cache.GetAsync<VoiceWorkSearchResults>(cacheKey, cancellationToken);
|
||||
|
||||
// // if (cachedResults != null)
|
||||
// // return new SearchVoiceWorksResponse(cachedResults);
|
||||
|
||||
// // VoiceWorkSearchResults results = await reader.SearchAsync(searchOptions, cancellationToken);
|
||||
|
||||
// // CacheEntryOptions cacheEntryOptions = new()
|
||||
// // {
|
||||
// // SlidingExpiration = TimeSpan.FromMinutes(10)
|
||||
// // };
|
||||
|
||||
// // await cache.SetAsync(cacheKey, results, cacheEntryOptions, cancellationToken);
|
||||
|
||||
// // return new SearchVoiceWorksResponse(results);
|
||||
// //}
|
||||
//}
|
||||
@@ -0,0 +1,6 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
using JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search;
|
||||
|
||||
public sealed record SearchVoiceWorksRequest(SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField> Options);
|
||||
@@ -0,0 +1,5 @@
|
||||
using JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search;
|
||||
|
||||
public sealed record SearchVoiceWorksResponse(VoiceWorkSearchResults Results);
|
||||
Reference in New Issue
Block a user