public async Task <ResultModel> SyncAsync(SyncRequestModel requestModel) { var model = _mapper.Map <SyncModel>(requestModel); List <AddConfigurationItemRequestModel> configurationItems = await _configCenterService.GetSyncConfigurationItemModelAsync(model); await _configCenterHubContext.Clients.All.SyncConfigurationItem(requestModel.SourceKey, requestModel.TargetKeys, configurationItems); return(ResultModel.Success("同步成功")); }
public IEnumerable <string> SyncProject([FromBody] SyncRequestModel syncRequest) { List <string> messages; try { syncService.ClearLog(); if (!syncService.SyncProject(syncRequest.ProjectId)) { throw new HttpResponseException(HttpStatusCode.NotFound); } messages = syncService.Messages().ToList(); } catch (Exception e) { messages = syncService.Messages().ToList(); messages.Add(e.Message); messages.Add(e.StackTrace); } return(messages); }
public async Task <ResultModel> SyncAsync(SyncRequestModel requestModel) { var resultModel = await SendPutAsync <ResultModel>($"{_controllerUrl}Sync", requestModel); return(resultModel); }