2021-07-30 14:12:09 +02:00
|
|
|
package eu.dnetlib.organizations.metrics;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import eu.dnetlib.common.metrics.MetricInfo;
|
|
|
|
import eu.dnetlib.organizations.repository.OrganizationRepository;
|
|
|
|
import eu.dnetlib.organizations.utils.OrganizationStatus;
|
|
|
|
|
2021-11-30 14:08:55 +01:00
|
|
|
@Component("openorgs_valid_organizations")
|
2021-11-29 13:37:27 +01:00
|
|
|
public class ValidOrganizationsMetric implements MetricInfo {
|
2021-07-30 14:12:09 +02:00
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private OrganizationRepository organizationRepository;
|
|
|
|
|
|
|
|
@Override
|
2021-07-30 16:17:20 +02:00
|
|
|
public double obtainValue() {
|
2021-07-30 14:12:09 +02:00
|
|
|
return organizationRepository.countByStatus(OrganizationStatus.approved.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|