Doxy, -Wall -Werror, other cleanup and organization first round
This commit is contained in:
@ -7,27 +7,25 @@
|
||||
*
|
||||
* 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 AutoMapper;
|
||||
using IO.Swagger.Attributes;
|
||||
using IO.Swagger.Models.RequestDto;
|
||||
using IO.Swagger.Models.ResponseDto;
|
||||
using IO.Swagger.Repositories;
|
||||
using IO.Swagger.Security;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IO.Swagger.Models.dto;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using IO.Swagger.Repositories;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
|
||||
namespace IO.Swagger.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// The controller for accessing routes for wallet management
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
public class WalletApiController : ControllerBase
|
||||
@ -35,6 +33,16 @@ namespace IO.Swagger.Controllers
|
||||
private readonly ITransactionRepository transactionRepository;
|
||||
private readonly IMapper mapper;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WalletApiController"/> class.
|
||||
/// </summary>
|
||||
/// <param name="transactionRepository">The transaction repository.</param>
|
||||
/// <param name="mapper">The mapper.</param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// transactionRepository
|
||||
/// or
|
||||
/// mapper
|
||||
/// </exception>
|
||||
public WalletApiController(ITransactionRepository transactionRepository, IMapper mapper)
|
||||
{
|
||||
this.transactionRepository = transactionRepository ?? throw new ArgumentNullException(nameof(transactionRepository));
|
||||
@ -102,8 +110,8 @@ namespace IO.Swagger.Controllers
|
||||
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||||
[ValidateModelState]
|
||||
[SwaggerOperation("TransferDigitalAsset")]
|
||||
public virtual IActionResult TransferDigitalAsset([FromBody]WalletTransferDigitalBody body)
|
||||
{
|
||||
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);
|
||||
|
||||
@ -130,7 +138,7 @@ namespace IO.Swagger.Controllers
|
||||
[SwaggerOperation("TransferPhysicalCurrency")]
|
||||
[ProducesResponseType(typeof(IEnumerable<string>), 400)]
|
||||
[ProducesResponseType(typeof(TransactionReturnCode), 409)]
|
||||
public virtual async Task<IActionResult> TransferPhysicalCurrency([FromBody]WalletTransferPhysicalBody body)
|
||||
public virtual async Task<IActionResult> TransferPhysicalCurrency([FromBody] WalletTransferPhysicalBody body)
|
||||
{
|
||||
var userIdString = HttpContext.User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value;
|
||||
if (!int.TryParse(userIdString, out int userId))
|
||||
|
||||
Reference in New Issue
Block a user