-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AMM-1140 | API for fetching unallocated grievance record count for al…
…location screen (#152) * adding changes related to encryption and decryption * making final field static * making enclosing method static * adding beneficiaryConsent param to createFeedback API * Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * adding beneficiary consent param feedbacklist response * adding space * adding code for schedule for grievance data sync * adding code rabbit code suggestions * adding code rabbit suggestions * code rabbit suggested changes to Model classes * adding sonar quality changes * adding sonar quality code suggestions * adding sonar quality check suggestions * adding code rabbit suggestions * adding constant instead of duplicate literals * adding cod changs to fetch unallocated grievance count * adding changes suggested by sonar quality check * adding code rabbit suggested changes * fixing config file * fixing space * fixing space issue * adding package for PrimaryDBConfig --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a89a605
commit 27a71ab
Showing
5 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
src/main/java/com/iemr/common/controller/grievance/GrievanceController.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,56 @@ | ||
package com.iemr.common.controller.grievance; | ||
|
||
|
||
import com.iemr.common.service.grievance.GrievanceDataSync; | ||
import com.iemr.common.utils.exception.IEMRException; | ||
import com.iemr.common.utils.response.OutputResponse; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
|
||
|
||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.json.JSONException; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.CrossOrigin; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class GrievanceController { | ||
final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); | ||
|
||
|
||
private GrievanceDataSync grievanceDataSync; | ||
|
||
@Autowired | ||
public GrievanceController(GrievanceDataSync grievanceDataSync) { | ||
this.grievanceDataSync = grievanceDataSync; | ||
} | ||
|
||
@CrossOrigin() | ||
@Operation(summary = "/unallocatedGrievanceCount") | ||
@PostMapping(value = "/unallocatedGrievanceCount", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization") | ||
public String fetchUnallocatedGrievanceCount() { | ||
OutputResponse responseData = new OutputResponse(); | ||
try { | ||
responseData.setResponse(grievanceDataSync.fetchUnallocatedGrievanceCount()); | ||
} | ||
catch (IEMRException e) { | ||
logger.error("Business logic error in UnallocatedGrievanceCount" + e.getMessage(), e); | ||
responseData.setError(e); | ||
} | ||
catch (JSONException e) { | ||
logger.error("JSON processing error in UnallocatedGrievanceCount" + e.getMessage(), e); | ||
responseData.setError(e); | ||
} | ||
catch (Exception e) { | ||
logger.error("UnallocatedGrievanceCount failed with error" + e.getMessage(), e); | ||
responseData.setError(e); | ||
} | ||
return responseData.toString(); | ||
|
||
} | ||
} |
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
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
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