Skip to content

Commit

Permalink
Merge pull request #21 from PSMRI/develop
Browse files Browse the repository at this point in the history
develop to master merge
  • Loading branch information
devikasuresh20 authored Feb 5, 2024
2 parents 2be3798 + bb14732 commit aba6f17
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ target/
#configs
config.service.ts
config.json
*.properties

#other
.springBeans
Expand All @@ -13,6 +12,7 @@ hs_err_pid7608.log
.classpath
/.sts4-cache
/logs
.idea

# Properties
src/main/environment/104_test.properties
src/main/environment/104_local.properties
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
58 changes: 48 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<final-name>104api-v1.0</final-name>
<environment>${ENV_VAR}</environment>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/104_${environment}.properties</source-properties>
<source-properties>target/classes/104_${environment}.properties</source-properties>
</properties>

<dependencies>
Expand Down Expand Up @@ -250,31 +250,69 @@
</plugin>

<plugin>


<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
<resources>
<resource>
<directory>src/main/environment</directory>
<filtering>true</filtering>
<includes>
<include>104_${environment}.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>

<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<id>properties-updated</id>
<id>merge-properties</id>
<configuration>
<target>
<echo>concatinating properties file ${target-properties} and
${source-properties}</echo>
<echo>
concatenating properties file ${target-properties} and
${source-properties}
</echo>
<concat destfile="${target-properties}" append="yes"
force="yes">
force="yes">
<fileset file="${source-properties}">
</fileset>
</concat>
</target>
</configuration>
</execution>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<id>clean-property-files</id>
<configuration>
<tasks>
<delete>
<file file="${source-properties}"/>
</delete>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -309,7 +347,7 @@
<properties>
<final-name>104api-v1.0</final-name>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/104_${environment}.properties</source-properties>
<source-properties>target/classes/104_${environment}.properties</source-properties>
</properties>
<build>
<finalName>104api-v1.0</finalName>
Expand Down
19 changes: 19 additions & 0 deletions src/main/environment/104_ci.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# local env
# DB Connections
## Primary db
spring.datasource.url=@env.DATABASE_URL@
spring.datasource.username=@env.DATABASE_USERNAME@
spring.datasource.password=@env.DATABASE_PASSWORD@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

secondary.datasource.username=@env.REPORTING_DATABASE_USERNAME@
secondary.datasource.password=@env.REPORTING_DATABASE_PASSWORD@
secondary.datasource.url=@env.REPORTING_DATABASE_URL@
secondary.datasource.driver-class-name=com.mysql.jdbc.Driver

# Common Config
common-url=@env.COMMON_API_BASE_URL@

### Redis IP
spring.redis.host=localhost

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.iemr.helpline104.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

public class BlockingHttpMethodInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String method = request.getMethod();
if (!("GET".equals(method) || "POST".equals(method))) {
response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
return false;
}
return true;
}

@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception {
// TODO Auto-generated method stub
}

@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
throws Exception {
// TODO Auto-generated method stub
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ public class InterceptorConfig extends WebMvcConfigurerAdapter
@Autowired
HTTPRequestInterceptor requestInterceptor;

// @Override
// public void addInterceptors(InterceptorRegistry registry)
// {
// registry.addInterceptor(requestInterceptor);
// }

@Override
public void addInterceptors(InterceptorRegistry registry)
{
registry.addInterceptor(requestInterceptor);
registry.addInterceptor(new BlockingHttpMethodInterceptor())
.addPathPatterns("/**");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104appetite;

@Repository
@RestResource(exported = false)
public interface M_104appetiteRepo extends CrudRepository<M_104appetite, Integer> {
List<M_104appetite> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104bladder;

@Repository
@RestResource(exported = false)
public interface M_104bladderRepo extends CrudRepository<M_104bladder, Integer> {
List<M_104bladder> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104bowel;

@Repository
@RestResource(exported = false)
public interface M_104bowelRepo extends CrudRepository<M_104bowel, Integer> {
List<M_104bowel> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104course;

@Repository
@RestResource(exported = false)
public interface M_104courseRepo extends CrudRepository<M_104course, Integer> {
List<M_104course> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104familycondition;

@Repository
@RestResource(exported = false)
public interface M_104familyconditionRepo extends CrudRepository<M_104familycondition, Integer> {
List<M_104familycondition> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104gettingwithfamily;

@Repository
@RestResource(exported = false)
public interface M_104gettingwithfamilyRepo extends CrudRepository<M_104gettingwithfamily, Integer> {
List<M_104gettingwithfamily> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104householdwork;

@Repository
@RestResource(exported = false)
public interface M_104householdworkRepo extends CrudRepository<M_104householdwork, Integer> {
List<M_104householdwork> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104hygieneselfcare;

@Repository
@RestResource(exported = false)
public interface M_104hygieneselfcareRepo extends CrudRepository<M_104hygieneselfcare, Integer> {
List<M_104hygieneselfcare> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104issuesatworkplace;

@Repository
@RestResource(exported = false)
public interface M_104issuesatworkplaceRepo extends CrudRepository<M_104issuesatworkplace, Integer> {
List<M_104issuesatworkplace> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104libido;

@Repository
@RestResource(exported = false)
public interface M_104libidoRepo extends CrudRepository<M_104libido, Integer> {
List<M_104libido> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104pastmedicalcondition;

@Repository
@RestResource(exported = false)
public interface M_104pastmedicalconditionRepo extends CrudRepository<M_104pastmedicalcondition, Integer> {
List<M_104pastmedicalcondition> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104pastpsychiatriccondition;

@Repository
@RestResource(exported = false)
public interface M_104pastpsychiatricconditionRepo extends CrudRepository<M_104pastpsychiatriccondition, Integer> {
List<M_104pastpsychiatriccondition> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104precipitatingfactor;

@Repository
@RestResource(exported = false)
public interface M_104precipitatingfactorRepo extends CrudRepository<M_104precipitatingfactor, Integer> {
List<M_104precipitatingfactor> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.stereotype.Repository;

import com.iemr.helpline104.data.hihl.M_104progress;

@Repository
@RestResource(exported = false)
public interface M_104progressRepo extends CrudRepository<M_104progress, Integer> {
List<M_104progress> findByDeleted(Boolean deleted);
}
Loading

0 comments on commit aba6f17

Please sign in to comment.