-
Couldn't load subscription status.
- Fork 37
HCMPRE-2701: Creating root boundary node #1567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: geopode-adapter-dev
Are you sure you want to change the base?
Changes from all commits
97ed08e
1756afe
e466dc6
0349a20
29dd8ee
b537778
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Swagger generated server | ||
|
|
||
| Spring Boot Server | ||
|
|
||
|
|
||
| ## Overview | ||
| This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. | ||
| By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. | ||
| This is an example of building a swagger-enabled server in Java using the SpringBoot framework. | ||
|
|
||
| The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox) | ||
|
|
||
| Start your server as an simple java application | ||
|
|
||
| You can view the api documentation in swagger-ui by pointing to | ||
| http://localhost:8080/ | ||
|
|
||
| Change default port value in application.properties | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <groupId>org.egov</groupId> | ||
| <artifactId>geopode-adapter</artifactId> | ||
| <packaging>jar</packaging> | ||
| <name>geopode-adapter</name> | ||
| <version>1.0.0</version> | ||
| <properties> | ||
| <java.version>17</java.version> | ||
| <maven.compiler.source>${java.version}</maven.compiler.source> | ||
| <maven.compiler.target>${java.version}</maven.compiler.target> | ||
| </properties> | ||
| <parent> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>3.2.2</version> | ||
| </parent> | ||
| <build> | ||
| <sourceDirectory>src/main/java</sourceDirectory> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>repackage</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-web</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <version>4.13.2</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-jdbc</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.flywaydb</groupId> | ||
| <artifactId>flyway-core</artifactId> | ||
| <version>9.22.3</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.postgresql</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <version>42.7.1</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-test</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>io.swagger</groupId> | ||
| <artifactId>swagger-core</artifactId> | ||
| <version>1.5.18</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.swagger.core.v3</groupId> | ||
| <artifactId>swagger-annotations</artifactId> | ||
| <version>2.2.8</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>net.minidev</groupId> | ||
| <artifactId>json-smart</artifactId> | ||
| <version>2.5.0</version> | ||
| </dependency> | ||
| <!-- Egov dependencies --> | ||
| <dependency> | ||
| <groupId>org.egov.services</groupId> | ||
| <artifactId>tracer</artifactId> | ||
| <version>2.9.0-SNAPSHOT</version> | ||
| </dependency> | ||
| <!-- <dependency>--> | ||
| <!-- <groupId>org.egov.services</groupId>--> | ||
| <!-- <artifactId>digit-models</artifactId>--> | ||
| <!-- <version>1.0.0-SNAPSHOT</version>--> | ||
| <!-- </dependency>--> | ||
| <dependency> | ||
| <groupId>org.egov</groupId> | ||
| <artifactId>mdms-client</artifactId> | ||
| <version>2.9.0-SNAPSHOT</version> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.projectlombok</groupId> | ||
| <artifactId>lombok</artifactId> | ||
| <optional>true</optional> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.datatype</groupId> | ||
| <artifactId>jackson-datatype-jsr310</artifactId> | ||
| </dependency> | ||
| <!-- Bean Validation API support --> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-validation</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
| <repositories> | ||
| <repository> | ||
| <id>repo.egovernments.org</id> | ||
| <name>eGov ERP Releases Repository</name> | ||
| <url>https://nexus-repo.egovernments.org/nexus/content/repositories/releases/</url> | ||
| </repository> | ||
| <repository> | ||
| <id>repo.egovernments.org.snapshots</id> | ||
| <name>eGov ERP Releases Repository</name> | ||
| <url>https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/</url> | ||
| </repository> | ||
| <repository> | ||
| <id>repo.egovernments.org.public</id> | ||
| <name>eGov Public Repository Group</name> | ||
| <url>https://nexus-repo.egovernments.org/nexus/content/groups/public/</url> | ||
| </repository> | ||
| <repository> | ||
| <id>repo.digit.org</id> | ||
| <name>eGov DIGIT Releases Repository</name> | ||
| <url>https://nexus-repo.digit.org/nexus/content/repositories/snapshots/</url> | ||
| </repository> | ||
| </repositories> | ||
| </project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package digit; | ||
|
|
||
| import org.egov.tracer.config.TracerConfiguration; | ||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| import org.springframework.context.annotation.ComponentScan; | ||
| import org.springframework.context.annotation.Import; | ||
|
|
||
| @Import({ TracerConfiguration.class }) | ||
| @SpringBootApplication | ||
| @ComponentScan(basePackages = { "digit", "digit.web.controllers" , "digit.config"}) | ||
abishekTa-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public class Main { | ||
| public static void main(String[] args) throws Exception { | ||
| SpringApplication.run(Main.class, args); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| package digit.config; | ||
|
|
||
| import lombok.*; | ||
| import org.egov.tracer.config.TracerConfiguration; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Import; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| @Data | ||
| @Import({TracerConfiguration.class}) | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
|
|
||
| public class Configuration { | ||
|
|
||
| //MDMS | ||
| @Value("${egov.mdms.host}") | ||
| private String mdmsHost; | ||
|
|
||
| @Value("${egov.mdms.search.endpoint}") | ||
| private String mdmsEndPoint; | ||
|
|
||
| //Boundary Service | ||
| @Value("${egov.boundary.service.host}") | ||
| private String boundaryServiceHost; | ||
|
|
||
| @Value("${egov.boundary.entity.create.endpoint}") | ||
| private String boundaryEntityCreateEndpoint; | ||
|
|
||
| @Value("${egov.boundary.hierarchy.create.endpoint}") | ||
| private String boundaryHierarchyCreateEndpoint; | ||
|
|
||
| @Value("${egov.boundary.relationship.create.endpoint}") | ||
| private String boundaryRelationshipCreateEndpoint; | ||
|
|
||
| @Value("${egov.boundary.hierarchy.search.endpoint}") | ||
| private String boundaryHierarchySearchEndpoint; | ||
|
|
||
| @Value("${geopode.arcgis}") | ||
| private String arcgisEndpoint; | ||
|
|
||
| @Value("${egov.mdms.v2.search.endpoint}") | ||
| private String mdmsV2EndPoint; | ||
|
|
||
| @Value("${geopode.default.offset}") | ||
| private String defaultOffset; | ||
|
|
||
| @Value("${geopode.default.limit}") | ||
| private String defaultLimit; | ||
|
|
||
| @Value("${egov.mdms.tenantId}") | ||
| private String tenantId; | ||
|
|
||
| @Value("${egov.mdms.schemaCode}") | ||
| private String schemaCode; | ||
|
|
||
| @Value("${geopode.localHost}") | ||
| private String geopodeLocalHost; | ||
|
|
||
| @Value("${geopode.arcgis.search}") | ||
| private String geopodeSearchEndpoint; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| package digit.config; | ||
|
|
||
|
|
||
| import org.springframework.stereotype.Component; | ||
|
|
||
|
|
||
| @Component | ||
| public class ServiceConstants { | ||
abishekTa-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public static final String EXTERNAL_SERVICE_EXCEPTION = "External Service threw an Exception: "; | ||
| public static final String SEARCHER_SERVICE_EXCEPTION = "Exception while fetching from searcher: "; | ||
|
|
||
| // Error Constants | ||
| public static final String ERROR_WHILE_FETCHING_FROM_MDMS = "Exception occurred while fetching category lists from mdms: "; | ||
|
|
||
| public static final String ERROR_CREATING_BOUNDARY_HIERARCHY_WITH_GIVEN_HIERARCHY = "Error encountered while creating boundary hierarchy with given hierarchy "; | ||
|
|
||
| // Common constants | ||
| public static final String BOUNDARY_CREATION_RESPONSE = "GeoPoDe Boundary Creation started successfully!"; | ||
| public static final String LOG_PLACEHOLDER = "{}"; | ||
|
|
||
| public static final String[] HIERARCHY_ORDER = { "ADM0_NAME", "ADM1_NAME", "ADM2_NAME", "ADM3_NAME" }; | ||
| public static final String ERROR_IN_SEARCH="Error when fetching from Boundary-definition"; | ||
| public static final String ERROR_IN_ARC_SEARCH="Error when fetching from Arcgis"; | ||
| public static final String HIERARCHY_TYPE = "admin4"; | ||
| public static final String ERROR_FETCHING_FROM_MDMS="Error Fetching Data from mdms"; | ||
| public static final String NO_MDMS_DATA_FOUND_FOR_GIVEN_TENANT_ISO_CODE="For given tenantId and ISO code no country exists"; | ||
| public static final String COUNTRY_OUTFIELDS="ADM1_NAME"; | ||
| public static final String FORMAT_VALUE="json"; | ||
| public static final String ERROR_FETCHING_FROM_BOUNDARY="Error Fetching Data from boundary"; | ||
| public static final String ROOT_BOUNDARY_ALREADY_EXISTS="Root Boundary already created"; | ||
| public static final String MDMS_ISO_CODE ="isoCode"; | ||
| public static final String MDMS_NAME="name"; | ||
| public static final String RESPONSE_FROM_GEOPODE_API = "[\n" + | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be fetched from boundary-service heirarchy There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When call is being made to boundary, service and error comes, I use these constants in the catch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is error coming? |
||
| " {\n" + | ||
| " \"feature\": \"admin_0\",\n" + | ||
| " \"type_code\": \"Country\",\n" + | ||
| " \"level\": 0,\n" + | ||
| " \"parent\": null\n" + | ||
| " },\n" + | ||
| " {\n" + | ||
| " \"feature\": \"admin_1\",\n" + | ||
| " \"type_code\": \"State\",\n" + | ||
| " \"level\": 1,\n" + | ||
| " \"parent\": \"Country\"\n" + | ||
| " },\n" + | ||
| " {\n" + | ||
| " \"feature\": \"admin_2\",\n" + | ||
| " \"type_code\": \"LGA\",\n" + | ||
| " \"level\": 2,\n" + | ||
| " \"parent\": \"State\"\n" + | ||
| " },\n" + | ||
| " {\n" + | ||
| " \"feature\": \"admin_3\",\n" + | ||
| " \"type_code\": \"Ward\",\n" + | ||
| " \"level\": 3,\n" + | ||
| " \"parent\": \"LGA\"\n" + | ||
| " }\n" + | ||
| "]"; | ||
abishekTa-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package digit.kafka; | ||
|
|
||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.egov.tracer.kafka.CustomKafkaTemplate; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| // NOTE: If tracer is disabled change CustomKafkaTemplate to KafkaTemplate in autowiring | ||
abishekTa-egov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @Service | ||
| @Slf4j | ||
| public class Producer { | ||
|
|
||
| private CustomKafkaTemplate<String, Object> kafkaTemplate; | ||
|
|
||
| public void push(String topic, Object value) { | ||
| kafkaTemplate.send(topic, value); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.