Initial Commit from Swagger-Gen
This commit is contained in:
208
src/IO.Swagger/.gitignore
vendored
Normal file
208
src/IO.Swagger/.gitignore
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
PID
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
bower_components/
|
||||
orleans.codegen.cs
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
61
src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs
Normal file
61
src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
|
||||
namespace IO.Swagger.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// Model state validation attribute
|
||||
/// </summary>
|
||||
public class ValidateModelStateAttribute : ActionFilterAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Called before the action method is invoked
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
public override void OnActionExecuting(ActionExecutingContext context)
|
||||
{
|
||||
// Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/
|
||||
var descriptor = context.ActionDescriptor as ControllerActionDescriptor;
|
||||
if (descriptor != null)
|
||||
{
|
||||
foreach (var parameter in descriptor.MethodInfo.GetParameters())
|
||||
{
|
||||
object args = null;
|
||||
if (context.ActionArguments.ContainsKey(parameter.Name))
|
||||
{
|
||||
args = context.ActionArguments[parameter.Name];
|
||||
}
|
||||
|
||||
ValidateAttributes(parameter, args, context.ModelState);
|
||||
}
|
||||
}
|
||||
|
||||
if (!context.ModelState.IsValid)
|
||||
{
|
||||
context.Result = new BadRequestObjectResult(context.ModelState);
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState)
|
||||
{
|
||||
foreach (var attributeData in parameter.CustomAttributes)
|
||||
{
|
||||
var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType);
|
||||
|
||||
var validationAttribute = attributeInstance as ValidationAttribute;
|
||||
if (validationAttribute != null)
|
||||
{
|
||||
var isValid = validationAttribute.IsValid(args);
|
||||
if (!isValid)
|
||||
{
|
||||
modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
97
src/IO.Swagger/Controllers/AuthApi.cs
Normal file
97
src/IO.Swagger/Controllers/AuthApi.cs
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using IO.Swagger.Attributes;
|
||||
using IO.Swagger.Security;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IO.Swagger.Models;
|
||||
|
||||
namespace IO.Swagger.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
public class AuthApiController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Get user details
|
||||
/// </summary>
|
||||
/// <response code="200">Successful response</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpGet]
|
||||
[Route("/v1/api/auth/details")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("GetUserDetails")]
|
||||
public virtual IActionResult GetUserDetails()
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log in with email and password
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="200">Logged in successfully</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/auth/login")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("LoginUser")]
|
||||
public virtual IActionResult LoginUser([FromBody]AuthLoginBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a new user
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="201">User registered successfully</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="409">Conflict (user with provided email already exists)</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/auth/register")]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("RegisterUser")]
|
||||
public virtual IActionResult RegisterUser([FromBody]AuthRegisterBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(201);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 409 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(409);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
134
src/IO.Swagger/Controllers/CurrencyApi.cs
Normal file
134
src/IO.Swagger/Controllers/CurrencyApi.cs
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using IO.Swagger.Attributes;
|
||||
using IO.Swagger.Security;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IO.Swagger.Models;
|
||||
|
||||
namespace IO.Swagger.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
public class CurrencyApiController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Add a digital asset to the user's collection
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="201">Successful asset addition</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/currency/addAsset")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("AddDigitalAssetToCollection")]
|
||||
public virtual IActionResult AddDigitalAssetToCollection([FromBody]CurrencyAddAssetBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(201);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new collection of digital assets owned by the user
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="201">Successful collection creation</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/currency/createCollection")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("CreateAssetCollection")]
|
||||
public virtual IActionResult CreateAssetCollection([FromBody]CurrencyCreateCollectionBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(201);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new currency type
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="201">Currency type created successfully</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/currency/create")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("CreateCurrency")]
|
||||
public virtual IActionResult CreateCurrency([FromBody]CurrencyCreateBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(201);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mint additional units of a currency
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="200">Successful minting</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/currency/mint")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("MintCurrency")]
|
||||
public virtual IActionResult MintCurrency([FromBody]CurrencyMintBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
103
src/IO.Swagger/Controllers/WalletApi.cs
Normal file
103
src/IO.Swagger/Controllers/WalletApi.cs
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using IO.Swagger.Attributes;
|
||||
using IO.Swagger.Security;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IO.Swagger.Models;
|
||||
|
||||
namespace IO.Swagger.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
public class WalletApiController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Get user's wallet
|
||||
/// </summary>
|
||||
/// <response code="200">Successful response</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpGet]
|
||||
[Route("/v1/api/wallet")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("GetUserWallet")]
|
||||
public virtual IActionResult GetUserWallet()
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfer digital asset to another user
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="200">Successful transfer</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/wallet/transferDigital")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("TransferDigitalAsset")]
|
||||
public virtual IActionResult TransferDigitalAsset([FromBody]WalletTransferDigitalBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfer physical currency to another user
|
||||
/// </summary>
|
||||
/// <param name="body"></param>
|
||||
/// <response code="200">Successful transfer</response>
|
||||
/// <response code="400">Bad Request</response>
|
||||
/// <response code="401">Unauthorized</response>
|
||||
[HttpPost]
|
||||
[Route("/v1/api/wallet/transferPhysical")]
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("TransferPhysicalCurrency")]
|
||||
public virtual IActionResult TransferPhysicalCurrency([FromBody]WalletTransferPhysicalBody body)
|
||||
{
|
||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(200);
|
||||
|
||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(400);
|
||||
|
||||
//TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||
// return StatusCode(401);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
19
src/IO.Swagger/Dockerfile
Normal file
19
src/IO.Swagger/Dockerfile
Normal file
@ -0,0 +1,19 @@
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
|
||||
WORKDIR /app
|
||||
|
||||
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore
|
||||
|
||||
# copy everything else and build
|
||||
COPY . ./
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
# build runtime image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
|
||||
WORKDIR /app
|
||||
COPY --from=build-env /app/out .
|
||||
|
||||
ENTRYPOINT ["dotnet", "IO.Swagger.dll"]
|
||||
51
src/IO.Swagger/Filters/BasePathFilter.cs
Normal file
51
src/IO.Swagger/Filters/BasePathFilter.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Swashbuckle.AspNetCore.Swagger;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
namespace IO.Swagger.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// BasePath Document Filter sets BasePath property of Swagger and removes it from the individual URL paths
|
||||
/// </summary>
|
||||
public class BasePathFilter : IDocumentFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="basePath">BasePath to remove from Operations</param>
|
||||
public BasePathFilter(string basePath)
|
||||
{
|
||||
BasePath = basePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the BasePath of the Swagger Doc
|
||||
/// </summary>
|
||||
/// <returns>The BasePath of the Swagger Doc</returns>
|
||||
public string BasePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Apply the filter
|
||||
/// </summary>
|
||||
/// <param name="swaggerDoc">OpenApiDocument</param>
|
||||
/// <param name="context">FilterContext</param>
|
||||
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
|
||||
{
|
||||
swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath });
|
||||
|
||||
var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList();
|
||||
|
||||
foreach (var path in pathsToModify)
|
||||
{
|
||||
if (path.Key.StartsWith(this.BasePath))
|
||||
{
|
||||
string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty);
|
||||
swaggerDoc.Paths.Remove(path.Key);
|
||||
swaggerDoc.Paths.Add(newKey, path.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
96
src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs
Normal file
96
src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs
Normal file
@ -0,0 +1,96 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
namespace IO.Swagger.Filters
|
||||
{
|
||||
/// <summary>
|
||||
/// Path Parameter Validation Rules Filter
|
||||
/// </summary>
|
||||
public class GeneratePathParamsValidationFilter : IOperationFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="operation">Operation</param>
|
||||
/// <param name="context">OperationFilterContext</param>
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
var pars = context.ApiDescription.ParameterDescriptions;
|
||||
|
||||
foreach (var par in pars)
|
||||
{
|
||||
var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name);
|
||||
|
||||
var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes;
|
||||
|
||||
if (attributes != null && attributes.Count() > 0 && swaggerParam != null)
|
||||
{
|
||||
// Required - [Required]
|
||||
var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute));
|
||||
if (requiredAttr != null)
|
||||
{
|
||||
swaggerParam.Required = true;
|
||||
}
|
||||
|
||||
// Regex Pattern [RegularExpression]
|
||||
var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute));
|
||||
if (regexAttr != null)
|
||||
{
|
||||
string regex = (string)regexAttr.ConstructorArguments[0].Value;
|
||||
if (swaggerParam is OpenApiParameter)
|
||||
{
|
||||
((OpenApiParameter)swaggerParam).Schema.Pattern = regex;
|
||||
}
|
||||
}
|
||||
|
||||
// String Length [StringLength]
|
||||
int? minLenght = null, maxLength = null;
|
||||
var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute));
|
||||
if (stringLengthAttr != null)
|
||||
{
|
||||
if (stringLengthAttr.NamedArguments.Count == 1)
|
||||
{
|
||||
minLenght = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value;
|
||||
}
|
||||
maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value;
|
||||
}
|
||||
|
||||
var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute));
|
||||
if (minLengthAttr != null)
|
||||
{
|
||||
minLenght = (int)minLengthAttr.ConstructorArguments[0].Value;
|
||||
}
|
||||
|
||||
var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute));
|
||||
if (maxLengthAttr != null)
|
||||
{
|
||||
maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value;
|
||||
}
|
||||
|
||||
if (swaggerParam is OpenApiParameter)
|
||||
{
|
||||
((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght;
|
||||
((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength;
|
||||
}
|
||||
|
||||
// Range [Range]
|
||||
var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute));
|
||||
if (rangeAttr != null)
|
||||
{
|
||||
int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value;
|
||||
int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value;
|
||||
|
||||
if (swaggerParam is OpenApiParameter)
|
||||
{
|
||||
((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin;
|
||||
((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/IO.Swagger/IO.Swagger.csproj
Normal file
21
src/IO.Swagger/IO.Swagger.csproj
Normal file
@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<Description>IO.Swagger</Description>
|
||||
<Copyright>IO.Swagger</Copyright>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<AssemblyName>IO.Swagger</AssemblyName>
|
||||
<PackageId>IO.Swagger</PackageId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.5.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="5.5.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.5.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="5.5.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
135
src/IO.Swagger/Models/AuthLoginBody.cs
Normal file
135
src/IO.Swagger/Models/AuthLoginBody.cs
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class AuthLoginBody : IEquatable<AuthLoginBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets Email
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Password
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class AuthLoginBody {\n");
|
||||
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((AuthLoginBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if AuthLoginBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of AuthLoginBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(AuthLoginBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
Email == other.Email ||
|
||||
Email != null &&
|
||||
Email.Equals(other.Email)
|
||||
) &&
|
||||
(
|
||||
Password == other.Password ||
|
||||
Password != null &&
|
||||
Password.Equals(other.Password)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (Email != null)
|
||||
hashCode = hashCode * 59 + Email.GetHashCode();
|
||||
if (Password != null)
|
||||
hashCode = hashCode * 59 + Password.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(AuthLoginBody left, AuthLoginBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(AuthLoginBody left, AuthLoginBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
167
src/IO.Swagger/Models/AuthRegisterBody.cs
Normal file
167
src/IO.Swagger/Models/AuthRegisterBody.cs
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class AuthRegisterBody : IEquatable<AuthRegisterBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets FirstName
|
||||
/// </summary>
|
||||
|
||||
[StringLength(32, MinimumLength=3)]
|
||||
[DataMember(Name="firstName")]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LastName
|
||||
/// </summary>
|
||||
|
||||
[StringLength(32, MinimumLength=3)]
|
||||
[DataMember(Name="lastName")]
|
||||
public string LastName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Email
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Password
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class AuthRegisterBody {\n");
|
||||
sb.Append(" FirstName: ").Append(FirstName).Append("\n");
|
||||
sb.Append(" LastName: ").Append(LastName).Append("\n");
|
||||
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((AuthRegisterBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if AuthRegisterBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of AuthRegisterBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(AuthRegisterBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
FirstName == other.FirstName ||
|
||||
FirstName != null &&
|
||||
FirstName.Equals(other.FirstName)
|
||||
) &&
|
||||
(
|
||||
LastName == other.LastName ||
|
||||
LastName != null &&
|
||||
LastName.Equals(other.LastName)
|
||||
) &&
|
||||
(
|
||||
Email == other.Email ||
|
||||
Email != null &&
|
||||
Email.Equals(other.Email)
|
||||
) &&
|
||||
(
|
||||
Password == other.Password ||
|
||||
Password != null &&
|
||||
Password.Equals(other.Password)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (FirstName != null)
|
||||
hashCode = hashCode * 59 + FirstName.GetHashCode();
|
||||
if (LastName != null)
|
||||
hashCode = hashCode * 59 + LastName.GetHashCode();
|
||||
if (Email != null)
|
||||
hashCode = hashCode * 59 + Email.GetHashCode();
|
||||
if (Password != null)
|
||||
hashCode = hashCode * 59 + Password.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(AuthRegisterBody left, AuthRegisterBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(AuthRegisterBody left, AuthRegisterBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
151
src/IO.Swagger/Models/CurrencyAddAssetBody.cs
Normal file
151
src/IO.Swagger/Models/CurrencyAddAssetBody.cs
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class CurrencyAddAssetBody : IEquatable<CurrencyAddAssetBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets CollectionId
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="collectionId")]
|
||||
public int? CollectionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets AssetName
|
||||
/// </summary>
|
||||
|
||||
[StringLength(32, MinimumLength=1)]
|
||||
[DataMember(Name="assetName")]
|
||||
public string AssetName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets AssetLink
|
||||
/// </summary>
|
||||
[RegularExpression("/^(https?|ftp)://[^\\s/$.?#].[^\\s]*$/")]
|
||||
[DataMember(Name="assetLink")]
|
||||
public string AssetLink { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class CurrencyAddAssetBody {\n");
|
||||
sb.Append(" CollectionId: ").Append(CollectionId).Append("\n");
|
||||
sb.Append(" AssetName: ").Append(AssetName).Append("\n");
|
||||
sb.Append(" AssetLink: ").Append(AssetLink).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((CurrencyAddAssetBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if CurrencyAddAssetBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of CurrencyAddAssetBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(CurrencyAddAssetBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
CollectionId == other.CollectionId ||
|
||||
CollectionId != null &&
|
||||
CollectionId.Equals(other.CollectionId)
|
||||
) &&
|
||||
(
|
||||
AssetName == other.AssetName ||
|
||||
AssetName != null &&
|
||||
AssetName.Equals(other.AssetName)
|
||||
) &&
|
||||
(
|
||||
AssetLink == other.AssetLink ||
|
||||
AssetLink != null &&
|
||||
AssetLink.Equals(other.AssetLink)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (CollectionId != null)
|
||||
hashCode = hashCode * 59 + CollectionId.GetHashCode();
|
||||
if (AssetName != null)
|
||||
hashCode = hashCode * 59 + AssetName.GetHashCode();
|
||||
if (AssetLink != null)
|
||||
hashCode = hashCode * 59 + AssetLink.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(CurrencyAddAssetBody left, CurrencyAddAssetBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(CurrencyAddAssetBody left, CurrencyAddAssetBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
137
src/IO.Swagger/Models/CurrencyCreateBody.cs
Normal file
137
src/IO.Swagger/Models/CurrencyCreateBody.cs
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class CurrencyCreateBody : IEquatable<CurrencyCreateBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
|
||||
[StringLength(32, MinimumLength=1)]
|
||||
[DataMember(Name="name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Symbol
|
||||
/// </summary>
|
||||
|
||||
[StringLength(4, MinimumLength=1)]
|
||||
[DataMember(Name="symbol")]
|
||||
public string Symbol { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class CurrencyCreateBody {\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" Symbol: ").Append(Symbol).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((CurrencyCreateBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if CurrencyCreateBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of CurrencyCreateBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(CurrencyCreateBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
Name == other.Name ||
|
||||
Name != null &&
|
||||
Name.Equals(other.Name)
|
||||
) &&
|
||||
(
|
||||
Symbol == other.Symbol ||
|
||||
Symbol != null &&
|
||||
Symbol.Equals(other.Symbol)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (Name != null)
|
||||
hashCode = hashCode * 59 + Name.GetHashCode();
|
||||
if (Symbol != null)
|
||||
hashCode = hashCode * 59 + Symbol.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(CurrencyCreateBody left, CurrencyCreateBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(CurrencyCreateBody left, CurrencyCreateBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
120
src/IO.Swagger/Models/CurrencyCreateCollectionBody.cs
Normal file
120
src/IO.Swagger/Models/CurrencyCreateCollectionBody.cs
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class CurrencyCreateCollectionBody : IEquatable<CurrencyCreateCollectionBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets CollectionName
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="collectionName")]
|
||||
public string CollectionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class CurrencyCreateCollectionBody {\n");
|
||||
sb.Append(" CollectionName: ").Append(CollectionName).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((CurrencyCreateCollectionBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if CurrencyCreateCollectionBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of CurrencyCreateCollectionBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(CurrencyCreateCollectionBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
CollectionName == other.CollectionName ||
|
||||
CollectionName != null &&
|
||||
CollectionName.Equals(other.CollectionName)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (CollectionName != null)
|
||||
hashCode = hashCode * 59 + CollectionName.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(CurrencyCreateCollectionBody left, CurrencyCreateCollectionBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(CurrencyCreateCollectionBody left, CurrencyCreateCollectionBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
135
src/IO.Swagger/Models/CurrencyMintBody.cs
Normal file
135
src/IO.Swagger/Models/CurrencyMintBody.cs
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class CurrencyMintBody : IEquatable<CurrencyMintBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets CurrencyId
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="currencyId")]
|
||||
public int? CurrencyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Amount
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="amount")]
|
||||
public decimal? Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class CurrencyMintBody {\n");
|
||||
sb.Append(" CurrencyId: ").Append(CurrencyId).Append("\n");
|
||||
sb.Append(" Amount: ").Append(Amount).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((CurrencyMintBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if CurrencyMintBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of CurrencyMintBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(CurrencyMintBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
CurrencyId == other.CurrencyId ||
|
||||
CurrencyId != null &&
|
||||
CurrencyId.Equals(other.CurrencyId)
|
||||
) &&
|
||||
(
|
||||
Amount == other.Amount ||
|
||||
Amount != null &&
|
||||
Amount.Equals(other.Amount)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (CurrencyId != null)
|
||||
hashCode = hashCode * 59 + CurrencyId.GetHashCode();
|
||||
if (Amount != null)
|
||||
hashCode = hashCode * 59 + Amount.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(CurrencyMintBody left, CurrencyMintBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(CurrencyMintBody left, CurrencyMintBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
135
src/IO.Swagger/Models/WalletTransferDigitalBody.cs
Normal file
135
src/IO.Swagger/Models/WalletTransferDigitalBody.cs
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class WalletTransferDigitalBody : IEquatable<WalletTransferDigitalBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets Email
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets AssetId
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="assetId")]
|
||||
public int? AssetId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class WalletTransferDigitalBody {\n");
|
||||
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||
sb.Append(" AssetId: ").Append(AssetId).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((WalletTransferDigitalBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if WalletTransferDigitalBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of WalletTransferDigitalBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(WalletTransferDigitalBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
Email == other.Email ||
|
||||
Email != null &&
|
||||
Email.Equals(other.Email)
|
||||
) &&
|
||||
(
|
||||
AssetId == other.AssetId ||
|
||||
AssetId != null &&
|
||||
AssetId.Equals(other.AssetId)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (Email != null)
|
||||
hashCode = hashCode * 59 + Email.GetHashCode();
|
||||
if (AssetId != null)
|
||||
hashCode = hashCode * 59 + AssetId.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(WalletTransferDigitalBody left, WalletTransferDigitalBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(WalletTransferDigitalBody left, WalletTransferDigitalBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
150
src/IO.Swagger/Models/WalletTransferPhysicalBody.cs
Normal file
150
src/IO.Swagger/Models/WalletTransferPhysicalBody.cs
Normal file
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class WalletTransferPhysicalBody : IEquatable<WalletTransferPhysicalBody>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets Email
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Amount
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="amount")]
|
||||
public decimal? Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets CurrencyId
|
||||
/// </summary>
|
||||
|
||||
[DataMember(Name="currencyId")]
|
||||
public int? CurrencyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class WalletTransferPhysicalBody {\n");
|
||||
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||
sb.Append(" Amount: ").Append(Amount).Append("\n");
|
||||
sb.Append(" CurrencyId: ").Append(CurrencyId).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((WalletTransferPhysicalBody)obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if WalletTransferPhysicalBody instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of WalletTransferPhysicalBody to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(WalletTransferPhysicalBody other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
(
|
||||
Email == other.Email ||
|
||||
Email != null &&
|
||||
Email.Equals(other.Email)
|
||||
) &&
|
||||
(
|
||||
Amount == other.Amount ||
|
||||
Amount != null &&
|
||||
Amount.Equals(other.Amount)
|
||||
) &&
|
||||
(
|
||||
CurrencyId == other.CurrencyId ||
|
||||
CurrencyId != null &&
|
||||
CurrencyId.Equals(other.CurrencyId)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
var hashCode = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (Email != null)
|
||||
hashCode = hashCode * 59 + Email.GetHashCode();
|
||||
if (Amount != null)
|
||||
hashCode = hashCode * 59 + Amount.GetHashCode();
|
||||
if (CurrencyId != null)
|
||||
hashCode = hashCode * 59 + CurrencyId.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#region Operators
|
||||
#pragma warning disable 1591
|
||||
|
||||
public static bool operator ==(WalletTransferPhysicalBody left, WalletTransferPhysicalBody right)
|
||||
{
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
public static bool operator !=(WalletTransferPhysicalBody left, WalletTransferPhysicalBody right)
|
||||
{
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
#pragma warning restore 1591
|
||||
#endregion Operators
|
||||
}
|
||||
}
|
||||
29
src/IO.Swagger/Program.cs
Normal file
29
src/IO.Swagger/Program.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore;
|
||||
|
||||
namespace IO.Swagger
|
||||
{
|
||||
/// <summary>
|
||||
/// Program
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Main
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateWebHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the web host builder.
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns>IWebHostBuilder</returns>
|
||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
}
|
||||
36
src/IO.Swagger/Properties/launchSettings.json
Normal file
36
src/IO.Swagger/Properties/launchSettings.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50352/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger/",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||
"publishAllPorts": true,
|
||||
"useSSL": true
|
||||
}
|
||||
}
|
||||
}
|
||||
58
src/IO.Swagger/Security/BearerAuthenticationHandler.cs
Normal file
58
src/IO.Swagger/Security/BearerAuthenticationHandler.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace IO.Swagger.Security
|
||||
{
|
||||
/// <summary>
|
||||
/// class to handle bearer authentication.
|
||||
/// </summary>
|
||||
public class BearerAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
|
||||
{
|
||||
/// <summary>
|
||||
/// scheme name for authentication handler.
|
||||
/// </summary>
|
||||
public const string SchemeName = "Bearer";
|
||||
|
||||
public BearerAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verify that require authorization header exists.
|
||||
/// </summary>
|
||||
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
|
||||
{
|
||||
if (!Request.Headers.ContainsKey("Authorization"))
|
||||
{
|
||||
return AuthenticateResult.Fail("Missing Authorization Header");
|
||||
}
|
||||
try
|
||||
{
|
||||
var authHeader = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]);
|
||||
|
||||
/// TODO handle token.
|
||||
}
|
||||
catch
|
||||
{
|
||||
return AuthenticateResult.Fail("Invalid Authorization Header");
|
||||
}
|
||||
|
||||
var claims = new[] {
|
||||
new Claim(ClaimTypes.NameIdentifier, "changeme"),
|
||||
new Claim(ClaimTypes.Name, "changeme"),
|
||||
};
|
||||
var identity = new ClaimsIdentity(claims, Scheme.Name);
|
||||
var principal = new ClaimsPrincipal(identity);
|
||||
var ticket = new AuthenticationTicket(principal, Scheme.Name);
|
||||
|
||||
return AuthenticateResult.Success(ticket);
|
||||
}
|
||||
}
|
||||
}
|
||||
146
src/IO.Swagger/Startup.cs
Normal file
146
src/IO.Swagger/Startup.cs
Normal file
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* T&J Central Bank API
|
||||
*
|
||||
* API documentation for T&J Central Bank's digital wallets
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Swashbuckle.AspNetCore.Swagger;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using IO.Swagger.Filters;
|
||||
using IO.Swagger.Security;
|
||||
|
||||
namespace IO.Swagger
|
||||
{
|
||||
/// <summary>
|
||||
/// Startup
|
||||
/// </summary>
|
||||
public class Startup
|
||||
{
|
||||
private readonly IWebHostEnvironment _hostingEnv;
|
||||
|
||||
private IConfiguration Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="env"></param>
|
||||
/// <param name="configuration"></param>
|
||||
public Startup(IWebHostEnvironment env, IConfiguration configuration)
|
||||
{
|
||||
_hostingEnv = env;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method gets called by the runtime. Use this method to add services to the container.
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Add framework services.
|
||||
services
|
||||
.AddMvc(options =>
|
||||
{
|
||||
options.InputFormatters.RemoveType<Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter>();
|
||||
options.OutputFormatters.RemoveType<Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter>();
|
||||
})
|
||||
.AddNewtonsoftJson(opts =>
|
||||
{
|
||||
opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
|
||||
opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy()));
|
||||
})
|
||||
.AddXmlSerializerFormatters();
|
||||
|
||||
services.AddAuthentication(BearerAuthenticationHandler.SchemeName)
|
||||
.AddScheme<AuthenticationSchemeOptions, BearerAuthenticationHandler>(BearerAuthenticationHandler.SchemeName, null);
|
||||
|
||||
|
||||
services
|
||||
.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("1.0.0", new OpenApiInfo
|
||||
{
|
||||
Version = "1.0.0",
|
||||
Title = "T&J Central Bank API",
|
||||
Description = "T&J Central Bank API (ASP.NET 7.0)",
|
||||
Contact = new OpenApiContact()
|
||||
{
|
||||
Name = "Swagger Codegen Contributors",
|
||||
Url = new Uri("https://github.com/swagger-api/swagger-codegen"),
|
||||
Email = ""
|
||||
},
|
||||
// TermsOfService = new Uri("")
|
||||
});
|
||||
c.CustomSchemaIds(type => type.FullName);
|
||||
c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml");
|
||||
// Sets the basePath property in the Swagger document generated
|
||||
c.DocumentFilter<BasePathFilter>("/v1");
|
||||
|
||||
// Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..)
|
||||
// Use [ValidateModelState] on Actions to actually validate it in C# as well!
|
||||
c.OperationFilter<GeneratePathParamsValidationFilter>();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
/// </summary>
|
||||
/// <param name="app"></param>
|
||||
/// <param name="env"></param>
|
||||
/// <param name="loggerFactory"></param>
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
app.UseRouting();
|
||||
|
||||
//TODO: Uncomment this if you need wwwroot folder
|
||||
// app.UseStaticFiles();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
//TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes)
|
||||
c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "T&J Central Bank API");
|
||||
|
||||
//TODO: Or alternatively use the original Swagger contract that's included in the static files
|
||||
// c.SwaggerEndpoint("/swagger-original.json", "T&J Central Bank API Original");
|
||||
});
|
||||
|
||||
//TODO: Use Https Redirection
|
||||
// app.UseHttpsRedirection();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling)
|
||||
app.UseExceptionHandler("/Error");
|
||||
|
||||
app.UseHsts();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/IO.Swagger/appsettings.json
Normal file
10
src/IO.Swagger/appsettings.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/IO.Swagger/web.config
Normal file
24
src/IO.Swagger/web.config
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!--
|
||||
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
|
||||
-->
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||
</handlers>
|
||||
<aspNetCore processPath="%LAUNCHER_PATH%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="InProcess">
|
||||
<environmentVariables>
|
||||
<environmentVariable name="COMPLUS_ForceENC" value="1" />
|
||||
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||
<environmentVariable name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="Microsoft.AspNetCore.Watch.BrowserRefresh;Microsoft.WebTools.BrowserLink.Net" />
|
||||
<environmentVariable name="DOTNET_STARTUP_HOOKS" value="C:\Program Files\dotnet\SDK\7.0.400\DotnetTools\dotnet-watch\7.0.400-rtm.23369.15\tools\net7.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Web Tools\Browser Link\Microsoft.WebTools.BrowserLink.Net.dll;c:\program files\microsoft visual studio\2022\community\common7\ide\commonextensions\microsoft\hotreload\Microsoft.Extensions.DotNetDeltaApplier.dll" />
|
||||
<environmentVariable name="ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT" value="wss://localhost:44349/IO.Swagger/,ws://localhost:50633/IO.Swagger/" />
|
||||
<environmentVariable name="DOTNET_MODIFIABLE_ASSEMBLIES" value="debug" />
|
||||
<environmentVariable name="ASPNETCORE_AUTO_RELOAD_WS_KEY" value="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuvpSuAatIokMxzmPdM4egZimjWBPCukyvXO2w3GLeYU+aRSYH/KiZnBvy6785t/Fr2/Y4gF665nvaEMM1uveLOQvwRuICcL/R5mbYwKtKd/VJ4NYamzS5Zd4Fms/9eRf4IHGFu+SjX2Q/MTqVJa7a7w1hLAKoBDGbqJ2V0i7w87qj08XTcBdLRs5gL0je9EJ1QeggFzcY6SVCp+a9MFpybM57WI82h9uysW9rC9H9n0Nelc2D9+2HUbBExHQVTVXKlQ2KWHbxhBKsHzf4k4bBjy6V31e9G/dnWCciXNBQiIPidCp4Nt3AF+bpq080+aRFzIIh5wK1tupyG1BsffFHQIDAQAB" />
|
||||
<environmentVariable name="ASPNETCORE_AUTO_RELOAD_VDIR" value="/" />
|
||||
<environmentVariable name="DOTNET_HOTRELOAD_NAMEDPIPE_NAME" value="89813085-9fe3-4177-915d-b2a8e67e66aa" />
|
||||
</environmentVariables>
|
||||
</aspNetCore>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
42
src/IO.Swagger/wwwroot/README.md
Normal file
42
src/IO.Swagger/wwwroot/README.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Welcome to ASP.NET 5 Preview
|
||||
|
||||
We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new.
|
||||
|
||||
ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854).
|
||||
Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks).
|
||||
|
||||
We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015.
|
||||
The ASP.NET Team
|
||||
|
||||
### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016)
|
||||
|
||||
### This application consists of:
|
||||
* Sample pages using ASP.NET MVC 6
|
||||
* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources
|
||||
* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939)
|
||||
|
||||
#### NEW CONCEPTS
|
||||
* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008)
|
||||
* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012)
|
||||
* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013)
|
||||
* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014)
|
||||
* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849)
|
||||
* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850)
|
||||
|
||||
#### CUSTOMIZE APP
|
||||
* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600)
|
||||
* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602)
|
||||
* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603)
|
||||
* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606)
|
||||
* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604)
|
||||
* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009)
|
||||
* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848)
|
||||
|
||||
#### DEPLOY
|
||||
* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851)
|
||||
* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852)
|
||||
* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853)
|
||||
* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609)
|
||||
* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019)
|
||||
|
||||
We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015)
|
||||
1
src/IO.Swagger/wwwroot/index.html
Normal file
1
src/IO.Swagger/wwwroot/index.html
Normal file
@ -0,0 +1 @@
|
||||
<meta http-equiv="refresh" content="0;URL='./swagger/'" />
|
||||
471
src/IO.Swagger/wwwroot/swagger-original.json
Normal file
471
src/IO.Swagger/wwwroot/swagger-original.json
Normal file
@ -0,0 +1,471 @@
|
||||
{
|
||||
"openapi" : "3.0.0",
|
||||
"info" : {
|
||||
"title" : "T&J Central Bank API",
|
||||
"description" : "API documentation for T&J Central Bank's digital wallets",
|
||||
"version" : "1.0.0"
|
||||
},
|
||||
"servers" : [ {
|
||||
"url" : "https://tjbank.shrukanslab.xyz/v1"
|
||||
} ],
|
||||
"tags" : [ {
|
||||
"name" : "auth",
|
||||
"description" : "User authentication operations"
|
||||
}, {
|
||||
"name" : "wallet",
|
||||
"description" : "User wallet operations"
|
||||
}, {
|
||||
"name" : "currency",
|
||||
"description" : "Currency and asset operations"
|
||||
} ],
|
||||
"paths" : {
|
||||
"/api/auth/register" : {
|
||||
"post" : {
|
||||
"tags" : [ "auth" ],
|
||||
"summary" : "Register a new user",
|
||||
"operationId" : "registerUser",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/auth_register_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"201" : {
|
||||
"description" : "User registered successfully",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"example" : {
|
||||
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"409" : {
|
||||
"description" : "Conflict (user with provided email already exists)"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/login" : {
|
||||
"post" : {
|
||||
"tags" : [ "auth" ],
|
||||
"summary" : "Log in with email and password",
|
||||
"operationId" : "loginUser",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/auth_login_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Logged in successfully",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"example" : {
|
||||
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/details" : {
|
||||
"get" : {
|
||||
"tags" : [ "auth" ],
|
||||
"summary" : "Get user details",
|
||||
"operationId" : "getUserDetails",
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Successful response",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"example" : {
|
||||
"firstName" : "John",
|
||||
"lastName" : "Doe",
|
||||
"email" : "user@example.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/wallet" : {
|
||||
"get" : {
|
||||
"tags" : [ "wallet" ],
|
||||
"summary" : "Get user's wallet",
|
||||
"operationId" : "getUserWallet",
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Successful response",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"example" : {
|
||||
"currencies" : [ {
|
||||
"id" : 1,
|
||||
"name" : "US Dollar",
|
||||
"symbol" : "USD",
|
||||
"amount" : 1500
|
||||
} ],
|
||||
"digitalAssets" : [ {
|
||||
"id" : 101,
|
||||
"name" : "Bitcoin",
|
||||
"link" : "https://example.com/bitcoin"
|
||||
} ]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/wallet/transferPhysical" : {
|
||||
"post" : {
|
||||
"tags" : [ "wallet" ],
|
||||
"summary" : "Transfer physical currency to another user",
|
||||
"operationId" : "transferPhysicalCurrency",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/wallet_transferPhysical_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Successful transfer"
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/wallet/transferDigital" : {
|
||||
"post" : {
|
||||
"tags" : [ "wallet" ],
|
||||
"summary" : "Transfer digital asset to another user",
|
||||
"operationId" : "transferDigitalAsset",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/wallet_transferDigital_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Successful transfer"
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/currency/mint" : {
|
||||
"post" : {
|
||||
"tags" : [ "currency" ],
|
||||
"summary" : "Mint additional units of a currency",
|
||||
"operationId" : "mintCurrency",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/currency_mint_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"200" : {
|
||||
"description" : "Successful minting"
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/currency/create" : {
|
||||
"post" : {
|
||||
"tags" : [ "currency" ],
|
||||
"summary" : "Create a new currency type",
|
||||
"operationId" : "createCurrency",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/currency_create_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"201" : {
|
||||
"description" : "Currency type created successfully"
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/currency/createCollection" : {
|
||||
"post" : {
|
||||
"tags" : [ "currency" ],
|
||||
"summary" : "Create a new collection of digital assets owned by the user",
|
||||
"operationId" : "createAssetCollection",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/currency_createCollection_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"201" : {
|
||||
"description" : "Successful collection creation",
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"example" : {
|
||||
"message" : "Digital asset collection created successfully",
|
||||
"collectionId" : 123
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"/api/currency/addAsset" : {
|
||||
"post" : {
|
||||
"tags" : [ "currency" ],
|
||||
"summary" : "Add a digital asset to the user's collection",
|
||||
"operationId" : "addDigitalAssetToCollection",
|
||||
"requestBody" : {
|
||||
"content" : {
|
||||
"application/json" : {
|
||||
"schema" : {
|
||||
"$ref" : "#/components/schemas/currency_addAsset_body"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required" : true
|
||||
},
|
||||
"responses" : {
|
||||
"201" : {
|
||||
"description" : "Successful asset addition"
|
||||
},
|
||||
"400" : {
|
||||
"description" : "Bad Request"
|
||||
},
|
||||
"401" : {
|
||||
"description" : "Unauthorized"
|
||||
}
|
||||
},
|
||||
"security" : [ {
|
||||
"BearerAuth" : [ ]
|
||||
} ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"components" : {
|
||||
"schemas" : {
|
||||
"auth_register_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"firstName" : {
|
||||
"maxLength" : 32,
|
||||
"minLength" : 3,
|
||||
"type" : "string"
|
||||
},
|
||||
"lastName" : {
|
||||
"maxLength" : 32,
|
||||
"minLength" : 3,
|
||||
"type" : "string"
|
||||
},
|
||||
"email" : {
|
||||
"pattern" : "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"type" : "string",
|
||||
"format" : "email"
|
||||
},
|
||||
"password" : {
|
||||
"type" : "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"currency_addAsset_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"collectionId" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"assetName" : {
|
||||
"maxLength" : 32,
|
||||
"minLength" : 1,
|
||||
"type" : "string"
|
||||
},
|
||||
"assetLink" : {
|
||||
"pattern" : "^(https?|ftp):\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"type" : "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"currency_create_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"name" : {
|
||||
"maxLength" : 32,
|
||||
"minLength" : 1,
|
||||
"type" : "string"
|
||||
},
|
||||
"symbol" : {
|
||||
"maxLength" : 4,
|
||||
"minLength" : 1,
|
||||
"type" : "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auth_login_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"email" : {
|
||||
"pattern" : "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"type" : "string",
|
||||
"format" : "email"
|
||||
},
|
||||
"password" : {
|
||||
"type" : "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"currency_mint_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"currencyId" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"amount" : {
|
||||
"type" : "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"currency_createCollection_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"collectionName" : {
|
||||
"type" : "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"wallet_transferPhysical_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"email" : {
|
||||
"type" : "string",
|
||||
"format" : "email"
|
||||
},
|
||||
"amount" : {
|
||||
"type" : "number"
|
||||
},
|
||||
"currencyId" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"wallet_transferDigital_body" : {
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"email" : {
|
||||
"type" : "string",
|
||||
"format" : "email"
|
||||
},
|
||||
"assetId" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securitySchemes" : {
|
||||
"BearerAuth" : {
|
||||
"type" : "http",
|
||||
"scheme" : "bearer",
|
||||
"bearerFormat" : "JWT"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
src/IO.Swagger/wwwroot/web.config
Normal file
9
src/IO.Swagger/wwwroot/web.config
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
|
||||
</handlers>
|
||||
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user