Skip to content
Snippets Groups Projects
Commit a13bd122 authored by Sascha Herzinger's avatar Sascha Herzinger Committed by Piotr Gawron
Browse files

Expanded API with /minervanet/submitError

parent 278628ea
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!589Feature error reporting
package lcsb.mapviewer.api.minervanet;
import java.time.Instant;
public class ErrorReport {
private String url;
private String login;
private String email;
private String browser;
private Instant timestamp;
private String stacktrace;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getBrowser() {
return browser;
}
public void setBrowser(String browser) {
this.browser = browser;
}
public Instant getTimestamp() {
return timestamp;
}
public void setTimestamp(Instant timestamp) {
this.timestamp = timestamp;
}
public String getStacktrace() {
return stacktrace;
}
public void setStacktrace(String stacktrace) {
this.stacktrace = stacktrace;
}
}
package lcsb.mapviewer.api.minervanet;
import lcsb.mapviewer.api.BaseController;
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.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/minervanet")
public class MinervaNetController extends BaseController {
private IConfigurationService configurationService;
private static HttpClient httpClient = HttpClients.createDefault();
@Autowired
public MinervaNetController(IConfigurationService configurationService) {
this.configurationService = configurationService;
}
@PostMapping(value = "/submitError")
public void submitError(ErrorReport report) {
String server = configurationService.getValue(ConfigurationElementType.MINERVANET_URL).getValue();
HttpPost httpPost = new HttpPost(server);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment