using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using HyperCube.Models; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace HyperCube.Controllers { [Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase { // GET: api/ [HttpGet] public IEnumerable Get() { return new string[] {}; } // GET api//5 [HttpGet("{id}/{email}")] public async Task Get(int id, string email) { var acc = AccountModel.FindByMail(email); string transactionId = $"not found: {id} {email}"; var article = ArticleModel.Find(id); if (article != null && acc != null) { var bc = await acc.GetSelectedBlockChain(); transactionId = await SmartContract.Verify(acc, article, bc); } return transactionId; } // POST api/ [HttpPost] public void Post([FromBody] string value) { } // PUT api//5 [HttpPut("{id}")] public void Put(int id, [FromBody] string value) { } // DELETE api//5 [HttpDelete("{id}")] public void Delete(int id) { } } }