Skip to content

Commit

Permalink
Fix endpoint with new RS
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Mar 25, 2024
1 parent 21ab750 commit 3c24d26
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ public Iterable<ReleaseStatsPerSpeciesV2Dto> getReleaseStatsPerSpecies(
@GetMapping("/per-species/new")
public Iterable<ReleaseStatsPerSpeciesV2Dto> getSpeciesWithNewRsIds(
@RequestParam(name = "releaseVersion") Integer releaseVersion) {
return releaseStatsService.getReleaseStatsPerSpeciesWithNewRsIds(releaseVersion);
return releaseStatsService.getSpeciesWithNewRsIds(releaseVersion);
}

@GetMapping("/per-assembly")
public Iterable<ReleaseStatsPerAssemblyV2Dto> getReleaseStatsPerAssemblies(
@RequestParam(name = "releaseVersion", required = false) Integer releaseVersion) {
return releaseStatsService.getReleaseStatsPerAssembly(releaseVersion, false);
return releaseStatsService.getReleaseStatsPerAssembly(releaseVersion);
}

@GetMapping("/per-assembly/new")
public Iterable<ReleaseStatsPerAssemblyV2Dto> getAssembliesWithNewRsIds(
@RequestParam(name = "releaseVersion") Integer releaseVersion) {
return releaseStatsService.getReleaseStatsPerAssembly(releaseVersion, true);
return releaseStatsService.getReleaseStatsPerAssemblyWithNewRsIds(releaseVersion);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(taxonomyId, releaseVersion, scientificName, releaseFolder, currentRs, multiMappedRs,
mergedRs,
deprecatedRs, mergedDeprecatedRs, unmappedRs, newCurrentRs, newMultiMappedRs, newMergedRs,
newDeprecatedRs, newMergedDeprecatedRs, newUnmappedRs, releaseLink,
taxonomyLink);
mergedRs, deprecatedRs, mergedDeprecatedRs, unmappedRs, newCurrentRs, newMultiMappedRs, newMergedRs,
newDeprecatedRs, newMergedDeprecatedRs, newUnmappedRs, releaseLink, taxonomyLink);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void setReleaseFolder(String releaseFolder) {

public Long getCurrentRs() {

if (currentRs == null){
if (currentRs == null) {
return new Long(0);
}
return currentRs;
Expand All @@ -80,7 +80,7 @@ public void setCurrentRs(Long currentRs) {
}

public Long getMergedRs() {
if (mergedRs == null){
if (mergedRs == null) {
return new Long(0);
}
return mergedRs;
Expand All @@ -91,7 +91,7 @@ public void setMergedRs(Long mergedRs) {
}

public Long getDeprecatedRs() {
if (deprecatedRs == null){
if (deprecatedRs == null) {
return new Long(0);
}
return deprecatedRs;
Expand All @@ -102,7 +102,7 @@ public void setDeprecatedRs(Long deprecatedRs) {
}

public Long getMergedDeprecatedRs() {
if (mergedDeprecatedRs == null){
if (mergedDeprecatedRs == null) {
return new Long(0);
}
return mergedDeprecatedRs;
Expand All @@ -113,7 +113,7 @@ public void setMergedDeprecatedRs(Long mergedDeprecatedRs) {
}

public Long getNewCurrentRs() {
if (newCurrentRs == null){
if (newCurrentRs == null) {
return new Long(0);
}
return newCurrentRs;
Expand All @@ -124,7 +124,7 @@ public void setNewCurrentRs(Long newCurrentRs) {
}

public Long getNewMergedRs() {
if (newMergedRs == null){
if (newMergedRs == null) {
return new Long(0);
}
return newMergedRs;
Expand All @@ -135,7 +135,7 @@ public void setNewMergedRs(Long newMergedRs) {
}

public Long getNewDeprecatedRs() {
if (newDeprecatedRs == null){
if (newDeprecatedRs == null) {
return new Long(0);
}
return newDeprecatedRs;
Expand All @@ -146,7 +146,7 @@ public void setNewDeprecatedRs(Long newDeprecatedRs) {
}

public Long getNewMergedDeprecatedRs() {
if (newMergedDeprecatedRs == null){
if (newMergedDeprecatedRs == null) {
return new Long(0);
}
return newMergedDeprecatedRs;
Expand All @@ -155,8 +155,9 @@ public Long getNewMergedDeprecatedRs() {
public void setNewMergedDeprecatedRs(Long newMergedDeprecatedRs) {
this.newMergedDeprecatedRs = newMergedDeprecatedRs;
}

public Long getMultiMappedRs() {
if (multiMappedRs == null){
if (multiMappedRs == null) {
return new Long(0);
}
return multiMappedRs;
Expand All @@ -167,7 +168,7 @@ public void setMultiMappedRs(Long multiMappedRs) {
}

public Long getNewMultiMappedRs() {
if (newMultiMappedRs == null){
if (newMultiMappedRs == null) {
return new Long(0);
}
return newMultiMappedRs;
Expand All @@ -178,7 +179,7 @@ public void setNewMultiMappedRs(Long newMultiMappedRs) {
}

public Long getUnmappedRs() {
if (unmappedRs == null){
if (unmappedRs == null) {
return new Long(0);
}
return unmappedRs;
Expand All @@ -189,7 +190,7 @@ public void setUnmappedRs(Long unmappedRs) {
}

public Long getNewUnmappedRs() {
if (newUnmappedRs == null){
if (newUnmappedRs == null) {
return new Long(0);
}
return newUnmappedRs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ public Iterable<ReleaseStatsPerSpeciesV2Dto> getReleaseStatsPerSpeciesWithNewRsI

}

public Iterable<ReleaseStatsPerAssemblyV2Dto> getReleaseStatsPerAssembly(Integer releaseVersion, boolean excludeNonNew) {
Iterable<ReleaseStatsPerAssemblyV2> releaseData;
if (releaseVersion != null) {
releaseData = releaseStatsPerAssemblyRepository.findAllByReleaseVersion(releaseVersion);
} else {
releaseData = releaseStatsPerAssemblyRepository.findAll();
}
return this.releaseStatsPerAssemblyMapper.toDtoV2(releaseData);
}

public Iterable<ReleaseStatsPerSpeciesV2Dto> getReleaseStatsPerSpecies(Integer releaseVersion,
boolean excludeUnmappedOnly) {
Iterable<ReleaseStatsPerTaxonomyV2> releaseData;
Expand All @@ -77,7 +67,7 @@ public Iterable<ReleaseStatsPerSpeciesV2Dto> getReleaseStatsPerSpecies(Integer r
}
} else {
if (excludeUnmappedOnly) {
releaseData = getReleaseDataExcludingUnmappedOnly();
releaseData = getReleaseDataPerSpeciesExcludingUnmappedOnly();
} else {
releaseData = releaseStatsPerTaxonomyRepository.findAll();
}
Expand All @@ -91,7 +81,7 @@ private Iterable<ReleaseStatsPerTaxonomyV2> getReleaseDataByVersionExcludingUnma
releaseVersion, 0, 0, 0, 0, 0, 0);
}

private Iterable<ReleaseStatsPerTaxonomyV2> getReleaseDataExcludingUnmappedOnly() {
private Iterable<ReleaseStatsPerTaxonomyV2> getReleaseDataPerSpeciesExcludingUnmappedOnly() {
return releaseStatsPerTaxonomyRepository
.findByCurrentRsNotAndMultimapRsNotAndMergedRsNotAndDeprecatedRsNotAndMergedDeprecatedRsNotAndUnmappedRsGreaterThan(
0, 0, 0, 0, 0, 0);
Expand Down

0 comments on commit 3c24d26

Please sign in to comment.