-
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.
- Loading branch information
1 parent
d3ab888
commit 105c261
Showing
20 changed files
with
429 additions
and
67 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
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,27 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base | ||
WORKDIR /api | ||
EXPOSE 80 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build | ||
WORKDIR /src | ||
|
||
COPY "ProvaML.sln" "ProvaML.sln" | ||
COPY "ProvaML.API/ProvaML.API.csproj" "ProvaML.API/ProvaML.API.csproj" | ||
COPY "ProvaML.Application/ProvaML.Application.csproj" "ProvaML.Application/ProvaML.Application.csproj" | ||
COPY "ProvaML.Domain/ProvaML.Domain.csproj" "ProvaML.Domain/ProvaML.Domain.csproj" | ||
COPY "ProvaML.Infrastructure/ProvaML.Infrastructure.csproj" "ProvaML.Infrastructure/ProvaML.Infrastructure.csproj" | ||
COPY "ProvaML.Infrastructure.Tests/ProvaML.Infrastructure.Tests.csproj" "ProvaML.Infrastructure.Tests/ProvaML.Infrastructure.Tests.csproj" | ||
COPY "ProvaML.Migration/ProvaML.Migration.csproj" "ProvaML.Migration/ProvaML.Migration.csproj" | ||
RUN dotnet restore | ||
|
||
|
||
COPY . . | ||
WORKDIR /src/ProvaML.API | ||
RUN dotnet publish -c Release -o /api | ||
|
||
FROM build AS publish | ||
|
||
FROM base AS final | ||
WORKDIR /api | ||
COPY --from=publish /api . | ||
ENTRYPOINT ["dotnet", "ProvaML.API.dll"] |
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,24 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using ProvaML.Domain.Entities; | ||
|
||
namespace ProvaML.API.Model | ||
{ | ||
public class ProdutoViewModel | ||
{ | ||
public ProdutoViewModel(Produto produto, IUrlHelper urlHelper) | ||
{ | ||
this.Id = produto.Id; | ||
this.Nome = produto.Nome; | ||
this.ValorDeVenda = produto.ValorVenda; | ||
this.Imagem = urlHelper.RouteUrl("GetImagem", new { id=produto.Id }); | ||
} | ||
|
||
public string Imagem { get; set; } | ||
|
||
public decimal ValorDeVenda { get; set; } | ||
|
||
public string Nome { get; set; } | ||
|
||
public int Id { get; set; } | ||
} | ||
} |
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
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.
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,11 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using ProvaML.Domain.Entities; | ||
|
||
namespace ProvaML.Application | ||
{ | ||
public interface IProdutoAppService | ||
{ | ||
Produto Criar(string nome, decimal valorVenda, IFormFile arquivo); | ||
ImagemDTO BaixarImagem(int id); | ||
} | ||
} |
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 @@ | ||
namespace ProvaML.Application | ||
{ | ||
public class ImagemDTO | ||
{ | ||
public ImagemDTO() | ||
{ | ||
|
||
} | ||
|
||
public byte[] Stream { get; set; } | ||
public string ContentType { get; set; } | ||
} | ||
} |
Oops, something went wrong.