-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide endpoint to return all genes (#86)
* Provide endpoint to return all genes Co-authored-by: Calvin Lu <[email protected]>
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/org/mskcc/oncokb/transcript/web/rest/GeneResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.mskcc.oncokb.transcript.web.rest; | ||
|
||
import java.util.List; | ||
import org.mskcc.oncokb.transcript.domain.Gene; | ||
import org.mskcc.oncokb.transcript.service.GeneService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* REST controller for managing {@link org.mskcc.oncokb.transcript.domain.Gene}. | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class GeneResource { | ||
|
||
private final Logger log = LoggerFactory.getLogger(GeneResource.class); | ||
|
||
private final GeneService geneService; | ||
|
||
public GeneResource(GeneService geneService) { | ||
this.geneService = geneService; | ||
} | ||
|
||
/** | ||
* {@code GET /genes} : get all the genes. | ||
* | ||
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of genes in body. | ||
*/ | ||
@GetMapping("/genes") | ||
public List<Gene> getAllGenes() { | ||
log.debug("REST request to get all Genes"); | ||
return geneService.findAll(); | ||
} | ||
} |