You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

66 lines
2.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CoviDok.Api;
using CoviDok.Api.Request;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace CoviDok.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class DocController : ControllerBase
{
// GET /api/Doc
[HttpGet]
public async Task<ActionResult<GenericResponse>> GetDoctors()
{
GenericResponse genericResponse = new GenericResponse
{
Status = Status.Success
};
for (int i=5; i < 15; i++)
{
string doc = "{ \"FirstName\": \"Dr. Schanniquah\", \"LastName\": \"The " + i + "th\"}";
genericResponse.Body[i.ToString()] = doc;
}
return genericResponse;
}
// GET /api/Doc/{id}/assistants
[HttpGet("{id}/assistants")]
public async Task<ActionResult<GenericResponse>> GetAssistantsOfDoctor(string id)
{
GenericResponse genericResponse = new GenericResponse
{
Status = Status.Success
};
genericResponse.Body["DoctorID"] = id;
for (int i = 5; i < 15; i++)
{
string doc = "{ \"FirstName\": \"Belisarius\", \"LastName\": \"The " + i + "th Cawl\"}";
genericResponse.Body[i.ToString()] = doc;
}
return genericResponse;
}
// GET /api/Doc/{id}/children
[HttpGet("{id}/children")]
public async Task<ActionResult<GenericResponse>> GetChildrenOfDoctor(string id)
{
GenericResponse genericResponse = new GenericResponse
{
Status = Status.Success
};
genericResponse.Body["DoctorID"] = id;
for (int i = 5; i < 15; i++)
{
string doc = "{ \"FirstName\": \"Belisarius\", \"LastName\": \"The " + i + "th Cawl\"}";
genericResponse.Body[i.ToString()] = doc;
}
return genericResponse;
}
}
}