/// <summary> /// 新增接口信息 /// </summary> /// <param name="dto">新增信息</param> /// <returns></returns> public async Task <bool> InsertAsync(APIManagementCreateDto dto) { dto.NotNull(nameof(APIManagementCreateDto)); if (await _apiManagementRepository.IsExistAsync(op => op.ApiUrl == dto.ApiUrl)) { var APIModel = dto.ToMap <APIManagement>(); APIModel.IsEnabled = true;// 开启接口 return(await _apiManagementRepository.InsertAsync(APIModel)); } throw new BusinessException("新增的接口信息所包含地址已存在!!!"); }
public async Task <ResultDto <bool> > CreateAsync(APIManagementCreateDto dto) => new ResultDto <bool> { Result = await _apiManagementService.InsertAsync(dto) };