-
Notifications
You must be signed in to change notification settings - Fork 32
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
AMM-1140 | API for fetching unallocated grievance record count for allocation screen #152
Merged
ravishanigarapu
merged 28 commits into
PSMRI:develop
from
srishtigrp78:feature/version/upgrade
Jan 22, 2025
Merged
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a7a9518
adding changes related to encryption and decryption
e1b5318
making final field static
eddabe3
making enclosing method static
6e626bb
adding beneficiaryConsent param to createFeedback API
6cf8550
Merge pull request #6 from PSMRI/develop
srishtigrp78 2303d60
Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java
srishtigrp78 68d0483
Merge pull request #7 from PSMRI/develop
srishtigrp78 b7718c0
adding beneficiary consent param feedbacklist response
f9feef6
adding space
019d315
Merge pull request #8 from PSMRI/develop
srishtigrp78 507f830
Merge pull request #9 from PSMRI/develop
srishtigrp78 21be52e
adding code for schedule for grievance data sync
0a90728
adding code rabbit code suggestions
ea9ff9e
adding code rabbit suggestions
8825473
code rabbit suggested changes to Model classes
2d639c4
adding sonar quality changes
b0e039b
adding sonar quality code suggestions
9831500
adding sonar quality check suggestions
5cb6886
adding code rabbit suggestions
9e8e1f2
adding constant instead of duplicate literals
67b2f86
Merge pull request #10 from PSMRI/develop
srishtigrp78 7b3b990
adding cod changs to fetch unallocated grievance count
d834aa9
adding changes suggested by sonar quality check
734551a
adding code rabbit suggested changes
47ceb56
fixing config file
f26b8ff
fixing space
d3534d9
fixing space issue
6b58965
adding package for PrimaryDBConfig
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restrict CORS and add rate limiting.
The unrestricted
@CrossOrigin()
annotation could pose a security risk. Consider:Apply this diff:
Add to application.properties:
app.allowed-origins=https://example.com,https://admin.example.com