Last change
on this file since ee137aa was c73269d, checked in by Mile Jankuloski <mile.jankuloski@…>, 4 years ago |
JSON processing added
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[d2e69be] | 1 | using FarmatikoData;
|
---|
| 2 | using FarmatikoData.Models;
|
---|
[a55ef91] | 3 | using FarmatikoServices.FarmatikoServiceInterfaces;
|
---|
[d2e69be] | 4 | using Microsoft.AspNetCore.Mvc;
|
---|
[a55ef91] | 5 | using Microsoft.Extensions.Logging;
|
---|
| 6 | using Newtonsoft.Json;
|
---|
| 7 | using Newtonsoft.Json.Linq;
|
---|
| 8 | using System;
|
---|
[d2e69be] | 9 | using System.Collections.Generic;
|
---|
[a55ef91] | 10 | using System.Linq;
|
---|
| 11 | using System.Net;
|
---|
| 12 | using System.Threading.Tasks;
|
---|
[d2e69be] | 13 |
|
---|
| 14 | namespace Farmatiko.Controllers
|
---|
| 15 | {
|
---|
| 16 | [ApiController]
|
---|
| 17 | [Route("[controller]/[action]")]
|
---|
| 18 | public class HealthFacilitiesController : Controller
|
---|
| 19 | {
|
---|
| 20 | private IHealthFacilityService _healthFacilitiesService;
|
---|
[a55ef91] | 21 | private IProcessJSONService _processJSONService;
|
---|
| 22 | public HealthFacilitiesController(IHealthFacilityService healthFacilitiesService, IProcessJSONService processJSONService)
|
---|
[d2e69be] | 23 | {
|
---|
| 24 | _healthFacilitiesService = healthFacilitiesService;
|
---|
[a55ef91] | 25 | _processJSONService = processJSONService;
|
---|
[d2e69be] | 26 | }
|
---|
| 27 | [HttpGet]
|
---|
[a55ef91] | 28 | public IQueryable<HealthFacilities> Get()
|
---|
[d2e69be] | 29 | {
|
---|
| 30 | return _healthFacilitiesService.GetAll();
|
---|
| 31 | }
|
---|
[c73269d] | 32 | public void Index()
|
---|
[a55ef91] | 33 | {
|
---|
| 34 | _processJSONService.GetProcessedHealthFacilitiesFromJSON();
|
---|
[c73269d] | 35 | }
|
---|
[d2e69be] | 36 | }
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.