Add endpoint to download multidata directly
This commit is contained in:
@@ -72,6 +72,19 @@
|
||||
return ResolveResult(await this.RandomizeService.RetryMulti(id));
|
||||
}
|
||||
|
||||
[Route("/multidata/{id}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetMultidata(string id) {
|
||||
var multidata = await this.SeedService.GetMultidata(id);
|
||||
if (multidata == null) {
|
||||
return NotFound("multidata not found");
|
||||
} else {
|
||||
return new FileContentResult(multidata.ToArray(), "application/octet-stream") {
|
||||
FileDownloadName = $"{id}_multidata",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private ActionResult ResolveResult(IDictionary<string, object> result) {
|
||||
if (result.TryGetValue("status", out var responseCode)) {
|
||||
if (responseCode is int code) {
|
||||
|
||||
Reference in New Issue
Block a user