java.lang.Object
transmatter.platform.administration.news.resolver.NewsResolver
All Implemented Interfaces:
graphql.kickstart.tools.GraphQLMutationResolver, graphql.kickstart.tools.GraphQLQueryResolver, graphql.kickstart.tools.GraphQLResolver<Void>

@Component public class NewsResolver extends Object implements graphql.kickstart.tools.GraphQLQueryResolver, graphql.kickstart.tools.GraphQLMutationResolver
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) NewsService
    An instance of NewsService used for calling method form NewsService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) News
    This method used to delete news by given specific id
    (package private) org.springframework.data.domain.Page<News>
    This method used to get all news from news database in pagination format by passing page filter as parameter
    (package private) org.springframework.data.domain.Page<News>
    this method used to get all news that had empty image alternate text in pagination format
    (package private) News
    This methods used to get specific news by given news id
    (package private) org.springframework.data.domain.Page<News>
    this method used to get all news that match news source in pagination format
    (package private) org.springframework.data.domain.Page<News>
    searchNews(String title, PageFilter filter)
    this method used to get all news that contain query (title) and return it in pagination format
    (package private) News
    this method used to update images alternate text in specific news by given id

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • newsService

      @Autowired NewsService newsService
      An instance of NewsService used for calling method form NewsService
  • Constructor Details

    • NewsResolver

      public NewsResolver()
  • Method Details

    • getContent

      @Transactional News getContent(String id)
      This methods used to get specific news by given news id
      Parameters:
      id - id of existed news in news database
      Returns:
      specific news content
    • getAllContents

      @Transactional org.springframework.data.domain.Page<News> getAllContents(PageFilter filter)
      This method used to get all news from news database in pagination format by passing page filter as parameter
      Parameters:
      filter - a page filter that have attribute page number (page) and amount of element in a page (size)
      Returns:
      list of news in pagination format
    • deleteContent

      @Transactional News deleteContent(String id)
      This method used to delete news by given specific id
      Parameters:
      id - id of specific news that aim to be delete
      Returns:
      the news that deleted by this method
    • getAllEmptyAltNews

      @Transactional org.springframework.data.domain.Page<News> getAllEmptyAltNews(PageFilter filter)
      this method used to get all news that had empty image alternate text in pagination format
      Parameters:
      filter - a page filter that have attribute page number (page) and amount of element in a page (size)
      Returns:
      list of news that had empty image alternate text in pagination format
    • updateImageContent

      @Transactional News updateImageContent(String id, List<Image> imageText)
      this method used to update images alternate text in specific news by given id
      Parameters:
      id - id of specific news that aim to be updated
      imageText - list of image alternate text
      Returns:
      the news that updated by this method
    • getNewsBySource

      @Transactional org.springframework.data.domain.Page<News> getNewsBySource(String source, PageFilter filter)
      this method used to get all news that match news source in pagination format
      Parameters:
      source - source of news e.g. Thairath, Sanook, Dek-D
      filter - a page filter that have attribute page number (page) and amount of element in a page (size)
      Returns:
      list of news that match by source in pagination format
    • searchNews

      org.springframework.data.domain.Page<News> searchNews(String title, PageFilter filter)
      this method used to get all news that contain query (title) and return it in pagination format
      Parameters:
      title - query for news searching
      filter - a page filter that have attribute page number (page) and amount of element in a page (size)
      Returns:
      list of news that contain a title in pagination format