Commit 75c97b79 authored by Jeremy Bokobza's avatar Jeremy Bokobza

Added TumbleBit controller

parent c0c1951b
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<TargetFramework>netstandard1.6</TargetFramework>
<AssemblyName>Breeze.TumbleBit.Client</AssemblyName>
<PackageId>Breeze.TumbleBit.Client</PackageId>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="1.0.3" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.0.1" />
</ItemGroup>
</Project>
\ No newline at end of file
using System;
namespace Breeze.TumbleBit.Client
{
public class Class1
{
}
}
using Breeze.TumbleBit.Models;
using Microsoft.AspNetCore.Mvc;
namespace Breeze.TumbleBit.Controllers
{
/// <summary>
/// Controller providing TumbleBit operations.
/// </summary>
[Route("api/v{version:apiVersion}/[controller]")]
public class TumbleBitController : Controller
{
/// <summary>
/// Connect to a tumbler.
/// </summary>
/// <param name="request">The object containing the parameters used to connect to a tumbler.</param>
[Route("connect")]
[HttpPost]
public IActionResult Connect([FromBody]TumblerConnectionRequest request)
{
return this.Ok();
}
}
}
using System;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace Breeze.TumbleBit.Models
{
/// <summary>
/// Base class for request objects received to the controllers
/// </summary>
public class RequestModel
{
public override string ToString()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
/// <summary>
/// Object used to connect to a tumbler.
/// </summary>
public class TumblerConnectionRequest : RequestModel
{
[Required(ErrorMessage = "A server address is required.")]
public Uri ServerAddress { get; set; }
public string Network { get; set; }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment