public async Task <ResultModel> AddNamespaceAsync(AddNamespaceRequestModel requestModel) { var model = _mapper.Map <AddNamespaceModel>(requestModel); await _namespaceService.AddNamespaceAsync(model); return(ResultModel.Success("添加成功")); }
public async Task <ResultModel> AddNamespace(AddNamespaceModel model) { try { await namespaceService.AddNamespaceAsync(model); return(ResultModel.Success("添加成功")); } catch (AspectInvocationException ex) { return(ResultModel.Fail(ex.InnerException?.Message)); } catch (MateralConfigCenterException ex) { return(ResultModel.Fail(ex.Message)); } }