mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Add WebAPI controllers for beers, breweries, and users; update Docker configuration and .gitignore
This commit is contained in:
75
WebAPI/Controllers/BeersController.cs
Normal file
75
WebAPI/Controllers/BeersController.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/beers")]
|
||||
public class BeersController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public IActionResult GetBeers([FromQuery] int page_num, [FromQuery] int page_size)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("search")]
|
||||
public IActionResult SearchBeers([FromQuery] string search)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("styles")]
|
||||
public IActionResult GetBeerStyles([FromQuery] int page_num, [FromQuery] int page_size)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("styles/create")]
|
||||
public IActionResult CreateBeerStyle([FromBody] BeerStyleCreateRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPut("{postId}")]
|
||||
public IActionResult EditBeer(string postId, [FromBody] BeerEditRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpDelete("{postId}")]
|
||||
public IActionResult DeleteBeer(string postId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("{postId}/recommendations")]
|
||||
public IActionResult GetBeerRecommendations([FromQuery] int page_num, [FromQuery] int page_size, string postId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("{postId}/comments")]
|
||||
public IActionResult AddBeerComment(string postId, [FromBody] BeerCommentRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("{postId}/comments")]
|
||||
public IActionResult GetBeerComments([FromQuery] int page_num, [FromQuery] int page_size, string postId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPut("{postId}/comments/{commentId}")]
|
||||
public IActionResult EditBeerComment(string postId, string commentId, [FromBody] BeerCommentRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpDelete("{postId}/comments/{commentId}")]
|
||||
public IActionResult DeleteBeerComment(string postId, string commentId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
57
WebAPI/Controllers/BreweriesController.cs
Normal file
57
WebAPI/Controllers/BreweriesController.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/breweries")]
|
||||
public class BreweriesController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public IActionResult GetBreweries([FromQuery] int page_num, [FromQuery] int page_size)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("map")]
|
||||
public IActionResult GetBreweriesMap([FromQuery] int page_num, [FromQuery] int page_size)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPut("{postId}")]
|
||||
public IActionResult EditBrewery(string postId, [FromBody] BreweryEditRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpDelete("{postId}")]
|
||||
public IActionResult DeleteBrewery(string postId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("{postId}/comments")]
|
||||
public IActionResult AddBreweryComment(string postId, [FromBody] BreweryCommentRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet("{postId}/comments")]
|
||||
public IActionResult GetBreweryComments([FromQuery] int page_num, [FromQuery] int page_size, string postId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPut("{postId}/comments/{commentId}")]
|
||||
public IActionResult EditBreweryComment(string postId, string commentId, [FromBody] BreweryCommentRequest request)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpDelete("{postId}/comments/{commentId}")]
|
||||
public IActionResult DeleteBreweryComment(string postId, string commentId)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
26
WebAPI/Controllers/UsersController.cs
Normal file
26
WebAPI/Controllers/UsersController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DataAccessLayer;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/users")]
|
||||
public class UsersController : ControllerBase
|
||||
{
|
||||
private readonly UserAccountRepository _userAccountRepository;
|
||||
|
||||
public UsersController()
|
||||
{
|
||||
_userAccountRepository = new UserAccountRepository();
|
||||
}
|
||||
|
||||
// all users
|
||||
[HttpGet("users")]
|
||||
public IActionResult GetAllUsers()
|
||||
{
|
||||
var users = _userAccountRepository.GetAll();
|
||||
return Ok(users);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user