Just score API interface
This commit is contained in:
parent
765b31447b
commit
1b3a55ae12
@ -199,8 +199,7 @@ instance Yesod App where
|
||||
|
||||
isAuthorized (ChallengeImageR _) _ = return Authorized
|
||||
|
||||
isAuthorized (ApiTxtScoreMainMetricR _) _ = return Authorized
|
||||
isAuthorized (ApiTxtScoreWithMetricR _ _) _ = return Authorized
|
||||
isAuthorized (ApiTxtScoreR _) _ = return Authorized
|
||||
|
||||
isAuthorized (ChallengeParamGraphDataR _ _ _) _ = return Authorized
|
||||
isAuthorized (IndicatorGraphDataR _) _ = return Authorized
|
||||
|
@ -59,11 +59,12 @@ fetchSubmissionByOut (Entity _ out) = do
|
||||
fsi <- getFullInfo theSubmissionEnt
|
||||
return (fsi, outChecksum out)
|
||||
|
||||
getApiTxtScoreMainMetricR :: Text -> Handler Text
|
||||
getApiTxtScoreMainMetricR sha1Prefix = getApiTxtScore Nothing sha1Prefix
|
||||
|
||||
getApiTxtScoreWithMetricR :: Text -> Text -> Handler Text
|
||||
getApiTxtScoreWithMetricR sha1Prefix metricName = getApiTxtScore (Just metricName) sha1Prefix
|
||||
getApiTxtScoreR :: Text -> Handler Text
|
||||
getApiTxtScoreR query =
|
||||
if T.null post
|
||||
then getApiTxtScore Nothing pre
|
||||
else getApiTxtScore (Just $ T.tail post) pre
|
||||
where (pre, post) = T.breakOn "-" query
|
||||
|
||||
getApiTxtScore :: Maybe Text -> Text -> Handler Text
|
||||
getApiTxtScore mMetricName sha1Prefix = do
|
||||
|
@ -34,8 +34,7 @@
|
||||
|
||||
/view-variant/#VariantId ViewVariantR GET
|
||||
|
||||
/api/txt/score/#Text ApiTxtScoreMainMetricR GET
|
||||
/api/txt/score/#Text/#Text ApiTxtScoreWithMetricR GET
|
||||
/api/txt/score/#Text ApiTxtScoreR GET
|
||||
|
||||
/make-public/#SubmissionId MakePublicR GET
|
||||
/hide-submission/#SubmissionId HideSubmissionR GET
|
||||
|
Loading…
Reference in New Issue
Block a user