]> git.somenet.org - pub/jan/aic18.git/blob - service-reporting/README.md
Merge branch '32-camunda-reporting-input-format' into 'master'
[pub/jan/aic18.git] / service-reporting / README.md
1 # PDF Service
2
3 Provides a REST-API to generate PDF reports for terms and their sentiment analysis results. The service uses an .NET Core wrapper for the wkhtmltopdf library to generate pdf out of html code.
4
5 `GET`: `/` Shows a demo page  
6 - param: none
7 - return: pdf file
8
9 `POST`: `/generatePDF/` Generates a pdf report for the given terms
10 - Header: `Content-Type`: `application/json`  
11 (optional) `Accept`: `application/base64` if the pdf should be in base64 instead of `application/pdf`  
12 - Body of request: Term[] e.g.
13 ```json
14 [
15   {
16     "name": "term 1",
17     "sentiment": 0.1
18   },
19   {
20     "name": "term 2",
21     "sentiment": 0.3
22   },
23   {
24     "name": "term 3",
25     "sentiment": 0.7
26   }
27 ]
28 ``` 
29 - return: pdf file
30
31 ### Term model
32 Term(string `Name`, double `Sentiment`)
33
34 ## run with docker
35
36 - `docker build -t service-reporting .`    
37 - `docker run -p YOUR_PORT:8083 service-reporting:latest`
38
39 ## run local
40 ### requirements
41 - .net core 2.2
42 - download [libwkhtml library](https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4) depending on your operating system and put it into `service-reporting` root folder
43 ### commands
44 - `dotnet run`