Ignore:
Timestamp:
11/05/20 06:57:35 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
afc9a9a
Parents:
1f4846d
Message:

Add SystemService, Auth, fix a lil bugs :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/Controllers/FarmatikoController.cs

    r1f4846d rd23bf72  
    1111    {
    1212        private readonly IService _service;
    13         public FarmatikoController(IService service)
     13        private readonly IProcessJSONService _JSONservice;
     14        public FarmatikoController(IService service, IProcessJSONService JSONservice)
    1415        {
    1516            _service = service;
     17            _JSONservice = JSONservice;
    1618        }
    1719        // Workers
    1820        //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        }
    1931        [HttpGet]
    2032        [Route("api/workers")]
     
    2537        }
    2638        [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)
    2941        {
    30             return await _service.SearchWorkers(Query);
     42            return await _service.SearchWorkers(query);
    3143        }
    3244        [HttpGet]
    3345        [Route("api/workers/{id}")]
    34         public async Task<HealthcareWorker> GetWorker(int Id)
     46        public async Task<HealthcareWorker> GetWorker([FromRoute] int Id)
    3547        {
    3648            return await _service.GetWorker(Id);
     
    4860        }
    4961        [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)
    5264        {
    53             return await _service.SearchFacilities(Query);
     65            return await _service.SearchFacilities(query);
    5466        }
    5567        [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)
    5870        {
    59             return await _service.GetFacility(Id);
     71            return await _service.GetFacility(id);
    6072        }
    6173        //Post
     
    7082        }
    7183        [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)
    7486        {
    75             return await _service.SearchMedicines(Query);
     87            return await _service.SearchMedicines(query);
    7688        }
    7789        [HttpGet]
    7890        [Route("api/medicines/{Id}")]
    79         public async Task<Medicine> GetMedicine(int Id)
     91        public async Task<Medicine> GetMedicine([FromRoute] int Id)
    8092        {
    8193            return await _service.GetMedicine(Id);
     
    98110        [HttpGet]
    99111        [Route("api/pharmacy/search/{Query}")]
    100         public async Task<IEnumerable<Pharmacy>> SearchPharmacies(string Query)
     112        public async Task<IEnumerable<Pharmacy>> SearchPharmacies([FromRoute] string Query)
    101113        {
    102114            return await _service.SearchPharmacies(Query);
     
    104116        [HttpGet]
    105117        [Route("api/pharmacy/{Id}")]
    106         public async Task<Pharmacy> GetPharmacy(int Id)
     118        public async Task<Pharmacy> GetPharmacy([FromRoute] int Id)
    107119        {
    108120            return await _service.GetPharmacy(Id);
Note: See TracChangeset for help on using the changeset viewer.