/** * Description: 行业商家图片上传 * Summary: 行业商家图片上传 */ public async Task <UploadMerchantImageResponse> UploadMerchantImageExAsync(UploadMerchantImageRequest request, Dictionary <string, string> headers, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime) { if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.FileObject)) { CreateAntcloudGatewayxFileUploadRequest uploadReq = new CreateAntcloudGatewayxFileUploadRequest { AuthToken = request.AuthToken, ApiCode = "antcloud.industry.merchant.image.upload", FileName = request.FileObjectName, }; CreateAntcloudGatewayxFileUploadResponse uploadResp = await CreateAntcloudGatewayxFileUploadExAsync(uploadReq, headers, runtime); if (!AntChain.AlipayUtil.AntchainUtils.IsSuccess(uploadResp.ResultCode, "ok")) { UploadMerchantImageResponse uploadMerchantImageResponse = new UploadMerchantImageResponse { ReqMsgId = uploadResp.ReqMsgId, ResultCode = uploadResp.ResultCode, ResultMsg = uploadResp.ResultMsg, }; return(uploadMerchantImageResponse); } Dictionary <string, string> uploadHeaders = AntChain.AlipayUtil.AntchainUtils.ParseUploadHeaders(uploadResp.UploadHeaders); AntChain.AlipayUtil.AntchainUtils.PutObject(request.FileObject, uploadHeaders, uploadResp.UploadUrl); request.FileId = uploadResp.FileId; } AlibabaCloud.TeaUtil.Common.ValidateModel(request); return(TeaModel.ToObject <UploadMerchantImageResponse>(await DoRequestAsync("1.0", "antcloud.industry.merchant.image.upload", "HTTPS", "POST", "/gateway.do", request.ToMap(), headers, runtime))); }
/** * Description: Demo接口,返回当输入的值 * Summary: 返回输入值 */ public async Task <EchoGatewayCheckResponse> EchoGatewayCheckExAsync(EchoGatewayCheckRequest request, Dictionary <string, string> headers, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime) { if (!AlibabaCloud.TeaUtil.Common.IsUnset(request.FileObject)) { CreateAntcloudGatewayxFileUploadRequest uploadReq = new CreateAntcloudGatewayxFileUploadRequest { ApiCode = "demo.gateway.check.echo", }; CreateAntcloudGatewayxFileUploadResponse uploadResp = await CreateAntcloudGatewayxFileUploadExAsync(uploadReq, headers, runtime); if (!AntChain.AlipayUtil.AntchainUtils.IsSuccess(uploadResp.ResultCode, "OK")) { EchoGatewayCheckResponse echoGatewayCheckResponse = new EchoGatewayCheckResponse { ReqMsgId = uploadResp.ReqMsgId, ResultCode = uploadResp.ResultCode, ResultMsg = uploadResp.ResultMsg, }; return(echoGatewayCheckResponse); } Dictionary <string, string> uploadHeaders = AntChain.AlipayUtil.AntchainUtils.ParseUploadHeaders(uploadResp.UploadHeaders); AntChain.AlipayUtil.AntchainUtils.PutObject(request.FileObject, uploadHeaders, uploadResp.UploadUrl); request.FileId = uploadResp.FileId; } AlibabaCloud.TeaUtil.Common.ValidateModel(request); return(TeaModel.ToObject <EchoGatewayCheckResponse>(await DoRequestAsync("1.0", "demo.gateway.check.echo", "HTTPS", "POST", "/gateway.do", request.ToMap(), headers, runtime))); }
/** * Description: 创建HTTP PUT提交的文件上传 * Summary: 文件上传创建 */ public async Task <CreateAntcloudGatewayxFileUploadResponse> CreateAntcloudGatewayxFileUploadExAsync(CreateAntcloudGatewayxFileUploadRequest request, Dictionary <string, string> headers, AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime) { AlibabaCloud.TeaUtil.Common.ValidateModel(request); return(TeaModel.ToObject <CreateAntcloudGatewayxFileUploadResponse>(await DoRequestAsync("1.0", "antcloud.gatewayx.file.upload.create", "HTTPS", "POST", "/gateway.do", request.ToMap(), headers, runtime))); }
/** * Description: 创建HTTP PUT提交的文件上传 * Summary: 文件上传创建 */ public async Task <CreateAntcloudGatewayxFileUploadResponse> CreateAntcloudGatewayxFileUploadAsync(CreateAntcloudGatewayxFileUploadRequest request) { AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); Dictionary <string, string> headers = new Dictionary <string, string>() { }; return(await CreateAntcloudGatewayxFileUploadExAsync(request, headers, runtime)); }