Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Prova2_Henrique/Prova/Controllers/MarcasController.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Prova.Models;
using Prova.Services;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Prova.Controllers
{
Expand All @@ -18,14 +16,14 @@ public MarcaController(MarcaService marcaService)
}

[HttpGet]
public async Task<ActionResult<IEnumerable<Marca>>> GetAllMarcas()
public async Task<ActionResult<IEnumerable<Marca>>> GetTodasMarcas()
{
var marcas = await _marcaService.GetAllAsync();
return Ok(marcas);
}

[HttpGet("{id}")]
public async Task<ActionResult<Marca>> GetMarcaById(int id)
public async Task<ActionResult<Marca>> GetMarcaPorId(int id)
{
var marca = await _marcaService.GetByIdAsync(id);
if (marca == null)
Expand All @@ -38,8 +36,8 @@ public async Task<ActionResult<Marca>> GetMarcaById(int id)
[HttpPost]
public async Task<ActionResult<Marca>> CreateMarca(Marca marca)
{
var newMarca = await _marcaService.AddAsync(marca);
return CreatedAtAction(nameof(GetMarcaById), new { id = newMarca.Id }, newMarca);
var novaMarca = await _marcaService.AddAsync(marca);
return CreatedAtAction(nameof(GetMarcaPorId), new { id = novaMarca.Id }, novaMarca);
}
}
}
8 changes: 4 additions & 4 deletions Prova2_Henrique/Prova/Controllers/ProduotsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public ProdutoController(ProdutoService produtoService)
}

[HttpGet]
public async Task<ActionResult<IEnumerable<Produto>>> GetAllProdutos()
public async Task<ActionResult<IEnumerable<Produto>>> GetTodosProdutos()
{
var produtos = await _produtoService.GetAllAsync();
return Ok(produtos);
}

[HttpGet("{id}")]
public async Task<ActionResult<Produto>> GetProdutoById(int id)
public async Task<ActionResult<Produto>> GetProdutoPorId(int id)
{
var produto = await _produtoService.GetByIdAsync(id);
if (produto == null)
Expand All @@ -38,8 +38,8 @@ public async Task<ActionResult<Produto>> GetProdutoById(int id)
[HttpPost]
public async Task<ActionResult<Produto>> CreateProduto(Produto produto)
{
var newProduto = await _produtoService.AddAsync(produto);
return CreatedAtAction(nameof(GetProdutoById), new { id = newProduto.Id }, newProduto);
var novoProduto = await _produtoService.AddAsync(produto);
return CreatedAtAction(nameof(GetProdutoPorId), new { id = novoProduto.Id }, novoProduto);
}

[HttpDelete]
Expand Down
1 change: 0 additions & 1 deletion Prova2_Henrique/Prova/Controllers/UsuarioController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Prova.DTOs;
using Prova.Models;
using Prova.Services;

namespace Prova.Controllers
Expand Down
10 changes: 10 additions & 0 deletions Prova2_Henrique/Prova/DTO/EnderecoDTO.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Prova.DTOs
{
public class EnderecoDTO
{
public string Cidade { get; set; } = string.Empty;
public string Estado { get; set; } = string.Empty;
public string Cep { get; set; } = string.Empty;
public int UsuarioId { get; set; }
}
}
3 changes: 0 additions & 3 deletions Prova2_Henrique/Prova/DTO/UsuarioAtualizacaoDTO.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using Prova.Models;

namespace Prova.DTOs
{
Expand Down
3 changes: 0 additions & 3 deletions Prova2_Henrique/Prova/DTO/UsuarioCadastroDTO.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using Prova.Models;

namespace Prova.DTOs
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
namespace Prova.Migrations
{
/// <inheritdoc />
<<<<<<<< HEAD:Prova2_Henrique/Prova/Migrations/20241129233214_euteamoluquinhas.cs
public partial class euteamoluquinhas : Migration
========
public partial class InitialCreate : Migration
>>>>>>>> 08cc1bad6ec5360a42e1bfe921c40f574ac1bc8a:Prova2_Henrique/Prova/Migrations/20241129230149_InitialCreate.cs
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading