update metodi invio logfile zippati
This commit is contained in:
@@ -234,6 +234,7 @@
|
||||
<None Include="CONF\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="CONF\license.json" />
|
||||
<None Include="CONF\process.json" />
|
||||
<None Include="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
+31
-14
@@ -1334,20 +1334,37 @@ namespace IOB_MAN
|
||||
var client = new RestClient(ApiUrl);
|
||||
client.UseNewtonsoftJson();
|
||||
|
||||
// genero il ticket
|
||||
var newSuppReq = new SupportRequest()
|
||||
SupportRequest newSuppReq = new SupportRequest();
|
||||
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
|
||||
string rawData = "";
|
||||
if (File.Exists(licensePath))
|
||||
{
|
||||
CodApp = "MAPO-IOB-WIN-NEXT",
|
||||
CodImp = "",
|
||||
CodInst = "SteamWare",
|
||||
ContactEmail = "samuele@steamware.net",
|
||||
ContactName = "Samuele",
|
||||
ContactPhone = "035-460560",
|
||||
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
||||
ReqBody = "Invio File Test",
|
||||
Tipo = TipologiaTicket.FileUpload,
|
||||
idxSubLic = 0
|
||||
};
|
||||
rawData = File.ReadAllText(licensePath);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
// fare: composizione richiesta da parametri chiave
|
||||
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
|
||||
}
|
||||
else
|
||||
{
|
||||
string hostName = utils.machineName;
|
||||
string listIP = string.Join(", ", utils.machineIp);
|
||||
// genero il ticket
|
||||
newSuppReq = new SupportRequest()
|
||||
{
|
||||
CodApp = "MAPO-IOB-WIN-NEXT",
|
||||
CodImp = "",
|
||||
CodInst = "SteamWare",
|
||||
ContactEmail = "info@steamware.net",
|
||||
ContactName = "Default Config",
|
||||
ContactPhone = "035-460560",
|
||||
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
||||
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
|
||||
Tipo = TipologiaTicket.FileUpload,
|
||||
idxSubLic = 0
|
||||
};
|
||||
}
|
||||
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
|
||||
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
|
||||
|
||||
@@ -1355,8 +1372,8 @@ namespace IOB_MAN
|
||||
var fileUploadReq = new RestRequest("/api/filesave/single");
|
||||
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
|
||||
fileUploadReq.AddFile("file", zipPath);
|
||||
|
||||
// ... infine INVIA file zip che li contiene...
|
||||
|
||||
//var fileUploadResp = client.Post(fileUploadReq);
|
||||
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user