forked from avniproject/avni-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avniproject/avni-webapp#1140 | Added Rest point to get external repor…
…ting system
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
avni-server-api/src/main/java/org/avni/server/web/ConfigurationController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.avni.server.web; | ||
|
||
import org.avni.server.web.util.Configuration; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class ConfigurationController { | ||
@Autowired | ||
private Configuration configuration; | ||
@GetMapping("/Config") | ||
public ResponseEntity<Configuration> getReportConfig(){ | ||
return ResponseEntity.ok(configuration); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
avni-server-api/src/main/java/org/avni/server/web/util/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.avni.server.web.util; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
@Component | ||
@ConfigurationProperties(prefix = "avni") | ||
public class Configuration { | ||
private List<ReportingSystem> reportingSystems; | ||
|
||
public List<ReportingSystem> getReportingSystems() { | ||
return reportingSystems; | ||
} | ||
|
||
public void setReportingSystems(List<ReportingSystem> reportingSystems) { | ||
this.reportingSystems = reportingSystems; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
avni-server-api/src/main/java/org/avni/server/web/util/ReportingSystem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.avni.server.web.util; | ||
|
||
public class ReportingSystem { | ||
private String name; | ||
private String url; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters