79 lines
2.8 KiB
C#
79 lines
2.8 KiB
C#
|
using Cloud.Models;
|
|||
|
using Cloud.Requests;
|
|||
|
using Cloud.Services.Broker;
|
|||
|
using Cloud.Services.Broker.Support;
|
|||
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
|||
|
namespace Cloud.Controllers
|
|||
|
{
|
|||
|
[ApiController]
|
|||
|
[Route("api/user/{userId}/farm/{farmId}/greenhouse")]
|
|||
|
public class GreenhouseController : ControllerBase
|
|||
|
{
|
|||
|
private readonly IBrokerService _brokerService;
|
|||
|
private readonly ApplicationContext _context;
|
|||
|
private readonly IConfiguration _config;
|
|||
|
public GreenhouseController(IConfiguration config, ApplicationContext context,
|
|||
|
IBrokerService brokerService)
|
|||
|
{
|
|||
|
_brokerService = brokerService;
|
|||
|
_context = context;
|
|||
|
_config = config;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Возвращает текущую информацию о всех теплицах пользователя
|
|||
|
*/
|
|||
|
[HttpGet]
|
|||
|
public async Task<ActionResult<List<GreenhouseInfo>>> GetAll(int userId, int farmId)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Возвращает текущую информацию о конкретной теплице
|
|||
|
*/
|
|||
|
[HttpGet("{greenhouseId}")]
|
|||
|
public async Task<ActionResult<GreenhouseInfo>> Get(int userId, int farmId, int greenhouseId)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Возвращает сохраненные данные для автоматизации теплицы
|
|||
|
*/
|
|||
|
[HttpGet("{greenhouseId}/settings")]
|
|||
|
public async Task<ActionResult<Greenhouse>> GetGreenhouse(int userId, int farmId, int greenhouseId)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Сохраняет в базе данных API данные для автоматизации теплицы
|
|||
|
*/
|
|||
|
[HttpPost]
|
|||
|
public async Task<ActionResult<Greenhouse>> SaveToDatabase(int userId, int farmId, GreenhouseRequest greenhouse)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Обновляет в базе данных API данные для автоматизации теплицы
|
|||
|
*/
|
|||
|
[HttpPut("{greenhouseId}/settings")]
|
|||
|
public async Task<ActionResult<Greenhouse>> Update(int userId, int farmId, int greenhouseId, GreenhouseRequest greenhouse)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Удаляет из базы данных API запись настроек автоматизации теплицы
|
|||
|
*/
|
|||
|
[HttpDelete("{greenhouseId}")]
|
|||
|
public async Task<ActionResult> Delete(int userId, int farmId, int greenhouseId)
|
|||
|
{
|
|||
|
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|