Class InsightServiceMain

java.lang.Object
com.endurancetrio.business.insight.service.InsightServiceMain
All Implemented Interfaces:
InsightService

@Service public class InsightServiceMain extends Object implements InsightService
  • Constructor Details

  • Method Details

    • getArticleBySlug

      @Transactional(readOnly=true) public ArticleDTO getArticleBySlug(String slug, Locale locale)
      Description copied from interface: InsightService
      Returns an ArticleDTO identified by its unique URL slug, with content resolved for the requested locale.
      Specified by:
      getArticleBySlug in interface InsightService
      Parameters:
      slug - the unique URL slug of the article
      locale - the requested locale for content resolution
      Returns:
      the ArticleDTO with locale-resolved content
    • getArticles

      @Transactional(readOnly=true) public InsightPageDTO getArticles(int page, org.springframework.data.domain.Pageable pageable, Locale locale)
      Description copied from interface: InsightService
      Returns an InsightPageDTO containing a paginated list of all articles, ordered by published date descending.
      Specified by:
      getArticles in interface InsightService
      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

      @Transactional(readOnly=true) public List<ArticleDTO> getArticlesByIds(List<Long> ids, Locale locale)
      Description copied from interface: InsightService
      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.
      Specified by:
      getArticlesByIds in interface InsightService
      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

      @Transactional(readOnly=true) public InsightPageDTO getArticlesByAthleteId(Long athleteId, org.springframework.data.domain.Pageable pageable, Locale locale)
      Description copied from interface: InsightService
      Returns an InsightPageDTO containing a paginated list of articles authored by the athlete with the given ID, with content resolved for the requested locale.
      Specified by:
      getArticlesByAthleteId in interface InsightService
      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

      @Transactional(readOnly=true) public InsightPageDTO getArticlesByEvent(Long eventId, org.springframework.data.domain.Pageable pageable, Locale locale)
      Description copied from interface: InsightService
      Returns an InsightPageDTO containing a paginated list of articles associated with the given event ID, with content resolved for the requested locale.
      Specified by:
      getArticlesByEvent in interface InsightService
      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

      @Transactional(readOnly=true) public long getArticlesCountByEvent(Long eventId)
      Description copied from interface: InsightService
      Returns the number of articles related to the event with the given ID.
      Specified by:
      getArticlesCountByEvent in interface InsightService
      Parameters:
      eventId - the ID of the event to count articles for
      Returns:
      the number of articles related to the given event (0 if none)