Commit 8c790deb by 施晓雨

1

parent add1d346
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Kivii.Common.V4.0, Version=5.5.2020.6060, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Common.V4.0, Version=5.5.2020.7000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Kivii.Common.5.5.2020.6060\lib\net40\Kivii.Common.V4.0.dll</HintPath> <HintPath>packages\Kivii.Common.5.5.2020.7000\lib\net40\Kivii.Common.V4.0.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Kivii.Pdf.V4.0, Version=5.5.2020.6260, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Pdf.V4.0, Version=5.5.2020.7000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Kivii.Pdf.5.5.2020.6260\lib\net40\Kivii.Pdf.V4.0.dll</HintPath> <HintPath>packages\Kivii.Pdf.5.5.2020.7000\lib\net40\Kivii.Pdf.V4.0.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
......
...@@ -6,8 +6,18 @@ using System.Text; ...@@ -6,8 +6,18 @@ using System.Text;
namespace Kivii.Pdf.Test namespace Kivii.Pdf.Test
{ {
[Route("/Pdf/Stamper")] [Route("/Pdf/Stamper")]
public class StamperRequest:IReturn<object> public class StamperRequest:IReturn<StamperResponse>
{ {
public List<StampSetting> Settings { get; set; } public List<StampSetting> Settings { get; set; }
public string OpenFilePath { get; set; }
[ApiMember(Description = "执行成功后保存的文件路径")]
public string SaveFilePath { get; set; }
}
public class StamperResponse
{
public bool Succeed { get; set; }
public string DownloadFilePath { get; set; }
} }
} }
...@@ -187,15 +187,32 @@ namespace Kivii.Pdf.Test ...@@ -187,15 +187,32 @@ namespace Kivii.Pdf.Test
private void btnStampByService_Click(object sender, EventArgs e) private void btnStampByService_Click(object sender, EventArgs e)
{ {
try
{
var setting = getSetting(); var setting = getSetting();
var client = new JsonServiceClient(tbxServiceUrl.Text); var client = new JsonServiceClient("http://localhost");
var request = new StamperRequest(); var request = new StamperRequest();
request.SaveFilePath = $"/Storages/Pdf/test_{setting.StampType.ToString()}.pdf";
request.OpenFilePath = "/Storages/Pdf/Test/test.pdf";
request.Settings = new List<StampSetting>(); request.Settings = new List<StampSetting>();
request.Settings.Add(setting); request.Settings.Add(setting);
var files = new List<UploadFile>(); //var files = new List<UploadFile>();
files.Add(new UploadFile("A", new FileStream(tbxStampFilePath.Text,FileMode.Open), "StampFilePath")); //files.Add(new UploadFile("a.pdf", new FileStream(tbxPdfFilePath.Text,FileMode.Open)));
setting.StampFilePath = "/Storages/pdf/Stamp_CN_JST_V1.png";
var rtns=client.PostFilesWithRequest<object>("/Pdf/Stamper",request, files); //if (!setting.StampFilePath.IsNullOrEmpty())
//{
// files.Add(new UploadFile(Path.GetFileName(setting.StampFilePath), new FileStream(setting.StampFilePath, FileMode.Open)));
// setting.StampFilePath = Path.GetFileName(setting.StampFilePath);
//}
//if (!setting.SignatureFilePath.IsNullOrEmpty())
//{
// files.Add(new UploadFile(Path.GetFileName(setting.SignatureFilePath), new FileStream(setting.SignatureFilePath, FileMode.Open)));
// setting.SignatureFilePath = Path.GetFileName(setting.SignatureFilePath);
//}
//var rtns = client.PostFilesWithRequest<StamperResponse>(request, files);
var rtns = client.Post(request);
}
catch { }
} }
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Kivii.Common" version="5.5.2020.6060" targetFramework="net40" /> <package id="Kivii.Common" version="5.5.2020.7000" targetFramework="net40" />
<package id="Kivii.Pdf" version="5.5.2020.6260" targetFramework="net40" /> <package id="Kivii.Pdf" version="5.5.2020.7000" targetFramework="net40" />
</packages> </packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment