Package com.lpvs.service
Class LPVSStatisticsService
java.lang.Object
com.lpvs.service.LPVSStatisticsService
Service for managing statistics related to LPVSPullRequest entities.
-
Constructor Summary
ConstructorsConstructorDescriptionLPVSStatisticsService
(LPVSPullRequestRepository lpvsPullRequestRepository, LPVSDetectedLicenseRepository lpvsDetectedLicenseRepository, LPVSLoginCheckService loginCheckService, LPVSLicenseRepository lpvsLicenseRepository, LPVSMemberRepository memberRepository) Constructor for LPVSStatisticsService. -
Method Summary
Modifier and TypeMethodDescriptiongetDashboardEntity
(String type, String name, org.springframework.security.core.Authentication authentication) Retrieves a Dashboard entity based on the specified type, name, and authentication details.Retrieves the Grade enum based on the specified match value.pathCheck
(String type, String name, org.springframework.security.core.Authentication authentication) Performs a path check based on the specified type and name.putDefaultriskGradeMap
(Map<Grade, Integer> riskGradeMap) Initializes and returns a default risk grade map with Grade enums as keys and 0 as values.
-
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
Retrieves the Grade enum based on the specified match value.- Parameters:
match
- The match value.- Returns:
- The Grade enum.
-
putDefaultriskGradeMap
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.
-