예제 #1
0
        public async Task <IActionResult> GetProducts([FromBody] ProductGroupProductGetRequest request)
        {
            try
            {
                var response = await _productGroupAppService.SearchProducts(request);

                return(Json(response));
            }
            catch (Exception e)
            {
                _logger.LogError(e, Common.Common.GetMethodName(), request);
                throw;
            }
        }
예제 #2
0
 public async Task <IActionResult> GetProductsConfig([FromBody] ProductGroupProductGetRequest request)
 {
     try
     {
         ProductGroupProductGetResponse response = new ProductGroupProductGetResponse();
         ValidationResult validate = ProductGroupConditionGetRequestValidator.ValidateModel(request);
         if (validate.IsValid)
         {
             response = await _productGroupAppService.GetProducts(request);
         }
         else
         {
             response.SetFail(validate.Errors.Select(p => p.ToString()));
         }
         return(Json(response));
     }
     catch (Exception e)
     {
         _logger.LogError(e, Common.Common.GetMethodName(), request);
         throw;
     }
 }