예제 #1
0
        public async Task <HttpResponseMessage> CreateReviewService(CreateReviewServiceDto createReviewService)
        {
            var message = CreateMessageData($"service/review");

            if (!ModelState.IsValid)
            {
                return(CreateValidationErrorResponse(message, new ValidationResult(Validation.InvalidParameters)));
            }

            var result = await _serviceService.CreateReviewService(createReviewService.serviceId, createReviewService.customerid, createReviewService.star, createReviewService.content);

            if (!result.IsSuccess)
            {
                return(CreateValidationErrorResponse(message, new ValidationResult(result.message)));
            }
            return(CreateOkResponse(message, createReviewService));
        }