Changeset d23bf72 for Farmatiko/Controllers/FarmatikoController.cs
- Timestamp:
- 11/05/20 06:57:35 (4 years ago)
- Branches:
- master
- Children:
- afc9a9a
- Parents:
- 1f4846d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Controllers/FarmatikoController.cs
r1f4846d rd23bf72 11 11 { 12 12 private readonly IService _service; 13 public FarmatikoController(IService service) 13 private readonly IProcessJSONService _JSONservice; 14 public FarmatikoController(IService service, IProcessJSONService JSONservice) 14 15 { 15 16 _service = service; 17 _JSONservice = JSONservice; 16 18 } 17 19 // Workers 18 20 //Get 21 [HttpGet] 22 [Route("api/getData")] 23 public void InsertData() 24 { 25 //_JSONservice.DownloadPharmaciesExcel(); 26 //_JSONservice.GetProcessedHealthcareWorkersFromJSON(); 27 //_JSONservice.GetProcessedHealthFacilitiesFromJSON(); 28 //_JSONservice.GetProcessedMedicinesFromJSON(); 29 //_JSONservice.GetProcessedPandemicsFromJSONApi(); 30 } 19 31 [HttpGet] 20 32 [Route("api/workers")] … … 25 37 } 26 38 [HttpGet] 27 [Route("api/workers/search/{ Query}")]28 public async Task<IEnumerable<HealthcareWorker>> SearchWorkers( string Query)39 [Route("api/workers/search/{query}")] 40 public async Task<IEnumerable<HealthcareWorker>> SearchWorkers([FromRoute]string query) 29 41 { 30 return await _service.SearchWorkers( Query);42 return await _service.SearchWorkers(query); 31 43 } 32 44 [HttpGet] 33 45 [Route("api/workers/{id}")] 34 public async Task<HealthcareWorker> GetWorker( int Id)46 public async Task<HealthcareWorker> GetWorker([FromRoute] int Id) 35 47 { 36 48 return await _service.GetWorker(Id); … … 48 60 } 49 61 [HttpGet] 50 [Route("api/facilities/search/{ Query}")]51 public async Task<IEnumerable<HealthFacility>> SearchFacilities( string Query)62 [Route("api/facilities/search/{query}")] 63 public async Task<IEnumerable<HealthFacility>> SearchFacilities([FromRoute] string query) 52 64 { 53 return await _service.SearchFacilities( Query);65 return await _service.SearchFacilities(query); 54 66 } 55 67 [HttpGet] 56 [Route("api/facilities/{ Id}")]57 public async Task<HealthFacility> GetFacility( int Id)68 [Route("api/facilities/{id}")] 69 public async Task<HealthFacility> GetFacility([FromRoute] int id) 58 70 { 59 return await _service.GetFacility( Id);71 return await _service.GetFacility(id); 60 72 } 61 73 //Post … … 70 82 } 71 83 [HttpGet] 72 [Route("api/medicines/search/{ Query}")]73 public async Task<IEnumerable<Medicine>> SearchMedicines( string Query)84 [Route("api/medicines/search/{query}")] 85 public async Task<IEnumerable<Medicine>> SearchMedicines([FromRoute] string query) 74 86 { 75 return await _service.SearchMedicines( Query);87 return await _service.SearchMedicines(query); 76 88 } 77 89 [HttpGet] 78 90 [Route("api/medicines/{Id}")] 79 public async Task<Medicine> GetMedicine( int Id)91 public async Task<Medicine> GetMedicine([FromRoute] int Id) 80 92 { 81 93 return await _service.GetMedicine(Id); … … 98 110 [HttpGet] 99 111 [Route("api/pharmacy/search/{Query}")] 100 public async Task<IEnumerable<Pharmacy>> SearchPharmacies( string Query)112 public async Task<IEnumerable<Pharmacy>> SearchPharmacies([FromRoute] string Query) 101 113 { 102 114 return await _service.SearchPharmacies(Query); … … 104 116 [HttpGet] 105 117 [Route("api/pharmacy/{Id}")] 106 public async Task<Pharmacy> GetPharmacy( int Id)118 public async Task<Pharmacy> GetPharmacy([FromRoute] int Id) 107 119 { 108 120 return await _service.GetPharmacy(Id);
Note:
See TracChangeset
for help on using the changeset viewer.