Interface InsightService

All Known Implementing Classes:
InsightServiceMain

public interface InsightService
The InsightService defines the business operations for the Insights section, providing access to article data with locale-aware content resolution.
  • Method Details

    • getArticleBySlug

      ArticleDTO getArticleBySlug(String slug, Locale locale)
      Returns an ArticleDTO identified by its unique URL slug, with content resolved for the requested locale.
      Parameters:
      slug - the unique URL slug of the article
      locale - the requested locale for content resolution
      Returns:
      the ArticleDTO with locale-resolved content
      Throws:
      EnduranceTrioException - if no article with the given slug is found
    • getArticles

      InsightPageDTO getArticles(int page, org.springframework.data.domain.Pageable pageable, Locale locale)
      Returns an InsightPageDTO containing a paginated list of all articles, ordered by published date descending.
      Parameters:
      page - the 0-based page number, pre-clamped by the controller
      pageable - the pagination information (page number, page size, etc.)
      locale - the requested locale for content resolution
      Returns:
      an InsightPageDTO with the articles for the requested page and pagination metadata
    • getArticlesByIds

      List<ArticleDTO> getArticlesByIds(List<Long> ids, Locale locale)
      Returns a list of articles for the given IDs, preserving the order of the provided ID list. Articles that are not found or have no locale-resolved content are silently excluded.
      Parameters:
      ids - the list of article IDs to fetch, in the desired display order
      locale - the requested locale for content resolution
      Returns:
      an ordered list of articles matching the given IDs
    • getArticlesByAthleteId

      InsightPageDTO getArticlesByAthleteId(Long athleteId, org.springframework.data.domain.Pageable pageable, Locale locale)
      Returns an InsightPageDTO containing a paginated list of articles authored by the athlete with the given ID, with content resolved for the requested locale.
      Parameters:
      athleteId - the ID of the athlete to filter articles by
      pageable - the pagination information (page number, page size, etc.)
      locale - the requested locale for content resolution
      Returns:
      an InsightPageDTO with the articles authored by the given athlete and pagination metadata
    • getArticlesByEvent

      InsightPageDTO getArticlesByEvent(Long eventId, org.springframework.data.domain.Pageable pageable, Locale locale)
      Returns an InsightPageDTO containing a paginated list of articles associated with the given event ID, with content resolved for the requested locale.
      Parameters:
      eventId - the ID of the event to filter articles by
      pageable - the pagination information (page number, page size, etc.)
      locale - the requested locale for content resolution
      Returns:
      an InsightPageDTO with the articles linked to the given event and pagination metadata
    • getArticlesCountByEvent

      long getArticlesCountByEvent(Long eventId)
      Returns the number of articles related to the event with the given ID.
      Parameters:
      eventId - the ID of the event to count articles for
      Returns:
      the number of articles related to the given event (0 if none)