Merge branch 'develop' into feature/NewTicketUI
This commit is contained in:
+23
-21
@@ -21,29 +21,30 @@ variables:
|
||||
throw "7 zip file '$7zipPath' not found"
|
||||
}
|
||||
Set-Alias 7zip $7zipPath
|
||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
cd "$env:APP_NAME\bin\publish\net6.0"
|
||||
$Source = "*"
|
||||
$Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
$Source = "$env:APP_NAME\bin\publish\net6.0\*"
|
||||
7zip a -tzip $Target $Source -xr!DATA
|
||||
echo "called ZIP $Source --> $Target"
|
||||
|
||||
# helper creazione hash files x EXE
|
||||
.hashBuildExe: &hashBuildExe
|
||||
- |
|
||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
$MD5 = Get-FileHash $Target -Algorithm MD5
|
||||
$SHA1 = Get-FileHash $Target -Algorithm SHA1
|
||||
New-Item $Target".md5"
|
||||
New-Item $Target".sha1"
|
||||
$MD5.Hash | Set-Content -Path $Target".md5"
|
||||
$SHA1.Hash | Set-Content -Path $Target".sha1"
|
||||
#cd "$env:APP_NAME\bin\publish\net6.0"
|
||||
|
||||
echo "Created HASH files for $Target"
|
||||
# # helper creazione hash files x EXE
|
||||
# .hashBuildExe: &hashBuildExe
|
||||
# - |
|
||||
# $Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
# $MD5 = Get-FileHash $Target -Algorithm MD5
|
||||
# $SHA1 = Get-FileHash $Target -Algorithm SHA1
|
||||
# New-Item $Target".md5"
|
||||
# New-Item $Target".sha1"
|
||||
# $MD5.Hash | Set-Content -Path $Target".md5"
|
||||
# $SHA1.Hash | Set-Content -Path $Target".sha1"
|
||||
|
||||
# echo "Created HASH files for $Target"
|
||||
|
||||
# helper creazione hash files x IIS
|
||||
.hashBuild: &hashBuild
|
||||
- |
|
||||
$Target = $env:APP_NAME + "\bin\publish\" + $env:APP_NAME + ".zip"
|
||||
$Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
$MD5 = Get-FileHash $Target -Algorithm MD5
|
||||
$SHA1 = Get-FileHash $Target -Algorithm SHA1
|
||||
New-Item $Target".md5"
|
||||
@@ -70,11 +71,12 @@ variables:
|
||||
{
|
||||
$version = "unstable"
|
||||
}
|
||||
$File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*")
|
||||
$File2Send = Get-ChildItem("$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\*")
|
||||
ForEach ($File in $File2Send) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
|
||||
echo "mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
|
||||
}
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
||||
@@ -141,8 +143,6 @@ Transfer:test:
|
||||
stage: test
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- develop
|
||||
needs: ["Transfer:build"]
|
||||
script:
|
||||
- dotnet test LiMan.Transfer/LiMan.Transfer.csproj
|
||||
@@ -193,11 +193,13 @@ Transfer:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
needs: ["Transfer:build"]
|
||||
variables:
|
||||
APP_NAME: LiMan.Transfer
|
||||
needs: ["Transfer:test"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=SingleFileX86.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Transfer/LiMan.Transfer.csproj
|
||||
- dotnet publish -p:PublishProfile=SingleFileX86.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release LiMan.Transfer/LiMan.Transfer.csproj
|
||||
- *zipper
|
||||
- *hashBuildExe
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
+57
-1
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -28,6 +30,60 @@ namespace Core
|
||||
public string MasterKey { get; set; } = "";
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Init classe in modalità "empty"
|
||||
/// </summary>
|
||||
public SupportRequest()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Istanzia un nuovo ogetto richeista supporto
|
||||
/// </summary>
|
||||
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
|
||||
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
|
||||
/// <param name="codInst">Codice Cliente/Installazione</param>
|
||||
/// <param name="contactEmail">Email x contatto</param>
|
||||
/// <param name="contactName">Nome del richiedente/clietne</param>
|
||||
/// <param name="contactPhone">Tel richiedente/cliente</param>
|
||||
/// <param name="masterKey">Chiave master di comunicazione da LiMan</param>
|
||||
/// <param name="ReqBody">Testo delal richiesta</param>
|
||||
/// <param name="idxSubLic">Idx univoco di sublic (es x gestione utenti)</param>
|
||||
/// <param name="tipo">Tipo ticket da gestire (default fileUpload)</param>
|
||||
public SupportRequest(string codApp, string codImp, string codInst, string contactEmail, string contactName, string contactPhone, string masterKey, string ReqBody, int idxSubLic = 0, TipologiaTicket tipo = TipologiaTicket.FileUpload)
|
||||
{
|
||||
this.CodApp = CodApp;
|
||||
this.CodImp = CodImp;
|
||||
this.CodInst = CodInst;
|
||||
this.ContactEmail = contactEmail;
|
||||
this.ContactName = contactName;
|
||||
this.ContactPhone = contactPhone;
|
||||
this.MasterKey = masterKey;
|
||||
this.ReqBody = ReqBody;
|
||||
this.idxSubLic = idxSubLic;
|
||||
this.Tipo = tipo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio su file di un oggetto richiesta file upload
|
||||
/// </summary>
|
||||
/// <param name="currReq">Oggetto richiesta (già istanziato)</param>
|
||||
/// <param name="filePath">Path dove salvare il file</param>
|
||||
public static bool SaveRequest(SupportRequest currReq, string filePath)
|
||||
{
|
||||
bool fatto = false;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(currReq, Formatting.Indented);
|
||||
File.WriteAllText(filePath, rawData);
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Write(ex.ToString());
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -54,8 +54,8 @@ namespace LiMan.APi.Controllers
|
||||
/// <summary>
|
||||
/// Eliminazione di un set di attivazioni (SE SCADUTE)
|
||||
/// </summary>
|
||||
// DELETE api/attivazioni
|
||||
[HttpDelete()]
|
||||
// POST api/attivazioni/removeKey
|
||||
[HttpPost("removeKey")]
|
||||
public async Task<bool> Delete([FromBody] UserLicenseRequest CurrRequest)
|
||||
{
|
||||
bool done = await dataService.AttivazioniDelete(CurrRequest.MasterKey, CurrRequest.ParamDict);
|
||||
@@ -63,7 +63,7 @@ namespace LiMan.APi.Controllers
|
||||
foreach (var item in CurrRequest.ParamDict)
|
||||
{
|
||||
// registro 1 riga x ogni record...
|
||||
await dataService.recordCall(CurrRequest.MasterKey, $"DELETE:api/attivazioni:{item.Key}|{item.Value}");
|
||||
await dataService.recordCall(CurrRequest.MasterKey, $"POST:api/attivazioni/removeKey:{item.Key}|{item.Value}");
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ using LiMan.DB.DBModels;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -43,7 +43,6 @@ namespace LiMan.APi.Controllers
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="DataService"></param>
|
||||
/// <param name="env"></param>
|
||||
/// <param name="logger"></param>
|
||||
public FilesaveController(IConfiguration configuration, ApiDataService DataService, IWebHostEnvironment env)
|
||||
{
|
||||
dataService = DataService;
|
||||
@@ -63,15 +62,61 @@ namespace LiMan.APi.Controllers
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta di registrazione ticket supporto
|
||||
/// Calcolo correetto mimetype da nome file
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
protected string GetMimeType(string fileName)
|
||||
{
|
||||
var provider = new FileExtensionContentTypeProvider();
|
||||
string contentType;
|
||||
if (!provider.TryGetContentType(fileName, out contentType))
|
||||
{
|
||||
contentType = "application/octet-stream";
|
||||
}
|
||||
return contentType;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// GET api/filesave/id/filename
|
||||
/// <summary>
|
||||
/// Recupera un singolo file dato ticket code + nome file (safe)
|
||||
/// </summary>
|
||||
/// <param name="id">Ticket code formato T00000000</param>
|
||||
/// <param name="secureName">Nome file (safe)</param>
|
||||
/// <param name="fileName">Nome file da scaricare</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}/{secureName}/{fileName}")]
|
||||
public async Task<ActionResult> DownloadFile(string id, string secureName, string fileName)
|
||||
{
|
||||
string relDir = _configuration["FileShare"];
|
||||
string ticketDir = Path.Combine(relDir, id);
|
||||
var filePath = Path.Combine(ticketDir, secureName);
|
||||
// verifico esistenza..
|
||||
if (System.IO.File.Exists(filePath))
|
||||
{
|
||||
var bytes = await System.IO.File.ReadAllBytesAsync(filePath);
|
||||
return File(bytes, GetMimeType(fileName), fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return File(new byte[0], "text/plain", "Empty.txt");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco files assaociati a ticket supporto
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="CurrRequest"></param>
|
||||
/// <returns></returns>
|
||||
// POST api/files/list/1
|
||||
// POST api/filesave/list/1
|
||||
[HttpPost("list/{id}")]
|
||||
public async Task<List<FileAttachModel>> list(int id, [FromBody] SupportRequest CurrRequest)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
|
||||
|
||||
+18
-2
@@ -110,16 +110,32 @@
|
||||
<param name="configuration"></param>
|
||||
<param name="DataService"></param>
|
||||
<param name="env"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="P:LiMan.APi.Controllers.FilesaveController.dataService">
|
||||
<summary>
|
||||
Dataservice x accesso DB
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Controllers.FilesaveController.GetMimeType(System.String)">
|
||||
<summary>
|
||||
Calcolo correetto mimetype da nome file
|
||||
</summary>
|
||||
<param name="fileName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Controllers.FilesaveController.DownloadFile(System.String,System.String,System.String)">
|
||||
GET api/filesave/id/filename
|
||||
<summary>
|
||||
Recupera un singolo file dato ticket code + nome file (safe)
|
||||
</summary>
|
||||
<param name="id">Ticket code formato T00000000</param>
|
||||
<param name="secureName">Nome file (safe)</param>
|
||||
<param name="fileName">Nome file da scaricare</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Controllers.FilesaveController.list(System.Int32,Core.SupportRequest)">
|
||||
<summary>
|
||||
Richiesta di registrazione ticket supporto
|
||||
Elenco files assaociati a ticket supporto
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="CurrRequest"></param>
|
||||
|
||||
@@ -26,5 +26,7 @@
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: {{CURRENT-REL}}</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
<b>Ultime modifiche:</b>
|
||||
<ul>{{LAST-CHANGES}}</ul>
|
||||
</li>
|
||||
<li>
|
||||
<b>v.1.* →</b>
|
||||
<ul>
|
||||
<li>Prima release dotnet5</li>
|
||||
<li>Integrazione EFCore</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div>
|
||||
<div style="float: left;">
|
||||
<img src="logoSteamware.png" />
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<a href="https://www.steamware.net/" target="_blank">© Steamware 2006-2021</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -0,0 +1,27 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: 1.1.2202.0907</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
<b>Ultime modifiche:</b>
|
||||
<ul>{{LAST-CHANGES}}</ul>
|
||||
</li>
|
||||
<li>
|
||||
<b>v.1.* →</b>
|
||||
<ul>
|
||||
<li>Prima release dotnet5</li>
|
||||
<li>Integrazione EFCore</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div>
|
||||
<div style="float: left;">
|
||||
<img src="logoSteamware.png" />
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<a href="https://www.steamware.net/" target="_blank">© Steamware 2006-2021</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -0,0 +1 @@
|
||||
1.1.2202.0907
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.0.0</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
</item>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2202.0907</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
</item>
|
||||
@@ -0,0 +1,32 @@
|
||||
param([string]$ProjectDir, [string]$ProjectPath);
|
||||
|
||||
$FileMajMin = "..\MajMin.vers"
|
||||
$FileVers = "Resources\VersNum.txt"
|
||||
$FileManIn = "Resources\manifest-original.xml"
|
||||
$FileManOut = "Resources\manifest.xml"
|
||||
$FileCLogIn = "Resources\ChangeLog-original.html"
|
||||
$FileCLogOut = "Resources\ChangeLog.html"
|
||||
$MajMin = Get-Content $FileMajMin # "6.14."
|
||||
$currentDate = get-date -format yyMM;
|
||||
$currentTime = get-date -format ddHH;
|
||||
$find = "<Version>(.|\n)*?</Version>";
|
||||
$currRelNum = $MajMin + $currentDate +"." + $currentTime
|
||||
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
|
||||
$csproj = Get-Content $ProjectPath
|
||||
$csprojUpdated = $csproj -replace $find, $replace
|
||||
|
||||
Set-Content -Path $ProjectPath -Value $csprojUpdated
|
||||
Set-Content -Path $FileVers -Value $currRelNum
|
||||
|
||||
# replace x manifest
|
||||
$manData = Get-Content $FileManIn
|
||||
$manData = $manData -replace "1.0.0.0", $currRelNum
|
||||
$manData = $manData -replace "{{DIRNAME}}", "LiMan"
|
||||
$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST"
|
||||
$manData = $manData -replace "{{PACKNAME}}", "LiMan.Transfer"
|
||||
Set-Content -Path $FileManOut -Value $manData
|
||||
|
||||
# replace x ChangeLog
|
||||
$clogData = Get-Content $FileCLogIn
|
||||
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
|
||||
Set-Content -Path $FileCLogOut -Value $clogData
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<Version>1.1.2202.0910</Version>
|
||||
<Version>1.1.2202.0907</Version>
|
||||
<RootNamespace>LiMan.UI</RootNamespace>
|
||||
<AssemblyName>LiMan.UI</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: 1.1.2202.0910</h4>
|
||||
<h4>Versione: 1.1.2202.0907</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2202.0910
|
||||
1.1.2202.0907
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2202.0910</version>
|
||||
<version>1.1.2202.0907</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user