Пример #1
0
        public IActionResult KitsuneUpdateDomain([FromQuery] string websiteid, [FromQuery] string newDomain, [FromQuery] string clientid)
        {
            try
            {
                if (string.IsNullOrEmpty(clientid) || BasePluginConfigGenerator.GetBasePlugin(clientid).GetClientId() != clientid.Trim().ToUpper())
                {
                    return(new CommonActionResult(CommonAPIResponse.UnAuthorized()));
                }

                var requestModel = new KitsuneUpdateDomainRequestModel {
                    CustomerId = websiteid, NewDomain = newDomain
                };
                var validationResult = requestModel.Validate();
                if (validationResult.Any())
                {
                    return(BadRequest(validationResult));
                }

                return(Ok(MongoConnector.UpdateDomainName(requestModel)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
Пример #2
0
        public IActionResult KitsuneUpdateDomain([FromQuery] string customerId, [FromQuery] string newDomain)
        {
            try
            {
                var requestModel = new KitsuneUpdateDomainRequestModel {
                    CustomerId = customerId, NewDomain = newDomain
                };
                var validationResult = requestModel.Validate();
                if (validationResult.Any())
                {
                    return(BadRequest(validationResult));
                }

                return(Ok(MongoConnector.UpdateDomainName(requestModel)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }