|
@@ -0,0 +1,64 @@
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
+using Microsoft.AspNetCore.Http;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using OnlineMetodist.API.Enums;
|
|
|
+
|
|
|
+namespace OnlineMetodist.API.Controllers
|
|
|
+{
|
|
|
+ [Authorize]
|
|
|
+ [Route("api/[controller]/[action]")]
|
|
|
+ [ApiController]
|
|
|
+ public class ValuesFormsController : ControllerBase
|
|
|
+ {
|
|
|
+ private readonly ILogger<ValuesFormsController> _logger;
|
|
|
+
|
|
|
+ public ValuesFormsController(ILogger<ValuesFormsController> logger)
|
|
|
+ {
|
|
|
+ _logger = logger;
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<ActionResult<List<string>>> GetParticipationForms()
|
|
|
+ {
|
|
|
+ if (EnumsEvent.ParticipationForms.Any())
|
|
|
+ {
|
|
|
+ return Ok(EnumsEvent.ParticipationForms);
|
|
|
+ }
|
|
|
+ _logger.LogError($"Participation forms is empty");
|
|
|
+ return NotFound("Participation forms object sent from client is null.");
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<ActionResult<List<string>>> GetEventForms()
|
|
|
+ {
|
|
|
+ if (EnumsEvent.EventForms.Any())
|
|
|
+ {
|
|
|
+ return Ok(EnumsEvent.EventForms);
|
|
|
+ }
|
|
|
+ _logger.LogError($"Event forms is empty");
|
|
|
+ return NotFound("Event forms object sent from client is null.");
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<ActionResult<List<string>>> GetStatusEvents()
|
|
|
+ {
|
|
|
+ if (EnumsEvent.StatusEvents.Any())
|
|
|
+ {
|
|
|
+ return Ok(EnumsEvent.StatusEvents);
|
|
|
+ }
|
|
|
+ _logger.LogError($"Status events is empty");
|
|
|
+ return NotFound("Status events sent from client is null.");
|
|
|
+ }
|
|
|
+
|
|
|
+ [HttpGet]
|
|
|
+ public async Task<ActionResult<List<string>>> GetResultEvents()
|
|
|
+ {
|
|
|
+ if (EnumsEvent.ResultEvents.Any())
|
|
|
+ {
|
|
|
+ return Ok(EnumsEvent.ResultEvents);
|
|
|
+ }
|
|
|
+ _logger.LogError($"Result events is empty");
|
|
|
+ return NotFound("Result events sent from client is null.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|