Beispiel #1
0
 public async Task <ItemDto[]> SearchAsync(
     [FromQuery] string keywords    = "",
     [FromQuery] int skipCount      = 0,
     [FromQuery] int maxResultCount = 10)
 {
     return(await ItemAppService.SearchAsync(keywords));
 }
Beispiel #2
0
        public async Task <ItemDto[]> GetList(
            string keywords    = null,
            int seed           = 0,
            int skipCount      = 0,
            int maxResultCount = 10,
            int[] itemIdsArr   = null)
        {
            if (seed < 0 || skipCount < 0 || maxResultCount < 0)
            {
                throw new ArgumentException();
            }

            if (itemIdsArr != null && itemIdsArr.Length > 0)
            {
                return(await ItemAppService.GetItemsWithDetailAsync(itemIdsArr));
            }
            else if (keywords == null)
            {
                return(await ItemAppService.SelectAsync(seed, maxResultCount));
            }
            else
            {
                return(await ItemAppService.SearchAsync(keywords, skipCount, maxResultCount));
            }
        }