-
-
Notifications
You must be signed in to change notification settings - Fork 967
SAK-51413 webapi add endpoints to retrieve assessment scheduled data #13651
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: master
Are you sure you want to change the base?
Conversation
|
||
// Main query to retrieve site data using date range and limit/offset for pagination | ||
// The parameters returned are SITE_ID, TITLE, CREATEDON, MODIFIEDON, and SOFTLY_DELETED_DATE | ||
String query = "SELECT SITE_ID, TITLE, CREATEDON, MODIFIEDON, SOFTLY_DELETED_DATE " + |
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.
Use the site service for this.
@Autowired | ||
private UserDirectoryService userDirectoryService; | ||
|
||
@GetMapping(value = "/assessment/scheduled", produces = MediaType.APPLICATION_JSON_VALUE) |
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.
If this is Samigo stuff, it should not be in the SitesController.
conn.setReadOnly(true); | ||
|
||
// Set date parameters and retrieve total elements | ||
countPs = conn.prepareStatement(countQuery); |
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.
We don't need to do raw JDBC code in Sakai. We have the sqlService and Hibernate. Hibernate is the way to do it. And, generally, you should do db code in backend service and make sure to write unit tests for it.
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.
Completely agree putting in raw jdbc code bypasses hibernate, you should fetch this information using the service
https://sakaiproject.atlassian.net/browse/SAK-51413