using JOBot.Backend.Services; using Microsoft.AspNetCore.Mvc; namespace JOBot.Backend.Controllers; [ApiController] [Route("auth")] public class HeadHunterHookController(HeadHunterService hhService) : ControllerBase { [HttpGet] public async Task Get(int userId, string? error, string code) { var res = await hhService.AuthUser(userId, code, error); return res switch { HeadHunterService.Status.Success => Ok( "Авторизация завершена успешно. Вернитесь в Telegram для продолжения."), HeadHunterService.Status.UserNotFoundError => NotFound("Пользователь не найден."), _ => BadRequest( "Авторизация завершена с ошибкой. Вернитесь в Telegram для продолжения.") //TODO: Add resource }; } }