This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add media score endpoint with exp controller
- Loading branch information
jih147
committed
Jun 13, 2023
1 parent
e1aeafb
commit c0c691c
Showing
7 changed files
with
60 additions
and
39 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
...er/src/main/java/ai/h2o/mojos/deploy/local/rest/Converter/ScoreMediaRequestConverter.java
This file was deleted.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
...scorer/src/main/java/ai/h2o/mojos/deploy/local/rest/controller/ModelsMediaController.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,26 @@ | ||
package ai.h2o.mojos.deploy.local.rest.controller; | ||
|
||
import ai.h2o.mojos.deploy.common.rest.v1exp.api.ModelApi; | ||
import ai.h2o.mojos.deploy.common.rest.v1exp.model.ScoreMediaRequest; | ||
import ai.h2o.mojos.deploy.common.rest.v1exp.model.ScoreResponse; | ||
import java.util.List; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.core.io.Resource; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.server.ResponseStatusException; | ||
|
||
@Controller | ||
public class ModelsMediaController implements ModelApi { | ||
private static final Logger log = LoggerFactory.getLogger(ModelsMediaController.class); | ||
|
||
@Override | ||
public ResponseEntity<ScoreResponse> getMediaScore( | ||
ScoreMediaRequest request, List<Resource> files) { | ||
log.info("Got score media request"); | ||
throw new ResponseStatusException(HttpStatus.NOT_IMPLEMENTED, | ||
"score media files is not implemented"); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...al/rest/Converter/MultipartConverter.java → ...al/rest/converter/MultipartConverter.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package ai.h2o.mojos.deploy.local.rest.Converter; | ||
package ai.h2o.mojos.deploy.local.rest.converter; | ||
|
||
import org.springframework.core.convert.converter.Converter; | ||
import org.springframework.core.io.Resource; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
public class MultipartConverter implements Converter<MultipartFile, Resource> { | ||
|
||
@Override | ||
public Resource convert(MultipartFile source) { | ||
return source.getResource(); | ||
} | ||
@Override | ||
public Resource convert(MultipartFile source) { | ||
return source.getResource(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...er/src/main/java/ai/h2o/mojos/deploy/local/rest/converter/ScoreMediaRequestConverter.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,13 @@ | ||
package ai.h2o.mojos.deploy.local.rest.converter; | ||
|
||
import ai.h2o.mojos.deploy.common.rest.v1exp.model.ScoreMediaRequest; | ||
import com.google.gson.Gson; | ||
import org.springframework.core.convert.converter.Converter; | ||
|
||
public class ScoreMediaRequestConverter implements Converter<String, ScoreMediaRequest> { | ||
|
||
@Override | ||
public ScoreMediaRequest convert(String input) { | ||
return new Gson().fromJson(input, ScoreMediaRequest.class); | ||
} | ||
} |
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