Class LPVSStatisticsService

java.lang.Object
com.lpvs.service.LPVSStatisticsService

@Service public class LPVSStatisticsService extends Object
Service for managing statistics related to LPVSPullRequest entities.
  • Constructor Details

    • LPVSStatisticsService

      public LPVSStatisticsService(LPVSPullRequestRepository lpvsPullRequestRepository, LPVSDetectedLicenseRepository lpvsDetectedLicenseRepository, LPVSLoginCheckService loginCheckService, LPVSLicenseRepository lpvsLicenseRepository, LPVSMemberRepository memberRepository)
      Constructor for LPVSStatisticsService.
      Parameters:
      lpvsPullRequestRepository - Repository for storing LPVSPullRequest entities.
      lpvsDetectedLicenseRepository - Repository for storing LPVSDetectedLicense entities.
      loginCheckService - Service for checking user authentication and obtaining LPVSMember.
      lpvsLicenseRepository - Repository for storing LPVSLicense entities.
      memberRepository - Repository for storing LPVSMember entities.
  • Method Details

    • pathCheck

      public List<LPVSPullRequest> pathCheck(String type, String name, org.springframework.security.core.Authentication authentication)
      Performs a path check based on the specified type and name.
      Parameters:
      type - The type ("own", "org", or "send").
      name - The name associated with the path.
      authentication - The authentication details.
      Returns:
      A list of LPVSPullRequest entities based on the path check.
    • getDashboardEntity

      public Dashboard getDashboardEntity(String type, String name, org.springframework.security.core.Authentication authentication)
      Retrieves a Dashboard entity based on the specified type, name, and authentication details.
      Parameters:
      type - The type ("own", "org", or "send").
      name - The name associated with the path.
      authentication - The authentication details.
      Returns:
      A Dashboard entity with statistical information.
    • getGrade

      public Grade getGrade(String match)
      Retrieves the Grade enum based on the specified match value.
      Parameters:
      match - The match value.
      Returns:
      The Grade enum.
    • putDefaultriskGradeMap

      public Map<Grade,Integer> putDefaultriskGradeMap(Map<Grade,Integer> riskGradeMap)
      Initializes and returns a default risk grade map with Grade enums as keys and 0 as values.
      Parameters:
      riskGradeMap - The risk grade map to be initialized.
      Returns:
      The initialized risk grade map.