Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jumarub
Copy link
Contributor

@jumarub jumarub commented Apr 24, 2025


// 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 " +
Copy link
Contributor

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)
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@ern ern Apr 24, 2025

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

@ern ern changed the title SAK-51413 New API endpoints for retrieve scheduled data SAK-51413 webapi add endpoints to retrieve assessment scheduled data Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants