Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
14f0ec9e
Commit
14f0ec9e
authored
6 years ago
by
Sascha Herzinger
Committed by
Piotr Gawron
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added code that sends report to minervanet
parent
d20d0a1c
No related branches found
No related tags found
2 merge requests
!630
WIP: Resolve "The privileges of a new user are not saved in some cases"
,
!589
Feature error reporting
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rest-api/src/main/java/lcsb/mapviewer/api/minervanet/MinervaNetController.java
+13
-3
13 additions, 3 deletions
...a/lcsb/mapviewer/api/minervanet/MinervaNetController.java
with
13 additions
and
3 deletions
rest-api/src/main/java/lcsb/mapviewer/api/minervanet/MinervaNetController.java
+
13
−
3
View file @
14f0ec9e
package
lcsb.mapviewer.api.minervanet
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lcsb.mapviewer.model.user.ConfigurationElementType
;
import
lcsb.mapviewer.services.interfaces.IConfigurationService
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
@RestController
@RequestMapping
(
"/minervanet"
)
public
class
MinervaNetController
{
private
IConfigurationService
configurationService
;
private
static
HttpClient
httpClient
=
HttpClients
.
createDefault
();
@Autowired
public
MinervaNetController
(
IConfigurationService
configurationService
)
{
...
...
@@ -21,9 +24,16 @@ public class MinervaNetController {
}
@PostMapping
(
value
=
"/submitError"
)
public
void
submitError
(
@RequestBody
ErrorReport
report
)
{
public
void
submitError
(
@RequestBody
ErrorReport
report
)
throws
IOException
{
ObjectMapper
mapper
=
new
ObjectMapper
();
String
jsonReport
=
mapper
.
writeValueAsString
(
report
);
String
server
=
configurationService
.
getValue
(
ConfigurationElementType
.
MINERVANET_URL
).
getValue
();
HttpPost
httpPost
=
new
HttpPost
(
server
);
httpPost
.
setHeader
(
"Content-Type"
,
"application/json"
);
httpPost
.
setEntity
(
new
StringEntity
(
jsonReport
));
try
(
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
())
{
httpClient
.
execute
(
httpPost
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment