PaydayBackend/PaydayBackend/Controllers/UniversityController.cs
Sergey Karmanov 23e334f201
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 17s
Обновил выдачу направлений
2023-07-30 02:59:16 +03:00

29 lines
918 B
C#

using Microsoft.AspNetCore.Mvc;
using PaydayBackend.Models;
using PaydayBackend.Services;
namespace PaydayBackend.Controllers;
[Route("v1/api/university")]
[ApiController]
public class UniversityController : ControllerBase
{
private readonly IAdminService _adminService;
public UniversityController(IAdminService adminService)
{
_adminService = adminService;
}
/// <summary>
/// Добавление направления университета
/// </summary>
/// <response code="400">Университет не найден</response>
[HttpPost("universities/directions")]
public async Task<ActionResult<string>> AddUniversityDirection([FromBody] UniversityDirectionDto universityDirection)
{
var result = await _adminService.AddUniversityDirection(universityDirection);
return result == "OK" ? Ok() : BadRequest(result);
}
}