|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
using System;
|
|
|
|
|
using S3Demo.Helper;
|
|
|
|
|
using Ksat.Supplyment.Library.Uploader;
|
|
|
|
|
using Ksat.Logging;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Amazon.S3;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Amazon;
|
|
|
|
|
using Amazon.S3;
|
|
|
|
|
using Amazon.Runtime;
|
|
|
|
|
using S3Demo.Helper;
|
|
|
|
|
using Ksat.Supplyment.Library.Uploader;
|
|
|
|
|
using Ksat.Logging;
|
|
|
|
|
|
|
|
|
|
namespace S3Demo.Model.Uploader
|
|
|
|
|
{
|
|
|
|
@ -34,6 +35,10 @@ namespace S3Demo.Model.Uploader
|
|
|
|
|
|
|
|
|
|
public event UploadFinishHandler UploadFinish;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Scada Api
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static string url = "http://172.17.204.30:9000/api/tri/imagesupload";
|
|
|
|
|
|
|
|
|
|
public void Cancel()
|
|
|
|
|
{
|
|
|
|
@ -52,7 +57,12 @@ namespace S3Demo.Model.Uploader
|
|
|
|
|
string res = await mTask;
|
|
|
|
|
UploadFinish(this, res.Equals("OK"), res);
|
|
|
|
|
//TODO: 请求接口,上传状态
|
|
|
|
|
ScadaRequest req = new ScadaRequest();
|
|
|
|
|
ScadaResponse resp = new ScadaResponse();
|
|
|
|
|
req.s3Flag = res;
|
|
|
|
|
resp = JsonConvert.DeserializeObject<ScadaResponse>(Helper.HttpHelper.PostUrl(url, JsonConvert.SerializeObject(req)));
|
|
|
|
|
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")} s3Recv {RequestData.Keyname} ==>{res}");
|
|
|
|
|
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.fff")} ScadaRecv ==>{resp.code} & {resp.message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|