Changeset d23bf72 for Farmatiko/Controllers/PharmacyHeadController.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/PharmacyHeadController.cs
r1f4846d rd23bf72 1 using System.Collections; 2 using System.Collections.Generic; 3 using System.Linq; 1 using System.Collections.Generic; 4 2 using System.Threading.Tasks; 5 using FarmatikoData.FarmatikoRepoInterfaces;6 3 using FarmatikoData.Models; 7 4 using FarmatikoServices.FarmatikoServiceInterfaces; 5 using Microsoft.AspNetCore.Authorization; 8 6 using Microsoft.AspNetCore.Mvc; 9 7 … … 11 9 { 12 10 [ApiController] 11 [Authorize(Roles = "PharmacyHead")] 13 12 public class PharmacyHeadController : Controller 14 13 { … … 20 19 21 20 //GET 22 //Mi trebaat rutite 23 [HttpGet] 21 /*[HttpGet] 24 22 [Route("api/pharmacyhead")] 25 public async Task<IEnumerable<PharmacyHead>> GetPharmacyHeadInfo( string Token)23 public async Task<IEnumerable<PharmacyHead>> GetPharmacyHeadInfo() 26 24 { 27 var PHeads = await _PHService.GetPharmacyHeadInfo( Token);25 var PHeads = await _PHService.GetPharmacyHeadInfo(); 28 26 return PHeads; 29 } 27 }*/ 30 28 [HttpGet] 31 29 [Route("api/pharmacyhead/{Id}")] 32 public async Task<PharmacyHead> GetPharmacyHeadById( int Id)30 public async Task<PharmacyHead> GetPharmacyHeadById([FromRoute]int Id) 33 31 { 34 32 var Phead = await _PHService.GetPharmacyHeadByIdAsync(Id); … … 38 36 [HttpPost] 39 37 [Route("api/pharmacyhead/add")] 40 public async Task<IActionResult> AddPharmacyHead( PharmacyHead pharmacyHead)38 public async Task<IActionResult> AddPharmacyHead([FromBody]PharmacyHead pharmacyHead) 41 39 { 42 40 bool Success = await _PHService.Add(pharmacyHead); … … 44 42 } 45 43 46 [HttpPost]44 /*[HttpPost] 47 45 [Route("api/pharmacyhead/login")] 48 46 public async Task<int> Login([FromBody]PharmacyHead pharmacyHead) 49 47 { 50 48 return await _PHService.Login(pharmacyHead); 51 } 49 }*/ 52 50 [HttpPut] 53 51 [Route("api/pharmacyhead/{Id}")] … … 58 56 [HttpPost] 59 57 [Route("api/pharmacyhead/requests")] 60 public async Task<IActionResult> ClaimPharmacy( RequestPharmacyHead pharmacy)58 public async Task<IActionResult> ClaimPharmacy([FromBody]RequestPharmacyHead pharmacy) 61 59 { 62 60 bool Success = await _PHService.ClaimPharmacy(pharmacy); … … 65 63 [HttpDelete] 66 64 [Route("api/pharmacyhead/delete/{Id}")] 67 public async Task<IActionResult> Remove([From Query] int Id)65 public async Task<IActionResult> Remove([FromRoute] int Id) 68 66 { 69 67 bool Success = await _PHService.Remove(Id); … … 72 70 [HttpPost] 73 71 [Route("api/pharmacyhead/requests/{Id}")] 74 public async Task<IActionResult> RemoveClaimingRequest([From Query] int Id)72 public async Task<IActionResult> RemoveClaimingRequest([FromRoute] int Id) 75 73 { 76 74 bool Success = await _PHService.RemoveClaimingRequest(Id);
Note:
See TracChangeset
for help on using the changeset viewer.