1
1
package ca .bc .gov .restapi .results .oracle .endpoint ;
2
2
3
3
import ca .bc .gov .restapi .results .oracle .service .OpeningTrendsService ;
4
- import ca .bc .gov .restapi .results .oracle .service .UserActionsService ;
5
- import ca .bc .gov .restapi .results .postgres .dto .MyRecentActionsRequestsDto ;
6
4
import ca .bc .gov .restapi .results .postgres .dto .OpeningsPerYearDto ;
7
5
import java .time .LocalDate ;
8
6
import java .util .List ;
20
18
@ Slf4j
21
19
public class UserActionsEndpoint {
22
20
23
- private final UserActionsService userActionsService ;
24
21
private final OpeningTrendsService openingTrendsService ;
25
22
26
- @ GetMapping ("/recent-actions" )
27
- public ResponseEntity <List <MyRecentActionsRequestsDto >> getUserRecentOpeningsActions () {
28
- List <MyRecentActionsRequestsDto > actionsDto =
29
- userActionsService .getResultsAuditActivity ();
30
-
31
- log .info ("Returning {} recent actions" , actionsDto .size ());
32
-
33
- if (actionsDto .isEmpty ()) {
34
- return ResponseEntity .noContent ().build ();
35
- }
36
-
37
- return ResponseEntity .ok (actionsDto );
38
- }
39
-
40
23
/**
41
24
* Gets data for the Opening submission trends Chart (Openings per year) on the Dashboard SILVA
42
25
* page.
@@ -59,12 +42,11 @@ public ResponseEntity<List<OpeningsPerYearDto>> getOpeningsSubmissionTrends(
59
42
LocalDate entryDateEnd
60
43
) {
61
44
62
- LocalDate endDate = getDateOrDefault (entryDateEnd ,LocalDate .now ());
63
- LocalDate startDate = getDateOrDefault (entryDateStart ,endDate .minusYears (1 ));
64
-
45
+ LocalDate endDate = getDateOrDefault (entryDateEnd , LocalDate .now ());
46
+ LocalDate startDate = getDateOrDefault (entryDateStart , endDate .minusYears (1 ));
65
47
66
48
List <OpeningsPerYearDto > resultList =
67
- openingTrendsService .getOpeningSubmissionTrends (startDate , endDate ,orgUnits ,statusCodes );
49
+ openingTrendsService .getOpeningSubmissionTrends (startDate , endDate , orgUnits , statusCodes );
68
50
69
51
if (resultList .isEmpty ()) {
70
52
return ResponseEntity .noContent ().build ();
0 commit comments