Skip to content

Commit 27a6305

Browse files
authored
Merge pull request #86 from srishtigrp78/develop
Shifting commonAPI URL properties to common_ci from application.properties
2 parents 6a4cc05 + 9719a49 commit 27a6305

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/main/environment/common_ci.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ spring.datasource.url=@env.DATABASE_URL@
22
spring.datasource.username=@env.DATABASE_USERNAME@
33
spring.datasource.password=@env.DATABASE_PASSWORD@
44
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
5-
common-api-url=@env.COMMON_API@
5+
6+
common-api-url-searchuserbyid=@env.COMMON_API@beneficiary/searchUserByID
7+
common-api-url-searchBeneficiary=@env.COMMON_API@beneficiary/searchBeneficiary
8+
69
callcentre-server-ip=@env.CALLCENTRE_SERVER_IP@
710
### Redis IP
811
spring.data.redis.host=localhost

src/main/environment/common_example.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ spring.profiles.active=test
88
callcentre-server-ip=10.208.122.99
99
common-api-url=http://localhost:8083/
1010

11+
12+
common-api-url-searchuserbyid=http://localhost:8083/beneficiary/searchUserByID
13+
common-api-url-searchBeneficiary=http://localhost:8083/beneficiary/searchBeneficiary
14+
1115
### Redis IP
1216
spring.data.redis.host=localhost
1317
jwt.secret=my-32-character-ultra-secure-and-ultra-long-secret

src/main/java/com/iemr/inventory/service/visit/VisitServiceImpl.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public class VisitServiceImpl implements VisitService {
6565
Logger logger = LoggerFactory.getLogger(this.getClass().getName());
6666
private static HttpUtils httpUtils = new HttpUtils();
6767
private InputMapper inputMapper = new InputMapper();
68-
private String identityBaseURL = ConfigProperties.getPropertyByName("common-api-url");
69-
private static final String COMMON_BASE_URL = "COMMON_BASE_URL";
68+
7069

7170
@Override
7271
public BeneficiaryModel getVisitDetail(String benrID, Integer providerservicemapID, String auth) throws Exception {
@@ -109,8 +108,7 @@ public List<BeneficiaryModel> getBeneficiaryListByIDs(String benrID, String auth
109108
String jwtTokenFromCookie = cookieUtil.getJwtTokenFromCookie(requestHeader);
110109
header.put("Cookie", "Jwttoken=" + jwtTokenFromCookie);
111110

112-
result = httpUtils.post(ConfigProperties.getPropertyByName("common-api-url-searchuserbyid")
113-
.replace(COMMON_BASE_URL, identityBaseURL), benrID, header);
111+
result = httpUtils.post(ConfigProperties.getPropertyByName("common-api-url-searchuserbyid"), benrID, header);
114112
OutputResponse identityResponse = inputMapper.gson().fromJson(result, OutputResponse.class);
115113
if (identityResponse.getStatusCode() != 200) {
116114
throw new InventoryException("Invalid BeneficiaryID");
@@ -145,8 +143,7 @@ public List<BeneficiaryModel> getBeneficiaryListBySearch(String benrID, String a
145143
String jwtTokenFromCookie = cookieUtil.getJwtTokenFromCookie(requestHeader);
146144
header.put("Cookie", "Jwttoken=" + jwtTokenFromCookie);
147145

148-
result = httpUtils.post(ConfigProperties.getPropertyByName("common-api-url-searchBeneficiary")
149-
.replace(COMMON_BASE_URL, identityBaseURL), benrID, header);
146+
result = httpUtils.post(ConfigProperties.getPropertyByName("common-api-url-searchBeneficiary"), benrID, header);
150147
OutputResponse identityResponse = inputMapper.gson().fromJson(result, OutputResponse.class);
151148
if (identityResponse.getStatusCode() == OutputResponse.USERID_FAILURE) {
152149
throw new IEMRException(identityResponse.getErrorMessage());

src/main/resources/application.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ logging.level.com.iemr=DEBUG
2323

2424
spring.jpa.show-sql=true
2525
enableCTIUserCreation=true
26-
common-api-url-searchuserbyid=COMMON_BASE_URLbeneficiary/searchUserByID
27-
common-api-url-searchBeneficiary=COMMON_BASE_URLbeneficiary/searchBeneficiary
26+
2827

2928
spring.main.allow-bean-definition-overriding=true
3029

0 commit comments

Comments
 (0)