Done changes related to instructor dashboard API
This commit is contained in:
@@ -20,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
public interface DashboardApi {
|
||||
|
||||
@@ -107,7 +108,7 @@ public interface DashboardApi {
|
||||
@GetMapping(value = "/instructor/amendment",
|
||||
produces = { "application/json" })
|
||||
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
|
||||
ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request);
|
||||
ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request, @Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -75,12 +75,12 @@ public class DashboardApiController implements DashboardApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request) {
|
||||
public ResponseEntity<Response<PreInstructorWidgetResponseBean>> getDashboardWidgetForPreInstructor(HttpServletRequest request,Long userId) {
|
||||
|
||||
/** This code is responsible for creating user action logs for the "Get dashboard stats widget for amendment page" operation. **/
|
||||
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_DASHBOARD_WIDGET_FOR_PRE_INSTRUCTOR).build());
|
||||
|
||||
PreInstructorWidgetResponseBean widgetResponseBean= dashboardService.getDashboardWidgetForPreInstructor(request);
|
||||
PreInstructorWidgetResponseBean widgetResponseBean= dashboardService.getDashboardWidgetForPreInstructor(request,userId);
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(widgetResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.DASHBOARD_WIDGET_FETCHED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user