Initial
This commit is contained in:
		
							
								
								
									
										57
									
								
								SearchWebApi/Controllers/LookupController.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								SearchWebApi/Controllers/LookupController.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | ||||
| using BusinessLogic.LookupLogic.Interfaces; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace FwSearchApi.Controllers | ||||
| { | ||||
|     [ApiController] | ||||
|     [Route("[controller]")] | ||||
|     public class LookupController : ControllerBase | ||||
|     { | ||||
|         private readonly IConfiguration _configuration; | ||||
|         private readonly ILogger<LookupController> _logger; | ||||
|         private readonly ILookupLogic _lookupLogic; | ||||
|  | ||||
|         public LookupController(IConfiguration configuration, ILogger<LookupController> logger, ILookupLogic lookupLogic) | ||||
|         { | ||||
|             _configuration = configuration; | ||||
|             _logger = logger; | ||||
|             _lookupLogic = lookupLogic; | ||||
|         } | ||||
|  | ||||
|         [HttpGet] | ||||
|         [Route("GetAllLookups")] | ||||
|         public async Task<JsonResult> GetAllLookups() | ||||
|         { | ||||
|             var result = await _lookupLogic.GetAllLookups(); | ||||
|             _logger.LogInformation($"Lookups zur Verf<72>gung gestellt von {nameof(GetAllLookups)}"); | ||||
|             return new JsonResult(result); | ||||
|         } | ||||
|  | ||||
|         [HttpGet] | ||||
|         [Route("GetCategoriesById")] | ||||
|         public async Task<JsonResult> GetLookupCategoriesById(long id) | ||||
|         { | ||||
|             var result = await _lookupLogic.GetLookupCategoryById(id); | ||||
|             return new JsonResult(result); | ||||
|         } | ||||
|  | ||||
|         [HttpGet] | ||||
|         [Route("GetCategoriesByName")] | ||||
|         public async Task<JsonResult> GetLookupCategoriesByName(string categoryName) | ||||
|         { | ||||
|             var result = await _lookupLogic.GetLookupCategoryByName(categoryName); | ||||
|             return new JsonResult(result); | ||||
|         } | ||||
|  | ||||
|         [HttpGet] | ||||
|         [Route("GetActiveCategories")] | ||||
|         public async Task<JsonResult> GetActiveLookupCategories() | ||||
|         { | ||||
|             var result = await _lookupLogic.GetActiveLookupCategories(); | ||||
|             return new JsonResult(result); | ||||
|         } | ||||
|     } | ||||
| }  | ||||
		Reference in New Issue
	
	Block a user