All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 17s
29 lines
918 B
C#
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);
|
|
}
|
|
|
|
} |