DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/FileCategoryController.cs

40 lines
1.3 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using System.Threading;
using System.Collections.Generic;
namespace AsbCloudWebApi.Controllers
{
/// <summary>
/// Категорий документов файлов
/// </summary>
[Route("api/fileCategory")]
[ApiController]
[Authorize]
public class FileCategoryController : CrudController<FileCategoryDto, ICrudService<FileCategoryDto>>
{
private readonly IFileCategoryService fileCategoryService;
public FileCategoryController(ICrudService<FileCategoryDto> service, IFileCategoryService fileCategoryService)
: base(service)
{
this.fileCategoryService = fileCategoryService;
}
/// <summary>
/// Получение справочника категорий файлов
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("/getWellFileCategory")]
//[Permission]
public async Task<IActionResult> GetWellFileCategory(CancellationToken token = default)
{
var data = await fileCategoryService.GetWellCategoryAsync(token);
return Ok(data);
}
}
}