-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from davewalker5/MC-58-Catalogue-Export-From-UI
MC-58 Catalogue export from UI
- Loading branch information
Showing
47 changed files
with
1,371 additions
and
103 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 +1,4 @@ | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:latest | ||
COPY musiccatalogue.api-1.5.0.0 /opt/musiccatalogue.api-1.5.0.0 | ||
WORKDIR /opt/musiccatalogue.api-1.5.0.0/bin | ||
COPY musiccatalogue.api-1.6.0.0 /opt/musiccatalogue.api-1.6.0.0 | ||
WORKDIR /opt/musiccatalogue.api-1.6.0.0/bin | ||
ENTRYPOINT [ "./MusicCatalogue.Api" ] |
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,6 +1,6 @@ | ||
FROM node:20-alpine | ||
COPY musiccatalogue.ui-1.5.0.0 /opt/musiccatalogue.ui-1.5.0.0 | ||
WORKDIR /opt/musiccatalogue.ui-1.5.0.0 | ||
COPY musiccatalogue.ui-1.6.0.0 /opt/musiccatalogue.ui-1.6.0.0 | ||
WORKDIR /opt/musiccatalogue.ui-1.6.0.0 | ||
RUN npm install | ||
RUN npm run build | ||
ENTRYPOINT [ "npm", "start" ] |
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,33 @@ | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using MusicCatalogue.Api.Entities; | ||
using MusicCatalogue.Api.Interfaces; | ||
|
||
namespace MusicCatalogue.Api.Controllers | ||
{ | ||
[Authorize] | ||
[ApiController] | ||
[ApiConventionType(typeof(DefaultApiConventions))] | ||
[Route("[controller]")] | ||
public class ExportController : Controller | ||
{ | ||
private readonly IBackgroundQueue<CatalogueExportWorkItem> _catalogueQueue; | ||
|
||
public ExportController(IBackgroundQueue<CatalogueExportWorkItem> catalogueQueue) | ||
{ | ||
_catalogueQueue = catalogueQueue; | ||
} | ||
|
||
[HttpPost] | ||
[Route("catalogue")] | ||
public IActionResult ExportSightings([FromBody] CatalogueExportWorkItem item) | ||
{ | ||
// Set the job name used in the job status record | ||
item.JobName = "Catalogue Export"; | ||
|
||
// Queue the work item | ||
_catalogueQueue.Enqueue(item); | ||
return Accepted(); | ||
} | ||
} | ||
} |
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,15 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace MusicCatalogue.Api.Entities | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public class BackgroundWorkItem | ||
{ | ||
public string JobName { get; set; } = ""; | ||
|
||
public override string ToString() | ||
{ | ||
return $"JobName = {JobName}"; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/MusicCatalogue.Api/Entities/CatalogueExportWorkItem.cs
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,15 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace MusicCatalogue.Api.Entities | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public class CatalogueExportWorkItem : BackgroundWorkItem | ||
{ | ||
public string FileName { get; set; } = ""; | ||
|
||
public override string ToString() | ||
{ | ||
return $"{base.ToString()}, FileName = {FileName}"; | ||
} | ||
} | ||
} |
Oops, something went wrong.