diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/SourceLogicTreesController.java b/src/main/java/gov/usgs/earthquake/nshmp/www/SourceLogicTreesController.java new file mode 100644 index 0000000000000000000000000000000000000000..e6f84eedc58aeaf1082adf899c8e5e8fe5301c23 --- /dev/null +++ b/src/main/java/gov/usgs/earthquake/nshmp/www/SourceLogicTreesController.java @@ -0,0 +1,51 @@ +package gov.usgs.earthquake.nshmp.www; + +import javax.inject.Inject; + +import gov.usgs.earthquake.nshmp.www.services.SourceLogicTreesService; + +import io.micronaut.http.HttpRequest; +import io.micronaut.http.HttpResponse; +import io.micronaut.http.annotation.Controller; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.PathVariable; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.tags.Tag; + +@Tag( + name = "Source Logic Trees", + description = "NSHM source logic trees service") +@Controller("/trees") +public class SourceLogicTreesController { + + @Inject + private NshmpMicronautServlet servlet; + + @Operation( + description = "Returns the tectonic setting to source logic trees in the NSHM", + operationId = "trees_doGetMetadata", + summary = "Hazard model source logic trees") + @ApiResponse( + description = "Source logic trees metadata", + responseCode = "200") + @Get + public HttpResponse<String> doGetMetadata(HttpRequest<?> request) { + return SourceLogicTreesService.handleDoGetMetadata(request); + } + + /** + * @param id Source tree id + */ + @Operation( + description = "Returns the source logic tree for an id", + operationId = "trees_goGetTrees", + summary = "Get NSHM source logic tree") + @ApiResponse( + description = "NSHM source logic tree", + responseCode = "200") + @Get(uri = "/{id}") + public HttpResponse<String> doGetTrees(HttpRequest<?> request, @PathVariable int id) { + return SourceLogicTreesService.handleDoGetTrees(request, id); + } +} diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/SourceTreesController.java b/src/main/java/gov/usgs/earthquake/nshmp/www/SourceTreesController.java deleted file mode 100644 index d138c6dc85fe9905fa69c34fa3cba1cde7b08110..0000000000000000000000000000000000000000 --- a/src/main/java/gov/usgs/earthquake/nshmp/www/SourceTreesController.java +++ /dev/null @@ -1,31 +0,0 @@ -package gov.usgs.earthquake.nshmp.www; - -import javax.inject.Inject; - -import gov.usgs.earthquake.nshmp.www.services.SourceTreesService; -import io.micronaut.http.HttpRequest; -import io.micronaut.http.HttpResponse; -import io.micronaut.http.annotation.Controller; -import io.micronaut.http.annotation.Get; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.tags.Tag; - -@Tag( - name = "Source Model Trees", - description = "" -) -@Controller("/trees") -public class SourceTreesController { - - @Inject - private NshmpMicronautServlet servlet; - - @Operation() - @ApiResponse() - @Get - public HttpResponse<String> doGetMetadata(HttpRequest<?> request) { - return SourceTreesService.handleDoGetMetadata(request); - } - -}