Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
92a1e30e
Commit
92a1e30e
authored
2 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
Remove service
parent
dba4b552
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!136
Production Release | nshmp-ws-static
,
!135
Resolves - Map Endpoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/TestSitesService.java
+0
-49
0 additions, 49 deletions
...ov/usgs/earthquake/nshmp/netcdf/www/TestSitesService.java
with
0 additions
and
49 deletions
src/hazard/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/TestSitesService.java
deleted
100644 → 0
+
0
−
49
View file @
dba4b552
package
gov.usgs.earthquake.nshmp.netcdf.www
;
import
com.google.gson.JsonElement
;
import
gov.usgs.earthquake.nshmp.geo.json.FeatureCollection
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfHazardCurves
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfVersion
;
import
gov.usgs.earthquake.nshmp.www.ResponseBody
;
import
gov.usgs.earthquake.nshmp.www.ResponseMetadata
;
import
io.micronaut.http.HttpRequest
;
import
jakarta.inject.Singleton
;
/**
* Test sites handler for {@link TestSitesController}.
*
* @author U.S. Geological Survey
*/
@Singleton
public
class
TestSitesService
{
static
final
String
NAME
=
"Test Sites"
;
static
String
handleSites
(
HttpRequest
<?>
http
,
NetcdfHazardCurves
netcdf
,
Boolean
raw
)
{
RequestData
requestData
=
new
RequestData
(
raw
);
FeatureCollection
sites
=
netcdf
.
netcdfData
().
sites
();
if
(
requestData
.
raw
)
{
return
sites
.
toJson
();
}
else
{
var
response
=
ResponseBody
.<
RequestData
,
JsonElement
>
success
()
.
name
(
NAME
)
.
url
(
http
.
getUri
().
toString
())
.
metadata
(
new
ResponseMetadata
(
NetcdfVersion
.
appVersions
()))
.
request
(
requestData
)
.
response
(
sites
.
toJsonTree
())
.
build
();
return
NetcdfWsUtils
.
GSON
.
toJson
(
response
);
}
}
static
class
RequestData
{
public
boolean
raw
;
RequestData
(
Boolean
raw
)
{
this
.
raw
=
raw
==
null
?
false
:
raw
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment