Class EventServiceMain
java.lang.Object
com.endurancetrio.business.event.service.EventServiceMain
- All Implemented Interfaces:
EventService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEventOverview(Long id, int year) Returns anEventOverviewDTOcontaining the summary details of the event identified by the givenidand belonging to the givenyear, including its organizers and races.getEventsByYear(int year, org.springframework.data.domain.Pageable pageable) Returns anEventsPageDTOcontaining theeventswhose start date falls within the givenyear, ordered by start date descending and paginated according to the givenPageable.Returns a list of all distinct years extracted from the events' start dates, ordered descending.getMostRecentAddedEvents(org.springframework.data.domain.Pageable pageable) Returns anEventsPageDTOcontaining the most recently addedevents, ordered by their creation timestamp descending.
-
Constructor Details
-
EventServiceMain
-
-
Method Details
-
getEventYears
Description copied from interface:EventServiceReturns a list of all distinct years extracted from the events' start dates, ordered descending. This is used byYearsWithEventsDTOto drive the year-browser pagination on the events landing page.- Specified by:
getEventYearsin interfaceEventService- Returns:
- a list of distinct event years in descending order
-
getEventsByYear
@Transactional(readOnly=true) public EventsPageDTO getEventsByYear(int year, org.springframework.data.domain.Pageable pageable) Description copied from interface:EventServiceReturns anEventsPageDTOcontaining theeventswhose start date falls within the givenyear, ordered by start date descending and paginated according to the givenPageable.- Specified by:
getEventsByYearin interfaceEventService- Parameters:
year- the year to filter events bypageable- the pagination information (page number, page size, etc.)- Returns:
- an
EventsPageDTOwith the events for the given year and pagination metadata
-
getEventOverview
@Cacheable(value="eventOverview", key="#id + \'-\' + #year") @Transactional(readOnly=true) public EventOverviewDTO getEventOverview(Long id, int year) Description copied from interface:EventServiceReturns anEventOverviewDTOcontaining the summary details of the event identified by the givenidand belonging to the givenyear, including its organizers and races.- Specified by:
getEventOverviewin interfaceEventService- Parameters:
id- the unique identifier of the eventyear- the year the event belongs to- Returns:
- an
EventOverviewDTOwith the event overview
-
getMostRecentAddedEvents
@Cacheable(value="mostRecentAddedEvents", key="#pageable.pageNumber + \'-\' + #pageable.pageSize") @Transactional(readOnly=true) public EventsPageDTO getMostRecentAddedEvents(org.springframework.data.domain.Pageable pageable) Description copied from interface:EventServiceReturns anEventsPageDTOcontaining the most recently addedevents, ordered by their creation timestamp descending. Courses are eagerly fetched to derive sport codes without additional queries.- Specified by:
getMostRecentAddedEventsin interfaceEventService- Parameters:
pageable- the pagination information; usePageRequest.of(0, limit)to retrieve the most recent N events- Returns:
- an
EventsPageDTOwith the most recently added events and pagination metadata
-