source: Farmatiko/Controllers/PharmacyHeadController.cs@ 1454207

Last change on this file since 1454207 was 1454207, checked in by DimitarSlezenkovski <dslezenkovski@…>, 2 years ago

Change structure, Add repo, services & controllers

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