source:
Farmatiko/Controllers/PharmacyHeadController.cs@
1454207
Last change on this file since 1454207 was 1454207, checked in by , 4 years ago | |
---|---|
|
|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[a55ef91] | 1 | using System.Linq; |
[1454207] | 2 | using System.Threading.Tasks; |
[4e72684] | 3 | using FarmatikoData.FarmatikoRepoInterfaces; |
4 | using FarmatikoData.Models; | |
[1454207] | 5 | using FarmatikoServices.FarmatikoServiceInterfaces; |
[4e72684] | 6 | using Microsoft.AspNetCore.Mvc; |
7 | ||
8 | namespace Farmatiko.Controllers | |
9 | { | |
10 | [ApiController] | |
[5d02859] | 11 | [Route("api/[action]")] |
[4e72684] | 12 | public class PharmacyHeadController : Controller |
13 | { | |
[1454207] | 14 | private readonly IPHService _PHService; |
15 | public PharmacyHeadController(IPHService PHService) | |
[4e72684] | 16 | { |
[1454207] | 17 | _PHService = PHService; |
[4e72684] | 18 | } |
[1454207] | 19 | |
20 | //GET | |
21 | //Mi trebaat rutite | |
[4e72684] | 22 | [HttpGet] |
[1454207] | 23 | public async Task<IQueryable<PharmacyHead>> GetPharmacyHeadInfo(string Token) |
[4e72684] | 24 | { |
[1454207] | 25 | return await _PHService.GetPharmacyHeadInfo(Token); |
[4e72684] | 26 | } |
[1454207] | 27 | //POST |
28 | [HttpPost] | |
29 | public async Task<int> Login(PharmacyHead pharmacyHead) | |
[a55ef91] | 30 | { |
[1454207] | 31 | return await _PHService.Login(pharmacyHead); |
[a55ef91] | 32 | } |
33 | [HttpPost] | |
[1454207] | 34 | public async Task UpdatePharmacyHead(PharmacyHead pharmacyHead) |
[a55ef91] | 35 | { |
[1454207] | 36 | await _PHService.UpdatePharmacyHead(pharmacyHead); |
[a55ef91] | 37 | } |
38 | [HttpPost] | |
[1454207] | 39 | public async Task<IActionResult> ClaimPharmacy(RequestPharmacyHead pharmacy) |
[a55ef91] | 40 | { |
[1454207] | 41 | await _PHService.ClaimPharmacy(pharmacy); |
42 | return Ok(); | |
[a55ef91] | 43 | } |
[1454207] | 44 | |
[4e72684] | 45 | } |
46 | } |
Note:
See TracBrowser
for help on using the repository browser.