Changeset 1454207 for Farmatiko/Controllers
- Timestamp:
- 10/01/20 03:17:09 (4 years ago)
- Branches:
- master
- Children:
- 6f203af
- Parents:
- 5d02859
- Location:
- Farmatiko/Controllers
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Controllers/FarmatikoController.cs
r5d02859 r1454207 20 20 [HttpGet] 21 21 [Route("/api/workers")] 22 public async Task<IQueryable<HealthcareWorker s>> GetWorkers()22 public async Task<IQueryable<HealthcareWorker>> GetWorkers() 23 23 { 24 return await _service.GetAllWorkers(); 24 var Workers = await _service.GetAllWorkers(); 25 return Workers; 25 26 } 26 27 [HttpGet] 27 28 [Route("/api/workers/search/{Query}")] 28 public async Task<IQueryable<HealthcareWorker s>> SearchWorkers(string Query)29 public async Task<IQueryable<HealthcareWorker>> SearchWorkers(string Query) 29 30 { 30 31 return await _service.SearchWorkers(Query); … … 32 33 [HttpGet] 33 34 [Route("/api/workers/{id}")] 34 public async Task<HealthcareWorker s> GetWorker(int Id)35 public async Task<HealthcareWorker> GetWorker(int Id) 35 36 { 36 37 return await _service.GetWorker(Id); … … 43 44 [HttpGet] 44 45 [Route("/api/facilities")] 45 public async Task<IQueryable<HealthFacilit ies>> GetFacilities()46 public async Task<IQueryable<HealthFacility>> GetFacilities() 46 47 { 47 48 return await _service.GetFacilities(); … … 49 50 [HttpGet] 50 51 [Route("/api/facilities/search/{Query}")] 51 public async Task<IQueryable<HealthFacilit ies>> SearchFacilities(string Query)52 public async Task<IQueryable<HealthFacility>> SearchFacilities(string Query) 52 53 { 53 54 return await _service.SearchFacilities(Query); … … 55 56 [HttpGet] 56 57 [Route("/api/facilities/{Id}")] 57 public async Task<HealthFacilit ies> GetFacility(int Id)58 public async Task<HealthFacility> GetFacility(int Id) 58 59 { 59 60 return await _service.GetFacility(Id); -
Farmatiko/Controllers/PharmacyHeadController.cs
r5d02859 r1454207 1 1 using System.Linq; 2 using System.Threading.Tasks; 2 3 using FarmatikoData.FarmatikoRepoInterfaces; 3 4 using FarmatikoData.Models; 5 using FarmatikoServices.FarmatikoServiceInterfaces; 4 6 using Microsoft.AspNetCore.Mvc; 5 7 … … 10 12 public class PharmacyHeadController : Controller 11 13 { 12 private readonly IP harmacyHeadRepository _pharmacyHeadRepository;13 public PharmacyHeadController(IP harmacyHeadRepository pharmacyHeadRepository)14 private readonly IPHService _PHService; 15 public PharmacyHeadController(IPHService PHService) 14 16 { 15 _ pharmacyHeadRepository = pharmacyHeadRepository;17 _PHService = PHService; 16 18 } 19 20 //GET 21 //Mi trebaat rutite 17 22 [HttpGet] 18 public IQueryable<PharmacyHead> GetAllPharmacies(string NameOfPharmacy)23 public async Task<IQueryable<PharmacyHead>> GetPharmacyHeadInfo(string Token) 19 24 { 20 return _pharmacyHeadRepository.GetAllPharmacies(NameOfPharmacy);25 return await _PHService.GetPharmacyHeadInfo(Token); 21 26 } 22 [HttpGet] 23 public IQueryable<PharmacyHead> GetPharmacyByName(string Name) 27 //POST 28 [HttpPost] 29 public async Task<int> Login(PharmacyHead pharmacyHead) 24 30 { 25 return _pharmacyHeadRepository.GetPharmacyByName(Name); 26 } 27 [HttpGet] 28 public IQueryable<MedicineList> GetPharmacyMedicines(string NameOfPharmacy) 29 { 30 return _pharmacyHeadRepository.GetPharmacyMedicines(NameOfPharmacy); 31 return await _PHService.Login(pharmacyHead); 31 32 } 32 33 [HttpPost] 33 public void Add(PharmacyHead pharmacyHead)34 public async Task UpdatePharmacyHead(PharmacyHead pharmacyHead) 34 35 { 35 _pharmacyHeadRepository.Add(pharmacyHead);36 await _PHService.UpdatePharmacyHead(pharmacyHead); 36 37 } 37 38 [HttpPost] 38 public void Remove(PharmacyHead pharmacyHead)39 public async Task<IActionResult> ClaimPharmacy(RequestPharmacyHead pharmacy) 39 40 { 40 _pharmacyHeadRepository.Remove(pharmacyHead); 41 await _PHService.ClaimPharmacy(pharmacy); 42 return Ok(); 41 43 } 44 42 45 } 43 46 }
Note:
See TracChangeset
for help on using the changeset viewer.