| 12345678910111213141516171819202122232425 |
- using Microsoft.AspNetCore.Mvc;
-
- namespace Diligent.WebAPI.Host.Controllers.V1
- {
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/categories")]
- [ApiController]
- public class CategoriesController : ControllerBase
- {
- private readonly ICategoryService _categoryService;
-
- public CategoriesController(ICategoryService categoryService)
- {
- _categoryService = categoryService;
- }
-
- [HttpGet("names")]
- public async Task<IActionResult> GetCategoriesNames() =>
- Ok(await _categoryService.GetCategoriesNamesAsync());
-
- [HttpGet("granted-categories")]
- public async Task<IActionResult> GetCategories(int userId) =>
- Ok(await _categoryService.GetCategories(userId));
- }
- }
|